Delete android/env.go .

Properly plumb the available environment to the configuration instead of
going through the global variable originalEnv.

Test: Presubmit.
Change-Id: Ia1ea753d5e72c02a0dcaa4c0b43bd6e24fc47cec
This commit is contained in:
Lukacs T. Berki
2021-04-12 14:04:24 +02:00
parent ed0f6e846f
commit 53b2f36bd6
4 changed files with 31 additions and 55 deletions

View File

@@ -345,7 +345,7 @@ func TestArchConfig(buildDir string, env map[string]string, bp string, fs map[st
// multiple runs in the same program execution is carried over (such as Bazel
// context or environment deps).
func ConfigForAdditionalRun(c Config) (Config, error) {
newConfig, err := NewConfig(c.srcDir, c.buildDir, c.moduleListFile)
newConfig, err := NewConfig(c.srcDir, c.buildDir, c.moduleListFile, c.env)
if err != nil {
return Config{}, err
}
@@ -356,12 +356,12 @@ func ConfigForAdditionalRun(c Config) (Config, error) {
// NewConfig creates a new Config object. The srcDir argument specifies the path
// to the root source directory. It also loads the config file, if found.
func NewConfig(srcDir, buildDir string, moduleListFile string) (Config, error) {
func NewConfig(srcDir, buildDir string, moduleListFile string, availableEnv map[string]string) (Config, error) {
// Make a config with default options.
config := &config{
ProductVariablesFileName: filepath.Join(buildDir, productVariablesFileName),
env: originalEnv,
env: availableEnv,
srcDir: srcDir,
buildDir: buildDir,