Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails in release with: ld: Undefined symbols: static (extension in SystemPackage):SystemPackage._StrSlice.== infix(A, A) -> Swift.Bool #138

Open
weissi opened this issue Aug 7, 2023 · 1 comment
Milestone

Comments

@weissi
Copy link
Member

weissi commented Aug 7, 2023

Any package which depends on swift-system and uses the == on FilePath.Component will fail to build in release mode (debug is fine).

Consider this example program

import SystemPackage

print(FilePath("/x").lastComponent! == FilePath("/x").lastComponent!)

with the following dependencies/targets

    dependencies: [
        .package(url: "https://github.com/apple/swift-system.git", from: "1.0.0"),
    ],
    targets: [
        .executableTarget(
            name: "repro",
            dependencies: [
                .product(name: "SystemPackage", package: "swift-system"),
            ]
        ),
    ]

debug works

$ swift run 
Building for debugging...
Build complete! (0.34s)
true

release fails

$ swift run -c release
Building for production...
error: link command failed with exit code 1 (use -v to see invocation)
ld: Undefined symbols:
  static (extension in SystemPackage):SystemPackage._StrSlice.== infix(A, A) -> Swift.Bool, referenced from:
      _repro_main in main.swift.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: fatalError
[0/1] Linking repro

Also reproes in Xcode.

This is Xcode 15A221 but also reproduces on anything else I tried.

@weissi
Copy link
Member Author

weissi commented Aug 7, 2023

-> rdar://113495818

@glessard glessard added this to the 1.4.0 milestone May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants