sandbox_linux: set CCACHE_DIR as a writable path
Fixes "Read-only file system" error when using ccache. NOTE: This is only required when both ccache exec and dir are on the same partition. Change-Id: I99afe644c8ee0e0b881c1643fef0cb31b83bcd17
This commit is contained in:
parent
243b54c46e
commit
d44bc5b281
1 changed files with 7 additions and 0 deletions
|
@ -228,6 +228,13 @@ func (c *Cmd) wrapSandbox() {
|
||||||
sandboxArgs = append(sandboxArgs, "-N")
|
sandboxArgs = append(sandboxArgs, "-N")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ccacheExec := os.Getenv("CCACHE_EXEC"); ccacheExec != "" {
|
||||||
|
bytes, err := exec.Command(ccacheExec, "-k", "cache_dir").Output()
|
||||||
|
if err == nil {
|
||||||
|
sandboxArgs = append(sandboxArgs, "-B", strings.TrimSpace(string(bytes)))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Stop nsjail from parsing arguments
|
// Stop nsjail from parsing arguments
|
||||||
sandboxArgs = append(sandboxArgs, "--")
|
sandboxArgs = append(sandboxArgs, "--")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue