-
Notifications
You must be signed in to change notification settings - Fork 92
[Preview] Fix preview support for swift caching build #562
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
base: main
Are you sure you want to change the base?
Conversation
This uses the flag introduced here: swiftlang/swift#81990 |
@swift-ci please test |
Add support for swift caching build when swift compiler supports the new option that allows swift compiler performs an uncached build but loading module dependencies from CAS. It also does few adjustment to make sure preview build shares the same dependencies with regular build as caching build has a stricter rule for invalidation: * The VFS overlay used by preview is applied after swift driver invocation and onto the frontend invocation directly. This makes sure the VFS overlay doesn't invalidate all the module dependencies. * BridgingHeader PCH was disabled as a workaround when swift driver doesn't produce deterministic output path when planning for PCH jobs. Properly fix this issue by requesting the same path when planning both build and don't use this workaround in certain configurations. This should allow preview to build thunk correctly when swift caching is enabled for the regular build. rdar://152107465
50c1cf9
to
039a81c
Compare
Re-request review after properly fixed the bridging header PCH path mismatch. @swift-ci please test |
@@ -3397,10 +3401,12 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi | |||
removeWithParameter(arg) | |||
} | |||
|
|||
// We need to ignore precompiled headers due to: | |||
// For some old version of swift driver, the output path for bridging header pch is not stable, |
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.
Do we have any compatibility requirement for older swift-driver? If we only need to support recent swift-driver, this workaround can be removed to make preview build faster
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.
Generally speaking I try not to immediately break compatibility with old drivers to minimize revlock when building the package for local development. But supporting a driver that's more than a few weeks old is a non-goal.
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.
The change in swift-driver I am talking about is: swiftlang/swift-driver#1832
It has been few months but not in official release yet.
@swift-ci please test |
The latest changes seem reasonable to me |
Add support for swift caching build when swift compiler supports the new option that allows swift compiler performs an uncached build but loading module dependencies from CAS.
It also does few adjustment to make sure preview build shares the same dependencies with regular build as caching build has a stricter rule for invalidation:
This should allow preview to build thunk correctly when swift caching is enabled for the regular build.
rdar://152107465