diff options
author | 2017-08-09 17:41:52 +0200 | |
---|---|---|
committer | 2017-08-10 13:47:39 +0200 | |
commit | 617e806d6ba18ffe0c040c481eb629325d0f5f8d (patch) | |
tree | a265beacf2a94820de437bbfd48a0d5468626e10 | |
parent | 214a7aed26a9c264784840f0154429a02552483a (diff) |
Fix --verbose_failures w/ sandboxing to print the full command line
Fixes #3521.
PiperOrigin-RevId: 164728178
-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); |