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

Duplicate symbol conflicts with Xcode 16 beta 1 #60

Open
jpsim opened this issue Jun 11, 2024 · 1 comment · May be fixed by #62
Open

Duplicate symbol conflicts with Xcode 16 beta 1 #60

jpsim opened this issue Jun 11, 2024 · 1 comment · May be fixed by #62

Comments

@jpsim
Copy link
Collaborator

jpsim commented Jun 11, 2024

Looks like something changed in Xcode 16 beta 1 (16A5171c) causing some C++ demangle functions to be conflicting with the macOS SDK:

$ xcodebuild -version
Xcode 16.0
Build version 16A5171c
$ swift --version
swift-driver version: 1.109.2 Apple Swift version 6.0 (swiftlang-6.0.0.3.300 clang-1600.0.20.10)
Target: arm64-apple-macosx14.0
$ swift test       
Building for debugging...
error: link command failed with exit code 1 (use -v to see invocation)
ld: warning: duplicate -rpath '/Applications/Xcode-16.0.0-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib' ignored
Undefined symbols for architecture arm64:
  "swift::Demangle::Node::getNumChildren() const", referenced from:
      swift::Demangle::Node::hasChildren() const in CSwiftDemangle.cpp.o
      _node_getNumChildren in CSwiftDemangle.cpp.o
      swift::Demangle::Node::getChild(unsigned long) const in CSwiftDemangle.cpp.o
  "swift::Demangle::Node::begin() const", referenced from:
      swift::Demangle::Node::getChild(unsigned long) const in CSwiftDemangle.cpp.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[9/10] Linking IndexStorePackageTests
error: fatalError

This impacts both SwiftPM (swift test) and Bazel (bazel build //...).

Maybe we need to update swiftDemangleLinkerSettings in the package manifest?

@keith
Copy link
Member

keith commented Jun 25, 2024

I think we need to re-sync the headers from the swift release branch, since these are actually undefined maybe they've been added since we last did that

jpsim added a commit to jpsim/swift-index-store that referenced this issue Jul 11, 2024
Updated some files from https://github.com/apple/llvm-project and
https://github.com/swiftlang/swift.

I'm not confident that I did this correctly, but the tests do pass and
this does fix
MobileNativeFoundation#60.

```
$ swift --version
swift-driver version: 1.111.2 Apple Swift version 6.0 (swiftlang-6.0.0.5.15 clang-1600.0.22.6)
Target: arm64-apple-macosx14.0
$ swift test
Building for debugging...
ld: warning: duplicate -rpath '/Applications/Xcode-16.0.0-Beta.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib' ignored
[67/67] Linking IndexStorePackageTests
Build complete! (7.53s)
Test Suite 'All tests' started at 2024-07-11 13:12:09.222.
Test Suite 'IndexStorePackageTests.xctest' started at 2024-07-11 13:12:09.223.
Test Suite 'IndexStoreTests' started at 2024-07-11 13:12:09.223.
Test Case '-[IndexStoreTests.IndexStoreTests testExerciseIndexStore]' started.
Test Case '-[IndexStoreTests.IndexStoreTests testExerciseIndexStore]' passed (0.506 seconds).
Test Case '-[IndexStoreTests.IndexStoreTests testMissingIndexStore]' started.
Test Case '-[IndexStoreTests.IndexStoreTests testMissingIndexStore]' passed (0.000 seconds).
Test Suite 'IndexStoreTests' passed at 2024-07-11 13:12:09.729.
	 Executed 2 tests, with 0 failures (0 unexpected) in 0.506 (0.506) seconds
Test Suite 'SwiftDemangleTests' started at 2024-07-11 13:12:09.729.
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testBreathFirstSequence]' started.
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testBreathFirstSequence]' passed (0.000 seconds).
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testDemangle]' started.
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testDemangle]' passed (0.000 seconds).
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testObjCUSR]' started.
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testObjCUSR]' passed (0.000 seconds).
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testSwiftExtensionUSR]' started.
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testSwiftExtensionUSR]' passed (0.000 seconds).
Test Suite 'SwiftDemangleTests' passed at 2024-07-11 13:12:09.730.
	 Executed 4 tests, with 0 failures (0 unexpected) in 0.001 (0.001) seconds
Test Suite 'IndexStorePackageTests.xctest' passed at 2024-07-11 13:12:09.730.
	 Executed 6 tests, with 0 failures (0 unexpected) in 0.507 (0.507) seconds
Test Suite 'All tests' passed at 2024-07-11 13:12:09.730.
	 Executed 6 tests, with 0 failures (0 unexpected) in 0.507 (0.508) seconds
```

This will fail on CI until it is updated to Swift 6.
@jpsim jpsim linked a pull request Jul 11, 2024 that will close this issue
jpsim added a commit to jpsim/swift-index-store that referenced this issue Jul 11, 2024
Updated some files from https://github.com/apple/llvm-project and
https://github.com/swiftlang/swift.

I'm not confident that I did this correctly, but the tests do pass and
this does fix
MobileNativeFoundation#60.

```
$ swift --version
swift-driver version: 1.111.2 Apple Swift version 6.0 (swiftlang-6.0.0.5.15 clang-1600.0.22.6)
Target: arm64-apple-macosx14.0
$ swift test
Building for debugging...
ld: warning: duplicate -rpath '/Applications/Xcode-16.0.0-Beta.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib' ignored
[67/67] Linking IndexStorePackageTests
Build complete! (7.53s)
Test Suite 'All tests' started at 2024-07-11 13:12:09.222.
Test Suite 'IndexStorePackageTests.xctest' started at 2024-07-11 13:12:09.223.
Test Suite 'IndexStoreTests' started at 2024-07-11 13:12:09.223.
Test Case '-[IndexStoreTests.IndexStoreTests testExerciseIndexStore]' started.
Test Case '-[IndexStoreTests.IndexStoreTests testExerciseIndexStore]' passed (0.506 seconds).
Test Case '-[IndexStoreTests.IndexStoreTests testMissingIndexStore]' started.
Test Case '-[IndexStoreTests.IndexStoreTests testMissingIndexStore]' passed (0.000 seconds).
Test Suite 'IndexStoreTests' passed at 2024-07-11 13:12:09.729.
	 Executed 2 tests, with 0 failures (0 unexpected) in 0.506 (0.506) seconds
Test Suite 'SwiftDemangleTests' started at 2024-07-11 13:12:09.729.
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testBreathFirstSequence]' started.
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testBreathFirstSequence]' passed (0.000 seconds).
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testDemangle]' started.
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testDemangle]' passed (0.000 seconds).
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testObjCUSR]' started.
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testObjCUSR]' passed (0.000 seconds).
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testSwiftExtensionUSR]' started.
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testSwiftExtensionUSR]' passed (0.000 seconds).
Test Suite 'SwiftDemangleTests' passed at 2024-07-11 13:12:09.730.
	 Executed 4 tests, with 0 failures (0 unexpected) in 0.001 (0.001) seconds
Test Suite 'IndexStorePackageTests.xctest' passed at 2024-07-11 13:12:09.730.
	 Executed 6 tests, with 0 failures (0 unexpected) in 0.507 (0.507) seconds
Test Suite 'All tests' passed at 2024-07-11 13:12:09.730.
	 Executed 6 tests, with 0 failures (0 unexpected) in 0.507 (0.508) seconds
```

This will fail on CI until it is updated to Swift 6.

Signed-off-by: JP Simard <[email protected]>
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