Skip to content
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

Merged
merged 5 commits into from
Oct 8, 2021

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Sep 10, 2021

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.

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.
@xymus xymus requested a review from a team as a code owner September 10, 2021 20:12
@xymus
Copy link
Contributor Author

xymus commented Sep 10, 2021

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 40dc406

@xymus
Copy link
Contributor Author

xymus commented Sep 21, 2021

@swift-ci Please test macOS

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 40dc406

@xymus
Copy link
Contributor Author

xymus commented Sep 22, 2021

swiftlang/swift-driver#849
@swift-ci Please test macOS

@xymus
Copy link
Contributor Author

xymus commented Sep 23, 2021

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()
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@xymus
Copy link
Contributor Author

xymus commented Oct 6, 2021

@swift-ci Please nominate

@xymus
Copy link
Contributor Author

xymus commented Oct 6, 2021

Re-testing as the last run is dated.

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Oct 7, 2021

Build failed
Swift Test Linux Platform
Git Sha - 40dc406

@xymus
Copy link
Contributor Author

xymus commented Oct 7, 2021

error: error opening input file 'lib/libYamsTests.a' (The file was not recognized as a valid object file)

@swift-ci Please test Linux

@xymus xymus merged commit c177a16 into swiftlang:release/5.5 Oct 8, 2021
@xymus xymus deleted the emit-module-separately-5.5 branch October 8, 2021 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants