From 7a51a7c44df334f8e67a793788caf520b5127db4 Mon Sep 17 00:00:00 2001 From: jmmv Date: Fri, 23 Mar 2018 02:47:44 -0700 Subject: Remove unnecessary product name and constructors from sandboxed spawn runners. The product name was previously propagated to all sandboxed spawn runners unconditionally, even when the majority did not need it. Also, these same spawn runners had obsolete constructors that were not used at all or were only used in tests. Remove both for simplicity. RELNOTES: None. PiperOrigin-RevId: 190195305 --- .../devtools/build/lib/sandbox/SandboxActionContextProvider.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/sandbox/SandboxActionContextProvider.java') diff --git a/src/main/java/com/google/devtools/build/lib/sandbox/SandboxActionContextProvider.java b/src/main/java/com/google/devtools/build/lib/sandbox/SandboxActionContextProvider.java index 37b100cf6d..31da786227 100644 --- a/src/main/java/com/google/devtools/build/lib/sandbox/SandboxActionContextProvider.java +++ b/src/main/java/com/google/devtools/build/lib/sandbox/SandboxActionContextProvider.java @@ -59,7 +59,6 @@ final class SandboxActionContextProvider extends ActionContextProvider { if (timeoutKillDelaySeconds >= 0) { timeoutKillDelay = Optional.of(Duration.ofSeconds(timeoutKillDelaySeconds)); } - String productName = cmdEnv.getRuntime().getProductName(); // This works on most platforms, but isn't the best choice, so we put it first and let later // platform-specific sandboxing strategies become the default. @@ -68,7 +67,7 @@ final class SandboxActionContextProvider extends ActionContextProvider { withFallback( cmdEnv, new ProcessWrapperSandboxedSpawnRunner( - cmdEnv, sandboxBase, productName, timeoutKillDelay)); + cmdEnv, sandboxBase, cmdEnv.getRuntime().getProductName(), timeoutKillDelay)); contexts.add(new ProcessWrapperSandboxedStrategy(cmdEnv.getExecRoot(), spawnRunner)); } @@ -78,7 +77,7 @@ final class SandboxActionContextProvider extends ActionContextProvider { SpawnRunner spawnRunner = withFallback( cmdEnv, - LinuxSandboxedStrategy.create(cmdEnv, sandboxBase, productName, timeoutKillDelay)); + LinuxSandboxedStrategy.create(cmdEnv, sandboxBase, timeoutKillDelay)); contexts.add(new LinuxSandboxedStrategy(cmdEnv.getExecRoot(), spawnRunner)); } @@ -87,8 +86,7 @@ final class SandboxActionContextProvider extends ActionContextProvider { SpawnRunner spawnRunner = withFallback( cmdEnv, - new DarwinSandboxedSpawnRunner(cmdEnv, sandboxBase, productName, timeoutKillDelay, - process)); + new DarwinSandboxedSpawnRunner(cmdEnv, sandboxBase, timeoutKillDelay, process)); contexts.add(new DarwinSandboxedStrategy(cmdEnv.getExecRoot(), spawnRunner)); } -- cgit v1.2.3