[swiftpm] For development, build a local copy of PackageDescription #405
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.
When developing sourcekit-lsp, it is useful to be able to use a released
version of the swift toolchain. However, because we are using the latest
branch version of libSwiftPM, it may be that the PackageDescription
module packaged with the toolchain is incompatible with that libSwiftPM.
To prevent that problem, we now build our own copy of PackageDescription
and using that instead of the toolchain's. That change is made by
default to allow plain
swift build
andswift test
invocations towork without modification. When building as part of the swift toolchain,
we continue to use the toolchain's copy of PackageDescription, because
we know that it is built from the same sources as we are using for
libSwiftPM.
One situation that is not explicitly covered by the above is if
sourcekit-lsp is installed somewhere outside of a swift toolchain. In
that case by default it will try to find a local package description
module next to the sourcekit-lsp binary, but assuming that fails it will
fallback to searching the default toolcahin that it discovers at
runtime, as it does today. If this usecase turns out to be important we
can provide additional ways to control how to find the
PackageDescription module.
rdar://78548287