diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/sandbox/AbstractSandboxSpawnRunner.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/sandbox/AbstractSandboxSpawnRunner.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/sandbox/AbstractSandboxSpawnRunner.java b/src/main/java/com/google/devtools/build/lib/sandbox/AbstractSandboxSpawnRunner.java index 5e2c42d7f3..7fb7274e30 100644 --- a/src/main/java/com/google/devtools/build/lib/sandbox/AbstractSandboxSpawnRunner.java +++ b/src/main/java/com/google/devtools/build/lib/sandbox/AbstractSandboxSpawnRunner.java @@ -23,6 +23,7 @@ import com.google.devtools.build.lib.actions.ResourceManager; import com.google.devtools.build.lib.actions.ResourceManager.ResourceHandle; import com.google.devtools.build.lib.actions.Spawn; import com.google.devtools.build.lib.actions.UserExecException; +import com.google.devtools.build.lib.exec.ExecutionOptions; import com.google.devtools.build.lib.exec.SpawnExecException; import com.google.devtools.build.lib.exec.SpawnResult; import com.google.devtools.build.lib.exec.SpawnResult.Status; @@ -51,11 +52,13 @@ abstract class AbstractSandboxSpawnRunner implements SpawnRunner { private final Path sandboxBase; private final SandboxOptions sandboxOptions; + private final boolean verboseFailures; private final ImmutableSet<Path> inaccessiblePaths; public AbstractSandboxSpawnRunner(CommandEnvironment cmdEnv, Path sandboxBase) { this.sandboxBase = sandboxBase; this.sandboxOptions = cmdEnv.getOptions().getOptions(SandboxOptions.class); + this.verboseFailures = cmdEnv.getOptions().getOptions(ExecutionOptions.class).verboseFailures; this.inaccessiblePaths = sandboxOptions.getInaccessiblePaths(cmdEnv.getDirectories().getFileSystem()); } @@ -103,12 +106,14 @@ abstract class AbstractSandboxSpawnRunner implements SpawnRunner { if (sandboxOptions.sandboxDebug) { message = CommandFailureUtils.describeCommandFailure( - true, sandbox.getArguments(), sandbox.getEnvironment(), null); + true, sandbox.getArguments(), sandbox.getEnvironment(), execRoot.getPathString()); } else { message = CommandFailureUtils.describeCommandFailure( - false, originalSpawn.getArguments(), originalSpawn.getEnvironment(), null) - + SANDBOX_DEBUG_SUGGESTION; + verboseFailures, + originalSpawn.getArguments(), + originalSpawn.getEnvironment(), + execRoot.getPathString()) + SANDBOX_DEBUG_SUGGESTION; } throw new SpawnExecException( message, result, /*forciblyRunRemotely=*/false, /*catastrophe=*/false); |