MobileNativeFoundation / swift-index-store

Library to read from Swift / clang source code indexes
Apache License 2.0
137 stars 11 forks source link

Duplicate symbol conflicts with Xcode 16 beta 1 #60

Open jpsim opened 3 months ago

jpsim commented 3 months ago

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 commented 2 months ago

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