Skip to content

Commit

Permalink
Improve the --sandbox_debug error message (#15437)
Browse files Browse the repository at this point in the history
This makes it more clear that this flag has another benefit besides
verbose logging, similar to the help message for it.

Closes #15273.

PiperOrigin-RevId: 443307103

Co-authored-by: Keith Smiley <keithbsmiley@gmail.com>
  • Loading branch information
2 people authored and meteorcloudy committed May 10, 2022
1 parent bc42b65 commit eed462a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ abstract class AbstractSandboxSpawnRunner implements SpawnRunner {
private static final int LOCAL_EXEC_ERROR = -1;

private static final String SANDBOX_DEBUG_SUGGESTION =
"\n\nUse --sandbox_debug to see verbose messages from the sandbox";
"\n\nUse --sandbox_debug to see verbose messages from the sandbox "
+ "and retain the sandbox build root for debugging";

private final SandboxOptions sandboxOptions;
private final boolean verboseFailures;
Expand Down
4 changes: 2 additions & 2 deletions src/test/shell/bazel/bazel_sandboxing_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -727,13 +727,13 @@ genrule(
EOF
bazel build --verbose_failures :broken &> $TEST_log \
&& fail "build should have failed" || true
expect_log "Use --sandbox_debug to see verbose messages from the sandbox"
expect_log "Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging"
expect_log "Executing genrule //:broken failed"

bazel build --verbose_failures --sandbox_debug :broken &> $TEST_log \
&& fail "build should have failed" || true
expect_log "Executing genrule //:broken failed"
expect_not_log "Use --sandbox_debug to see verbose messages from the sandbox"
expect_not_log "Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging"
# This will appear a lot in the sandbox failure details.
expect_log "/sandbox/" # Part of the path to the sandbox location.
}
Expand Down

0 comments on commit eed462a

Please sign in to comment.