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
[SR-9972] Linker error when building SwiftSyntax using SwiftPM's generated Xcodeproj in Xcode 10.2 beta 3 #52376
Comments
@belkadan any idea what's going on? |
I think we decided that something funny was going on where we thought arclite was going to be in the toolchain but then it wasn't (maybe the arc/ directory exists but it's empty). |
Stupid question: why would a SwiftPM build (from the same toolchain) not generate the same error? |
Whether or not you need arclite depends on your deployment target. I suspect SwiftPM is always building for the host OS. |
Ahh, figured it out today. It's because we're now shipping Clang in the downloadable toolchain too. |
5.1: #22923 |
Thanks! |
I'm still seeing this error, even in recent toolchains. Any idea why? |
Hm, no. Fully the same, with your toolchain name in the path and then libarclite_macosx.a at the end? |
Exactly the same, yes. |
And which toolchain? |
For example, here's the error on march 26th toolchain: ld: file not found: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2019-03-26-a.xctoolchain/usr/lib/arc/libarclite_macosx.a I'll try with a more recent one. |
Same with the latest master toolchain: ld: file not found: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2019-04-10-a.xctoolchain/usr/lib/arc/libarclite_macosx.a |
@belkadan I'm not the only one with the issue: #23701 (comment) |
Oh, bah. Xcode probably needs the same fix that the Swift driver took. Do you want to file a Radar or should I? |
If you can, I'd appreciate it. If not, I'll try to find some time tomorrow. |
…it's even worse than I thought. Xcode just calls Clang to link. It doesn't add arclite itself. But the Clang in the toolchain doesn't have a copy of arclite, because that's not an open-source library. (Well, it's not part of the Swift project, anyway.) I'm not sure what the right fix is here, but "don't use an open-source toolchain" definitely isn't it. A workaround is to change your deployment target to 10.11 or newer. |
Filed rdar://problem/49947573 and talking to the Apple Clang folks. |
Additional Detail from JIRA
md5: 07ac891ad766d7dd268dcc9e0328f39e
Issue Description:
I haven't had to time to diagnose what could be causing this issue but those steps reproduce it:
Install Xcode 10.2 beta 3
Install the latest master toolchain
Clone the latest commit from SwiftSyntax
Execute:
Launch Xcode 10.2 beta3 with the generated project
Build any of the schemes.
Xcode will fail building with the following linker error:
On the other hand, building using either the build-script or SwiftPM directly works:
The text was updated successfully, but these errors were encountered: