Skip to content

Add support for swift caching with path remapping and builtin cache replay #1488

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

Conversation

cachemeifyoucan
Copy link
Contributor

Retry add swift caching support.

Teach swift-driver to remap path when needed. This involves:
* Infer SDK/toolchain related path that needs to remapped
* Send path remap related arguments to swift-frontend for depscanning
* Send reverse map to swift-frontend for diagnostics replay
* Constructing the compilation command for main module using remapped
  path
Teach swift-driver to replay cached compilation result using
libSwiftScan APIs directly. Jobs constructed from swift-driver is going
to have a new field for all the cache keys associated with the job. The
Executor can choose to query and replay using those cache keys if
possible, instead of executing the build command.

rdar://117947710
…ration

Re-unify caching availability check behind swift feature query and
adjust the default caching build configuration changes.
Remove extra `-Xcc` in the command-line.`
SwiftPM is built with `-disable-implicit-concurrency-module-import` to
avoid warnings about concurrency module on older SDKs. Explicitly
importing concurrency and only vend async APIs when concurrency is
available.
@cachemeifyoucan
Copy link
Contributor Author

Add a workaround for swift package manager if the option to disable implicit concurrency is still required.

@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@artemcm artemcm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing a cross-repo test from the swift repo can validate the previous failure, I think.

@artemcm
Copy link
Contributor

artemcm commented Nov 16, 2023

Doing a cross-repo test from the swift repo can validate the previous failure, I think.

And/Or from the swiftpm repo.

@cachemeifyoucan
Copy link
Contributor Author

Cross repo here: swiftlang/swift-package-manager#7125

@cachemeifyoucan
Copy link
Contributor Author

Cross repo testing passing now. Let's try again. Feel free to revert directly if anything else break.

@cachemeifyoucan cachemeifyoucan merged commit 0194450 into swiftlang:main Nov 28, 2023
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