-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[5.1][ParseableInterface] Make the module caches relocatable and respect -track-system-dependencies #23756
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
swift-ci
merged 7 commits into
swiftlang:swift-5.1-branch
from
nathawes:it-all-dependends-take-2-5.1
Apr 3, 2019
Merged
[5.1][ParseableInterface] Make the module caches relocatable and respect -track-system-dependencies #23756
swift-ci
merged 7 commits into
swiftlang:swift-5.1-branch
from
nathawes:it-all-dependends-take-2-5.1
Apr 3, 2019
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
@swift-ci please test |
4cee9b2
to
1be33a1
Compare
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test Linux |
One interesting thing here is that the decision of whether or not to track system dependencies ends up going into the cache key for a swiftmodule built from a parseable interface, because it affects that module's up-to-date check. If we didn't include -track-system-dependencies in the cache key, we could end up tracking system dependencies for some modules but not others in the same build. There's a bit of a bug here where they're /not/ honored if the top-level invocation isn't tracking /any/ dependencies, but given how uncommon this flag is in practice that's probably okay for now. Still TODO: honor this for -build-swiftmodule-from-parseable-interface as well. That's currently not tracking dependencies at all and it probably should.
…odule-from-parseable-interface Updates the subinvocation that builds the parseable interface to respect the -track-system-dependencies flag of the top-level invocation if present, by including system dependencies in the produced .swiftmodule.
This allows the SDK to be relocated without automatically resulting in a rebuild. Based on an old patch from Jordan Rose.
…module cache or prebuilt module cache *Their* dependencies are already being serialized out, so this shouldn't affect up-to-date-checking except by alowing the regular and prebuilt module caches to be relocated without invalidating their contents. In the case of the prebuilt module cache, this gets us closer to supporting relocation across machines.
…citly check serialized dependencies Also use the existing check-is-forwarding-module.py script to check for forwarding modules, rather than doing it manually.
… adding cached modules to the dependency tracker This patch modifies ParseableInterfaceBuilder::CollectDepsForSerialization to avoid serializing dependencies from the runtime resource path into the swiftmodules generated from .swiftinterface files. This means the module cache should now be relocatable across machines. It also modifies ParseableInterfaceModuleLoader to never add any dependencies from the module cache and prebuilt cache to the dependency tracker (in addition to the existing behaviour of not serializing them in the generated swiftmodules). As a result, CollectDepsForSerialization no longer checks if the dependencies it is given come from the cache as they are provided by the dependency tracker. It now asserts that's the case instead.
…ent dependency tracker We previously added dependencies to the tracker inline while validating a cached module's dependencies were up to date. If one of its dependencies ended up being out of date though, we shouldn't have added the previous dependencies, as that means the dependency list itself was also out of date. This patch changes the behavior to only add the module's dependencies once we've verified they're all up to date.
1be33a1
to
d83950d
Compare
@swift-ci please test and merge |
@swift-ci test and merge |
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.
Cherry-pick of #23665 for 5.1
Resolves rdar://problem/49292914