-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[sourcekit] Make it possible to install both sourcekitdInProc and sourcekitd efficiently #34672
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
benlangmuir
merged 5 commits into
swiftlang:main
from
benlangmuir:sourcekit-inproc-and-xpc-together
Nov 11, 2020
Merged
[sourcekit] Make it possible to install both sourcekitdInProc and sourcekitd efficiently #34672
benlangmuir
merged 5 commits into
swiftlang:main
from
benlangmuir:sourcekit-inproc-and-xpc-together
Nov 11, 2020
+498
−174
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This refactors notification handling so that the XPC service and InProc library pass in their notification handler callback. This fixes a layering issue where the sourcekitd libraries could not be linked dynamically due to the missing symbols.
This fixes a layering violation where UID handling was provided by a dependent library, creating a dependency cycle if you tried to link the lower level libraries dynamically.
Makes it possible to build and install both sourcekitdInProc and the XPC service on Darwin.
…e when possible When installing both InProc and XPC versions of sourcekitd, dynamically link the XPC service to the InProc version. This lets us install both frameworks without wasting the disk space from having another copy of the swift frontend statically linked.
benlangmuir
commented
Nov 10, 2020
tools/SourceKit/tools/sourcekitd/bin/InProc/sourcekitdInProc.exports
Outdated
Show resolved
Hide resolved
@swift-ci please test |
Build failed |
@swift-ci please test Linux |
We only need the C++ symbols on Darwin, so avoid the issue of different manglings.
@swift-ci please test |
Build failed |
@swift-ci please clean test Linux |
akyrtzi
approved these changes
Nov 11, 2020
@swift-ci please test |
4eeb381
to
16dd929
Compare
@swift-ci please test |
Build failed |
Build failed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes it possible to install both sourcekitd.framework and sourcekitdInProc.framework on Darwin (previously it was mutually exclusive). In order to make this configuration practical, when both are being installed, we share the implementation by having the XPC service dynamically link to the InProc framework. When only the XPC service is being installed, it continues to statically link as before. In order to enable dynamic linking, I fixed some library layering violations around notification handling and UID handling so that the "sourcekitdAPI" library does not implicitly depend on the framework that is supposed to contain it. Also fixed the runtime library path when installing sourcekitdInProc.framework, which seems to have bit-rotted.
Note: this PR does not change the default installation components, so it shouldn't change behaviour unless you manually add both "sourcekit-inproc" and "sourcekit-xpc-service" to your install components. My intention is to propose installing sourcekitInProc by default as a follow-up.