-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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][Driver] Support for emit-module-separately #39249
Conversation
Enable emitting the module-level incremental fine-grained compilation information from the emit-module job for incremental compilation to work with emit-module-separately.
The differentiation and actor logics insert SynthesizedFileUnit in SourceFile modules. Accepting these file units in populateMemberCache allow to cache all the top-level decls of source file modules.
As support, accept but ignore the -no-emit-module-separately flag in the C++ driver.
@swift-ci Please test |
Build failed |
@swift-ci Please test macOS |
Build failed |
swiftlang/swift-driver#849 |
The driver side PR was merged, all tests should be green now. @swift-ci Please test |
const bool isEmitModuleSeparately = | ||
Action == FrontendOptions::ActionType::EmitModuleOnly && | ||
MSF.is<ModuleDecl *>() && | ||
Instance.getInvocation() |
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.
Curious why this depends on the state of function body skipping.
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 flag controlling NonInlinableWithoutTypes
is used here as an heuristic to distinguish incremental EmitModuleOnly
jobs from the classic non-incremental ones. I'd rather have a flag specifically about incremental builds but IIUC that flag was intentionally removed.
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.
@CodaFi would you prefer if the compiler emitted incremental information for all emit-module jobs? Outside of emit-module-separately, these are mostly used in testing and to build core library as far as I know.
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.
I think it certainly wouldn't hurt. The cost of embedding Swiftdeps is negligible.
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.
A quick cleanup of these check triggered some incremental test failures. I think there's another scenario that needs to be accounted for or just some tests to be updated to expect more dependency information. Let's merge this in 5.5 and fix these on main.
@swift-ci Please nominate |
Re-testing as the last run is dated. @swift-ci Please test |
Build failed |
@swift-ci Please test Linux |
The new incremental build mode in the Swift driver, emit-module-separately, offers a more reliable alternative to merge-module. However, it needs some compiler-side improvements and fixes to work reliably with the existing incremental building logic.