Skip to content

Swift 6.2 linking fails depending on the number of parallel jobs #231

@ivanovdmitri

Description

@ivanovdmitri

Describe the bug

This bug shows up on both macOS (15.7.1, swift 6.2) and Linux (swift:noble docker image, that runs Ubuntu 24.04.3 LTS, swift-6.2-RELEASE) Linking appears to depend on the number of jobs used

To Reproduce

$ git clone https://github.com/pointfreeco/swift-case-paths
$ git checkout 1.7.2
$ swift test --jobs 2 # fails with the message below but works if the number of jobs is 4 or more

Expected behavior
Expect the unit tests to build (and pass)

Screenshots
error: link command failed with exit code 1 (use -v to see invocation)
/project/.build/aarch64-unknown-linux-gnu/debug/CasePathsMacros-tool.build/CasePathableMacro.swift.o:CasePathableMacro.swift.o:$s15CasePathsMacros12SelfRewriterCMf:(.data+0x1358): error: undefined reference to '$s11SwiftSyntax0B8RewriterC14visitationFunc33_F0C5D882E9301122F145EADC4573BFC8LL3forAA0B0VAHcAH_tF'
/project/.build/aarch64-unknown-linux-gnu/debug/CasePathsMacros-tool.build/CasePathableMacro.swift.o:CasePathableMacro.swift.o:$s15CasePathsMacros15ElementRewriterCMf:(.data+0x2670): error: undefined reference to '$s11SwiftSyntax0B8RewriterC14visitationFunc33_F0C5D882E9301122F145EADC4573BFC8LL3forAA0B0VAHcAH_tF'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[240/315] Linking CasePathsMacros-tool
error: fatalError

Environment

  • swift-case-paths 1.7.2
  • Xcode 26.0.1
  • Swift 6.2
  • OS: macOS 15.7.1

Additional context
There is also a tests compilation issue that is readily fixed by updating both Package.swift and Package@swift-6.0.swift with:

  package.targets.append(
    .testTarget(
      name: "CasePathsMacrosTests",
      dependencies: [
        "CasePathsMacros",
        .product(
          name: "MacroTesting",
          package: "swift-macro-testing"
        ),
        .product(name: "SwiftSyntaxMacros", package: "swift-syntax"), // fix compilation issue
      ]
    )
  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions