Skip to content

[BridgingHeader] Provide a deterministic unique pch file path #1567

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

Merged

Conversation

cachemeifyoucan
Copy link
Contributor

Teach swift driver to use a deterministic path for compiled PCH output. Also when dependency scanner is updated to return a module scanning or PCH hash from the scanning result, it will add that to the code path to have an unique PCH file path for the specific compilation.

@cachemeifyoucan cachemeifyoucan requested a review from artemcm March 19, 2024 22:42
@cachemeifyoucan
Copy link
Contributor Author

@artemcm let me know what you think about this. The dependency scanner is not yet returning the context hash for main module but that can be easily added.

@@ -1779,7 +1781,7 @@ extension Driver {
/// The swift-driver doesn't have actions, so the logic here takes the jobs and tries
/// to mimic the actions that would be created by the C++ driver and
/// prints them in *hopefully* the same order.
private func printActions(_ jobs: [Job]) {
private mutating func printActions(_ jobs: [Job]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using lazy var is mutating as I just learnt about it too.

@cachemeifyoucan cachemeifyoucan force-pushed the eng/PR-pch-path-computation branch from 8b7a7b0 to 14a8d8e Compare March 20, 2024 16:47
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please test

@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please test

@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please test windows platform

Teach swift driver to use a deterministic path for compiled PCH output.
Also when dependency scanner is updated to return a module scanning or
PCH hash from the scanning result, it will add that to the code path to
have an unique PCH file path for the specific compilation.
@cachemeifyoucan cachemeifyoucan force-pushed the eng/PR-pch-path-computation branch from c7f8a22 to bb3eed3 Compare March 20, 2024 22:07
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please test

@shahmishal
Copy link
Member

@swift-ci please test windows

@cachemeifyoucan cachemeifyoucan merged commit ca72a65 into swiftlang:main Mar 21, 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.

None yet

3 participants