aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2018-01-23 22:15:15 -0800
committerDan Willemsen <dwillemsen@google.com>2018-01-23 22:56:17 -0800
commite7945d76ac0df046667bfc399b5666bd777264ea (patch)
treec63688502e31fe511969d7934e6371b47041056a /ui
parent312ccb974f953bc80867b4e32ddcd13ac9f9904d (diff)
downloadbuild_soong-e7945d76ac0df046667bfc399b5666bd777264ea.tar.gz
build_soong-e7945d76ac0df046667bfc399b5666bd777264ea.tar.bz2
build_soong-e7945d76ac0df046667bfc399b5666bd777264ea.zip
Make GOROOT consistent
We were previously setting GOROOT to "prebuilts/go/linux-x86" during the ninja executions when we were running Soong. But we can also run Soong during the main ninja execution, were GOROOT was unset. When the GOROOT was unset, the default GOROOT in our Go installation is "./prebuilts/go/linux-x86" (note the extra ./). This would cause g.bootstrap.goRoot to change between some soong runs, causing us to rebuild all go programs (and anything depending on them) more often than necessary. So instead, keep GOROOT undefined when running Soong. Everything that matters is using runtime.GOROOT(), which will fall back to the default. Continue setting $GOROOT for bootstrap.bash, otherwise it fails when there is no system provided go binary. What we give bootstrap.bash doesn't really matter, since we don't actually use the blueprint wrapper in Android. Test: m blueprint_tools; touch bionic/libc/tzcode/new.c; m blueprint_tools <doesn't rebuild everything> Change-Id: I82f30c7c3b5d25e5cbf28fe37a97fdb776c4a164
Diffstat (limited to 'ui')
-rw-r--r--ui/build/soong.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/ui/build/soong.go b/ui/build/soong.go
index 6dafd273..cbb75c76 100644
--- a/ui/build/soong.go
+++ b/ui/build/soong.go
@@ -35,7 +35,7 @@ func runSoong(ctx Context, config Config) {
cmd.Environment.Set("BLUEPRINTDIR", "./build/blueprint")
cmd.Environment.Set("BOOTSTRAP", "./build/blueprint/bootstrap.bash")
cmd.Environment.Set("BUILDDIR", config.SoongOutDir())
- cmd.Environment.Set("GOROOT", filepath.Join("./prebuilts/go", config.HostPrebuiltTag()))
+ cmd.Environment.Set("GOROOT", "./"+filepath.Join("prebuilts/go", config.HostPrebuiltTag()))
cmd.Environment.Set("BLUEPRINT_LIST_FILE", filepath.Join(config.FileListDir(), "Android.bp.list"))
cmd.Environment.Set("NINJA_BUILDDIR", config.OutDir())
cmd.Environment.Set("SRCDIR", ".")
@@ -99,7 +99,6 @@ func runSoong(ctx Context, config Config) {
if config.IsVerbose() {
cmd.Args = append(cmd.Args, "-v")
}
- cmd.Environment.Set("GOROOT", filepath.Join("./prebuilts/go", config.HostPrebuiltTag()))
cmd.Sandbox = soongSandbox
cmd.Stdin = ctx.Stdin()
cmd.Stdout = ctx.Stdout()