Skip to content

[SourceKit] CMake dependency fixes #3080

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

Merged

Conversation

briancroom
Copy link
Contributor

@briancroom briancroom commented Jun 20, 2016

What's in this pull request?

While SourceKit building on Linux, I encountered some unresolved reference linker errors that seem to stem from a different linker behavior with respect to the ordering of libraries on the command line invocation. I've made two changes here that resolve several of these issues:

  • Explicitly declare that SourceKitCore depends on SourceKitSwiftLang. This circular dependency exists in the source files but wasn't declared in the CMakeLists. Adding this here causes CMake to include the libraries multiple times in the invocation which lets the linker resolve the references.
  • [SR-1639][SourceKit] Link SwiftLang libraries to sourcekitd #2766 added some explicit clang dependencies to the sourcekitdAPI target to fix similar linker issues there. I discovered that those errors could instead be fixed by reordering some of the clang dependencies in SourceKitSwiftLang.

Related bug number: (SR-1676)


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

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

Platform Comment
All supported platforms @swift-ci Please smoke test
All supported platforms @swift-ci Please smoke test and merge
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
All supported platforms @swift-ci Please test and merge
OS X platform @swift-ci Please test OS X platform
OS X platform @swift-ci Please benchmark
Linux platform @swift-ci Please test Linux platform

Lint Testing

Language Comment
Python @swift-ci Please Python lint

Note: Only members of the Apple organization can trigger swift-ci.

@modocache @llvm-beanz @gribozavr

@briancroom
Copy link
Contributor Author

@swift-ci please test

@jrose-apple
Copy link
Contributor

Hm. Is there any way to avoid the circular dependency?

@akyrtzi, @nkcsgexi

@briancroom
Copy link
Contributor Author

I've poked around a little, and I think the dependency of SwiftLang on Core can likely be broken without too much hassle. I'll give it a go and see how it turns out.

@briancroom briancroom force-pushed the sourcekit-cmake-dependency-fixes branch from 2f59727 to ef8a98f Compare June 21, 2016 14:09
@briancroom briancroom force-pushed the sourcekit-cmake-dependency-fixes branch from ef8a98f to af0fd68 Compare June 23, 2016 01:00
@briancroom
Copy link
Contributor Author

With #3101 merged, I've rebased this and cut out the circular-dependency change. This now only includes the reordering of the Clang dependencies which resolves linker issues on Linux.

@briancroom
Copy link
Contributor Author

@swift-ci please test

@gribozavr gribozavr merged commit 8cc9875 into swiftlang:master Jun 23, 2016
@briancroom briancroom deleted the sourcekit-cmake-dependency-fixes branch June 23, 2016 07:59
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 this pull request may close these issues.

3 participants