-
Notifications
You must be signed in to change notification settings - Fork 204
[5.5][Explicit Module Builds] Cherry-pick explicit module build changes #781
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
[5.5][Explicit Module Builds] Cherry-pick explicit module build changes #781
Conversation
…lization/deserialization swiftlang/swift#37723 added API to libSwiftScan to save and restore the dependency scanner's state on the filesystem. This PR adds this API to the corresponding client code in the driver.
…file names This change ensures that explicit swift module dependencies are built into binary modules with filenames that encode their context hash (as reported by the dependency scanner). e.g. `A.swiftinterface` --> `A-<CONTEXT_HASH>.swiftmodule`. This is required because in some contexts builds of the same module for different contexts (e.g. target architectures) otherwise overlap and cause chaos. Resolves rdar://78820404
…anges. - Pass down SDK paths to explicit module tests - Remove "fake" stdlib files, making sure dependency scanning tests rely on the real ones - Gate a couple of tests on frontend flag availability
This was in-place as a temporary shim while SwiftPM adapted the `InterModuleDependencyOracle` API and a lighter-weight `ExternalTargetModulePathMap`.
…o the scanning action. I got overzealous when deleting code in swiftlang#749 and removed one piece of functionality that we still rely on. Although the external target map is no longer necessary when scanning dependencies using libSwiftScan, we still use it for resolution of `canImport` statements during the scan. We need to figure out a better way to deal with that in the scanner, but in the meantime this will restore functionality.
…dule details Specifically, whether an external target moduel is a framework. This is required to pass this information down to the compiler in order to generate correct auto-linking directives. Part of rdar://81177797
…building Clang explicit dependencies The dependency scanner specifies which exact modulemaps must be used, we do not need Clang to also search for modulemaps.
@swift-ci please test |
The test failures here are due to dependency on: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for the 5.5 branch, though we need to pick up the corresponding compiler changes first to get the tests pass.
libSwiftDriver clients need to be able to instantiate these objects.
To unblock updating CI Xcode which is currently failing in: https://ci.swift.org/job/swift-PR-macOS-new-xcode/117/console The proper test fix is included in swiftlang#781, which will re-enable this test.
@swift-ci please test |
1 similar comment
@swift-ci please test |
2ff3ab9
to
d61d9c3
Compare
@swift-ci please test |
This currently conflicts with where SwiftPM expected libSwiftScan to be located on Linux... |
…ame hash. Not doing so can lead to dangerous collisions if a build system uses a cetral cache across different targets that have a common dependency that is found in different places in the filesystem. For example, when building targets `A` and `B`, both of which depend on Clang module `C`, but have different search paths, finding `C` in two different locations, we should produce two distinct PCMs. With today's hashing scheme, the second will overwrite the first.
d61d9c3
to
5fa09d4
Compare
@swift-ci please test |
To unblock updating CI Xcode which is currently failing in: https://ci.swift.org/job/swift-PR-macOS-new-xcode/117/console The proper test fix is included in #781, which will re-enable this test. (cherry picked from commit 4997eb6)
#696: [Explicit Module Builds] Add libSwiftScan API for scanner cache serialization/deserialization
#705: [Explicit Module Builds] Use context hash in Swift dependency module file names
#739: [Explicit Module Builds] Unblock package bots by making tests more resilient to environment changes
#749: [Gardening] Delete deprecated API for tracking external target information
#763: [Dependency Scanning] Restore passing external target map as inputs to the scanning action
#779: [Explicit Module Builds] Add API to specify richer external target module details
#780: [Explicit Module Builds] Pass in -fno-implicit-module-maps for pre-building Clang explicit dependencies
#788: [Explicit Module Builds] Include source modulemap path into PCM filename hash.