Remote: Add --experimental_capture_corrupted_outputs flag.#13568
Closed
coeuvre wants to merge 3 commits intobazelbuild:masterfrom
Closed
Remote: Add --experimental_capture_corrupted_outputs flag.#13568coeuvre wants to merge 3 commits intobazelbuild:masterfrom
coeuvre wants to merge 3 commits intobazelbuild:masterfrom
Conversation
…set, Bazel will save outputs whose digest does not match the expected value to the target directories.
philwo
approved these changes
Jun 10, 2021
| try { | ||
| String outputPath = ((OutputDigestMismatchException) suppressed).getOutputPath(); | ||
| Path localPath = ((OutputDigestMismatchException) suppressed).getLocalPath(); | ||
| Path dst = captureCorruptedOutputsDir.getRelative(outputPath); |
Member
There was a problem hiding this comment.
Is it guaranteed (even with broken or malicious backends) that the output path will never contain .. references or start with a /? Should we check that the resulting path dst is still below the captureCorruptedOutputsDir just to make sure? 🤔
Member
Author
There was a problem hiding this comment.
We are safe here since outputPath is what we obtained from skyframe and send to remote execution backend (something like bazel-out/darwin-fastbuild/bin/...).
It is a path relative to the working directory (or input root depends on the flags) when the remote backend executing the action.
Member
Author
There was a problem hiding this comment.
However, I added the check in case the invariance changed in the future. Thanks for the catch!
coeuvre
added a commit
to coeuvre/bazel
that referenced
this pull request
Jul 15, 2021
Which when set, Bazel will save outputs whose digest does not match the expected value to the target directories. Also use OutputDigestMismatchException to indicate the error and include output path in the error message. The message for such an error will become e.g.: ``` com.google.devtools.build.lib.remote.common.OutputDigestMismatchException: Output bazel-out/darwin-fastbuild/bin/output.txt download failed: Expected digest '872af2fe77729717832d0a020ae87a93b8b944146a2af6b3490491e1eaf1dc74/29229' does not match received digest '872af2fe77729717832d0a020ae87a93b8b944146a2af6b3490491e1eaf1dc74/29229'. ``` Used to support bazelbuild/continuous-integration#1175. Closes bazelbuild#13568. PiperOrigin-RevId: 378624823
coeuvre
added a commit
to coeuvre/bazel
that referenced
this pull request
Jul 15, 2021
Which when set, Bazel will save outputs whose digest does not match the expected value to the target directories. Also use OutputDigestMismatchException to indicate the error and include output path in the error message. The message for such an error will become e.g.: ``` com.google.devtools.build.lib.remote.common.OutputDigestMismatchException: Output bazel-out/darwin-fastbuild/bin/output.txt download failed: Expected digest '872af2fe77729717832d0a020ae87a93b8b944146a2af6b3490491e1eaf1dc74/29229' does not match received digest '872af2fe77729717832d0a020ae87a93b8b944146a2af6b3490491e1eaf1dc74/29229'. ``` Used to support bazelbuild/continuous-integration#1175. Closes bazelbuild#13568. PiperOrigin-RevId: 378624823
coeuvre
added a commit
to coeuvre/bazel
that referenced
this pull request
Jul 15, 2021
Which when set, Bazel will save outputs whose digest does not match the expected value to the target directories. Also use OutputDigestMismatchException to indicate the error and include output path in the error message. The message for such an error will become e.g.: ``` com.google.devtools.build.lib.remote.common.OutputDigestMismatchException: Output bazel-out/darwin-fastbuild/bin/output.txt download failed: Expected digest '872af2fe77729717832d0a020ae87a93b8b944146a2af6b3490491e1eaf1dc74/29229' does not match received digest '872af2fe77729717832d0a020ae87a93b8b944146a2af6b3490491e1eaf1dc74/29229'. ``` Used to support bazelbuild/continuous-integration#1175. Closes bazelbuild#13568. PiperOrigin-RevId: 378624823
coeuvre
added a commit
to coeuvre/bazel
that referenced
this pull request
Jul 15, 2021
Which when set, Bazel will save outputs whose digest does not match the expected value to the target directories. Also use OutputDigestMismatchException to indicate the error and include output path in the error message. The message for such an error will become e.g.: ``` com.google.devtools.build.lib.remote.common.OutputDigestMismatchException: Output bazel-out/darwin-fastbuild/bin/output.txt download failed: Expected digest '872af2fe77729717832d0a020ae87a93b8b944146a2af6b3490491e1eaf1dc74/29229' does not match received digest '872af2fe77729717832d0a020ae87a93b8b944146a2af6b3490491e1eaf1dc74/29229'. ``` Used to support bazelbuild/continuous-integration#1175. Closes bazelbuild#13568. PiperOrigin-RevId: 378624823
coeuvre
added a commit
to coeuvre/bazel
that referenced
this pull request
Jul 16, 2021
Which when set, Bazel will save outputs whose digest does not match the expected value to the target directories. Also use OutputDigestMismatchException to indicate the error and include output path in the error message. The message for such an error will become e.g.: ``` com.google.devtools.build.lib.remote.common.OutputDigestMismatchException: Output bazel-out/darwin-fastbuild/bin/output.txt download failed: Expected digest '872af2fe77729717832d0a020ae87a93b8b944146a2af6b3490491e1eaf1dc74/29229' does not match received digest '872af2fe77729717832d0a020ae87a93b8b944146a2af6b3490491e1eaf1dc74/29229'. ``` Used to support bazelbuild/continuous-integration#1175. Closes bazelbuild#13568. PiperOrigin-RevId: 378624823
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which when set, Bazel will save outputs whose digest does not match the expected value to the target directories.
Also use OutputDigestMismatchException to indicate the error and include output path in the error message. The message for such an error will become e.g.:
Used to support bazelbuild/continuous-integration#1175.