-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Remote: Add --experimental_capture_corrupted_outputs flag. #13568
Conversation
…set, Bazel will save outputs whose digest does not match the expected value to the target directories.
try { | ||
String outputPath = ((OutputDigestMismatchException) suppressed).getOutputPath(); | ||
Path localPath = ((OutputDigestMismatchException) suppressed).getLocalPath(); | ||
Path dst = captureCorruptedOutputsDir.getRelative(outputPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, I added the check in case the invariance changed in the future. Thanks for the catch!
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
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
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
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
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
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.