Skip to content

[cas] Add ValidateCAS action to ensure data coherence #460

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

benlangmuir
Copy link
Contributor

Use llvm-cas's new validate-if-needed action to ensure the correctness of CAS data in the case of power failure or similar situations. This action is added to prepareForBuilding to ensure that it is run before any other other CAS accesses. Note that validate-if-needed internally avoids performing unnecessary work - in particular, it only validates data once for every machine boot.

rdar://150295950

Use llvm-cas's new validate-if-needed action to ensure the correctness
of CAS data in the case of power failure or similar situations. This
action is added to prepareForBuilding to ensure that it is run before
any other other CAS accesses. Note that validate-if-needed internally
avoids performing unnecessary work - in particular, it only validates
data once for every machine boot.

rdar://150295950
@benlangmuir
Copy link
Contributor Author

@swift-ci please test

While we intentionally wanto to ignore minor differences in CASOptions
for validation, the llvm-cas executable path is significant because
there could be differences in format version between tools. If the
llvm-cas binaries end up using the same format version only one of them
will perform the real validation and the rest will skip.
@benlangmuir benlangmuir requested a review from aciidgh as a code owner April 29, 2025 23:24
@benlangmuir
Copy link
Contributor Author

@swift-ci please test

@benlangmuir benlangmuir merged commit 5ff4af5 into swiftlang:main May 1, 2025
22 checks passed
@benlangmuir benlangmuir deleted the eng/blangmuir/validate-if-needed-swift-build-150295950 branch May 1, 2025 17:14
ldaley pushed a commit to ldaley/swift-build that referenced this pull request May 13, 2025
Use llvm-cas's new validate-if-needed action to ensure the correctness
of CAS data in the case of power failure or similar situations. This
action is added to prepareForBuilding to ensure that it is run before
any other other CAS accesses. Note that validate-if-needed internally
avoids performing unnecessary work - in particular, it only validates
data once for every machine boot.

rdar://150295950
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