Revert "Revert "Ensure environment dependencies are correct""
This reverts commit 4068a5db6c
.
Now the Mac xcode-select and xcrun goes through Config.HostSystemTool,
which will grab $PATH through Config.Getenv
Test: m -j (on mac)
Change-Id: I2632c4fdb2ec961e59944cf02ff165e0fd3c869d
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
package android
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"android/soong/env"
|
||||
|
||||
"github.com/google/blueprint"
|
||||
@@ -27,6 +30,19 @@ import (
|
||||
// compare the contents of the environment variables, rewriting the file if necessary to cause
|
||||
// a manifest regeneration.
|
||||
|
||||
var originalEnv map[string]string
|
||||
|
||||
func init() {
|
||||
originalEnv = make(map[string]string)
|
||||
for _, env := range os.Environ() {
|
||||
idx := strings.IndexRune(env, '=')
|
||||
if idx != -1 {
|
||||
originalEnv[env[:idx]] = env[idx+1:]
|
||||
}
|
||||
}
|
||||
os.Clearenv()
|
||||
}
|
||||
|
||||
func EnvSingleton() blueprint.Singleton {
|
||||
return &envSingleton{}
|
||||
}
|
||||
|
Reference in New Issue
Block a user