Always propagate some environment variables to RBE
Always propagate LANG, LC_MESSAGES and PYTHONDONTWRITEBYTECODE to RBE to get more consistent behavior between local actions and RBE. Bug: 182415460 Bug: 190593001 Test: treehugger Change-Id: I726e6f02fd3ef77e158baf6fde77ffb7247a1375
This commit is contained in:
@@ -50,8 +50,14 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
defaultLabels = map[string]string{"type": "tool"}
|
||||
defaultExecStrategy = LocalExecStrategy
|
||||
defaultLabels = map[string]string{"type": "tool"}
|
||||
defaultExecStrategy = LocalExecStrategy
|
||||
defaultEnvironmentVariables = []string{
|
||||
// This is a subset of the allowlist in ui/build/ninja.go that makes sense remotely.
|
||||
"LANG",
|
||||
"LC_MESSAGES",
|
||||
"PYTHONDONTWRITEBYTECODE",
|
||||
}
|
||||
)
|
||||
|
||||
// REParams holds information pertinent to the remote execution of a rule.
|
||||
@@ -149,8 +155,10 @@ func (r *REParams) wrapperArgs() string {
|
||||
args += " --toolchain_inputs=" + strings.Join(r.ToolchainInputs, ",")
|
||||
}
|
||||
|
||||
if len(r.EnvironmentVariables) > 0 {
|
||||
args += " --env_var_allowlist=" + strings.Join(r.EnvironmentVariables, ",")
|
||||
envVarAllowlist := append(r.EnvironmentVariables, defaultEnvironmentVariables...)
|
||||
|
||||
if len(envVarAllowlist) > 0 {
|
||||
args += " --env_var_allowlist=" + strings.Join(envVarAllowlist, ",")
|
||||
}
|
||||
|
||||
return args + " -- "
|
||||
|
Reference in New Issue
Block a user