-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SR-1639][SourceKit] Link SwiftLang libraries to sourcekitd #2766
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-1639][SourceKit] Link SwiftLang libraries to sourcekitd #2766
Conversation
When building SourceKit on Linux, sourcekitdAPI would not be linked to SourceKitSwiftLang, which caused the following symbols to be undefined: - `SourceKit::LangSupport::SynthesizedUSRSeparator` - `SourceKit::LangSupport::createSwiftLangSupport(SourceKit::Context&)` Link SourceKitSwiftLang to resolve these symbols.
@swift-ci please test |
DEPENDS | ||
SourceKitSupport SourceKitSwiftLang | ||
# Clang dependencies, required by SourceKitSwiftLang | ||
clangFormat clangToolingCore clangDriver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there's a way with CMake to link SourceKitSwiftLang
such that its own dependencies don't need to be listed again here? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I wondered that as well. I was surprised I had to do this, to be honest. Maybe @llvm-beanz would know?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't have to do this. CMake understands transitive dependencies between static archives, it should do the right thing.
I suspect this is caused by the way Swift builds out-of-tree with LLVM & Clang. My "stab in the dark" here is that it handles static libraries specified by full path differently than libraries that are specified by target.
I wonder if this could be fixed in a minimally invasive way by having Swift include the CMake Exports lists from Clang and LLVM. Then the LLVM and Clang targets would be exposed more cleanly in Swift's build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are already using the LLVM exports list. I am going to be looking into doing the Clang side of it in a bit. It is causing us problems on master-next.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on the problem? Including LLVMExports.cmake and ClangTargets.cmake should setup all the transitive dependencies correctly.
LGTM |
These changes are still relevant. Looks like @briancroom is cool with this change, so I'll go ahead and merge if the tests pass. If any other committers have thoughts, let me know! The test run was so long ago, Jenkins must have cleaned up the job page -- it's a 404 now. Re-running to see how things currently stand: @swift-ci please test |
The swift-package-manager failure in |
What's in this pull request?
When building SourceKit on Linux, sourcekitdAPI would not be linked to SourceKitSwiftLang, which caused the following symbols to be undefined:
SourceKit::LangSupport::SynthesizedUSRSeparator
SourceKit::LangSupport::createSwiftLangSupport(SourceKit::Context&)
Link SourceKitSwiftLang to resolve these symbols.
ResolvedRelated bug number: (SR-1639)Before merging this pull request to apple/swift repository:
Triggering Swift CI
The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:
Smoke Testing
Validation Testing
Lint Testing
Note: Only members of the Apple organization can trigger swift-ci.