Skip to content

Commit 19740b5

Browse files
keithcopybara-github
authored andcommitted
Improve the --sandbox_debug error message
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
1 parent 4ea7d69 commit 19740b5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/java/com/google/devtools/build/lib/sandbox/AbstractSandboxSpawnRunner.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ abstract class AbstractSandboxSpawnRunner implements SpawnRunner {
6262
private static final int LOCAL_EXEC_ERROR = -1;
6363

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

6768
private final SandboxOptions sandboxOptions;
6869
private final boolean verboseFailures;

src/test/shell/bazel/bazel_sandboxing_test.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -727,13 +727,13 @@ genrule(
727727
EOF
728728
bazel build --verbose_failures :broken &> $TEST_log \
729729
&& fail "build should have failed" || true
730-
expect_log "Use --sandbox_debug to see verbose messages from the sandbox"
730+
expect_log "Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging"
731731
expect_log "Executing genrule //:broken failed"
732732

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

0 commit comments

Comments
 (0)