Skip to content

[SR-1613][SourceKit] Include libdispatch #2704

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

Conversation

modocache
Copy link
Contributor

What's in this pull request?

Several parts of SourceKit make use of libdispatch. Include its headers in order to allow those parts to build.

Of course, SourceKit isn't actually built on Linux yet. You may attempt to build it by applying this patch.

Resolved Related bug number: (SR-710)


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.

@@ -496,6 +496,7 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
endif()

include_directories(BEFORE
${SWIFT_SOURCE_DIR}/../swift-corelibs-libdispatch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not be doing this on Darwin.

Several parts of SourceKit make use of libdispatch. Include its
headers in order to allow those parts to build.
@modocache modocache force-pushed the sr-710-sourcekit-linux-libdispatch branch from 028d7db to f01ee69 Compare May 25, 2016 21:00
@modocache
Copy link
Contributor Author

@gribozavr Thanks! I addressed your comment by only including libdispatch on Linux.

@swift-ci please test

@modocache
Copy link
Contributor Author

@gribozavr @akyrtzi What do you think of this one? Like #2703, this fixes one of the initial compilation errors when building SourceKit on Linux. Any objections to me merging it?

@@ -500,5 +500,10 @@ include_directories(BEFORE
${SOURCEKIT_SOURCE_DIR}/include
)

if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pardon my CMake ignorance, but is there a way to phrase this such that it specifies non-Darwin instead? I presume that future Unix-y target platforms will also be in need of these headers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely. I'm worried about SR-710 getting done in time for Swift 3.0, so I'm reducing scope a bit here. Ideally, I'd like SourceKit to run everywhere. Were it able to do so, we'd probably want to change this to handle more than just Linux.

@briancroom
Copy link
Contributor

Even with the headers resolved, aren't we going to fail to link because libdispatch won't have been built yet when SourceKit is being built? (At least in the bootstrapping case. Maybe it would be reasonable to skip SourceKit on the initial pass, and then circle back to build it once swift-corelibs-libdispatch has been built?)

@briancroom
Copy link
Contributor

Corelibs libdispatch does include a Swift overlay which is currently enabled in the build script.

@rintaro
Copy link
Member

rintaro commented May 27, 2016

@briancroom Sorry, I deleted my comment before noticing your reply.

Yeah, to build libdispatch first, we have to configure it without --with-swift-toolchain and build.
And then, reconfigure with --with-swift-toolchain and build...

@modocache
Copy link
Contributor Author

modocache commented May 27, 2016

All good points! Yeah, this pull request won't get SourceKit building properly -- I just sent it out to resolve the headers.

Traditionally, I've noticed the core team is not thrilled with the idea of requiring multiple invocations of the build script... we should create a separate task on JIRA to discuss potential approaches here.

@briancroom
Copy link
Contributor

I have opened #2862 which I believe supersedes this PR.

@modocache
Copy link
Contributor Author

Sounds good, @briancroom! I'll close this in favor of your pull request. What about #2769? Is that also taken care of in #2862?

@modocache modocache closed this Jun 3, 2016
@briancroom
Copy link
Contributor

No, the changes in #2769 are addressing a different set of linker failures.

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.

4 participants