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

[6.0][Caching] Handle emit module job correctly for swift caching #1603

Conversation

cachemeifyoucan
Copy link
Contributor

Explanation: Fix cache key mis-match between swift-frontend and swift-driver that can cause caching inconsistency when only emit module job is scheduled by swift-driver.
Scope: Fixes issue that build system can wrongly think cache miss when it is actually cache hit, or misidentify certain job as not cacheable and always run the compilation.
Issue: rdar://127768967
Original PR: #1602
Testing: unit test
Reviewer: @artemcm @xymus

There are two situations when emiting modules are not correctly handled
when swift caching is enabled:
* When only `-emit-module` task is requested from driver, in this case,
  we are contructing a `CompileJob` but only generating module output.
  SwiftDriver still expects all swift inputs will have a cache key even
  only the first file is generating outputs and has a cache key.
* When using `-experimental-emit-module-separately`, then swift-driver
  needs to construct a `EmitModuleJob`, which wasn't taught the concept of
  caching and not producing any cache key.

rdar://127768967
(cherry picked from commit b5c3534)
@cachemeifyoucan cachemeifyoucan requested a review from a team May 10, 2024 22:44
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please test

@cachemeifyoucan cachemeifyoucan merged commit bc9e638 into swiftlang:release/6.0 May 13, 2024
3 checks passed
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.

2 participants