> 1) Patch the code so that the sandbox mounts /var/run - just add it to the "mountUsualUnixDirs" method in LinuxSandboxedStrategy.java.
I tried this option:
diff --git a/src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedStrategy.java b/src/main/java/com/google/devtools/build/lib/sandbox/LinuxSa
index f4ccbdd..b19fec2 100644
--- a/src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedStrategy.java
+++ b/src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedStrategy.java
@@ -315,6 +315,7 @@ public class LinuxSandboxedStrategy implements SpawnActionContext {
FileSystem fs = blazeDirs.getFileSystem();
mounts.put(fs.getPath("/bin"), fs.getPath("/bin"));
mounts.put(fs.getPath("/etc"), fs.getPath("/etc"));
+ mounts.put(fs.getPath("/var/run"), fs.getPath("/var/run"));
for (String entry : FilesystemUtils.readdir("/")) {
if (entry.startsWith("lib")) {
Path libDir = fs.getRootDirectory().getRelative(entry);
It works!
I use this to test docker instances generated by the docker_build skylark rule. Is there a better way to run tests on docker instances I'm not aware of?
Thanks,
Koen