Add BUILD_BROKEN_USES_NETWORK
Some people apparently still talk to the network during their build. Allow this temporarily with a BUILD_BROKEN_USES_NETWORK check. Bug: 129992021 Test: attempt to talk to the network during the build with and without this flag. Change-Id: Ifb967c656aa24c4599e7232d0f1b5a303b5bac52
This commit is contained in:
@@ -26,6 +26,8 @@ import (
|
||||
type Sandbox struct {
|
||||
Enabled bool
|
||||
DisableWhenUsingGoma bool
|
||||
|
||||
AllowBuildBrokenUsesNetwork bool
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -40,6 +42,8 @@ var (
|
||||
ninjaSandbox = Sandbox{
|
||||
Enabled: true,
|
||||
DisableWhenUsingGoma: true,
|
||||
|
||||
AllowBuildBrokenUsesNetwork: true,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -152,10 +156,17 @@ func (c *Cmd) wrapSandbox() {
|
||||
|
||||
// Only log important warnings / errors
|
||||
"-q",
|
||||
|
||||
// Stop parsing arguments
|
||||
"--",
|
||||
}
|
||||
|
||||
if c.Sandbox.AllowBuildBrokenUsesNetwork && c.config.BuildBrokenUsesNetwork() {
|
||||
c.ctx.Printf("AllowBuildBrokenUsesNetwork: %v", c.Sandbox.AllowBuildBrokenUsesNetwork)
|
||||
c.ctx.Printf("BuildBrokenUsesNetwork: %v", c.config.BuildBrokenUsesNetwork())
|
||||
sandboxArgs = append(sandboxArgs, "-N")
|
||||
}
|
||||
|
||||
// Stop nsjail from parsing arguments
|
||||
sandboxArgs = append(sandboxArgs, "--")
|
||||
|
||||
c.Args = append(sandboxArgs, c.Args[1:]...)
|
||||
c.Path = nsjailPath
|
||||
|
||||
|
Reference in New Issue
Block a user