aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google')
-rw-r--r--src/main/java/com/google/devtools/build/lib/sandbox/SandboxOptions.java10
-rw-r--r--src/main/java/com/google/devtools/build/lib/sandbox/SandboxStrategy.java6
2 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/sandbox/SandboxOptions.java b/src/main/java/com/google/devtools/build/lib/sandbox/SandboxOptions.java
index 437d1ae4a1..3c074aaf70 100644
--- a/src/main/java/com/google/devtools/build/lib/sandbox/SandboxOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/sandbox/SandboxOptions.java
@@ -133,6 +133,16 @@ public class SandboxOptions extends OptionsBase {
public List<String> sandboxTmpfsPath;
@Option(
+ name = "sandbox_writable_path",
+ allowMultiple = true,
+ defaultValue = "",
+ category = "config",
+ help = "For sandboxed actions, make an existing directory writable in the sandbox"
+ + " (if supported by the sandboxing implementation, ignored otherwise)."
+ )
+ public List<String> sandboxWritablePath;
+
+ @Option(
name = "sandbox_add_mount_pair",
allowMultiple = true,
converter = MountPairConverter.class,
diff --git a/src/main/java/com/google/devtools/build/lib/sandbox/SandboxStrategy.java b/src/main/java/com/google/devtools/build/lib/sandbox/SandboxStrategy.java
index c0ab7fd0fd..b80066bb56 100644
--- a/src/main/java/com/google/devtools/build/lib/sandbox/SandboxStrategy.java
+++ b/src/main/java/com/google/devtools/build/lib/sandbox/SandboxStrategy.java
@@ -201,6 +201,12 @@ abstract class SandboxStrategy implements SandboxedSpawnActionContext {
// needed directory if it doesn't exist yet.
writablePaths.add(sandboxExecRoot.getRelative(env.get("TEST_TMPDIR")));
}
+
+ FileSystem fileSystem = sandboxExecRoot.getFileSystem();
+ for (String writablePath : sandboxOptions.sandboxWritablePath) {
+ writablePaths.add(fileSystem.getPath(writablePath));
+ }
+
return writablePaths.build();
}