aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2017-03-02 15:49:10 -0800
committerDan Willemsen <dwillemsen@google.com>2017-03-02 19:42:21 -0800
commit0c3919e9962ce6d98cd91f10ea8be944dd0b27a0 (patch)
tree610ef599b7e563314eabc28ebdd6d8e12e420772 /ui
parent88744e25d433dc4c18171d5791540412dbdf8634 (diff)
downloadbuild_soong-0c3919e9962ce6d98cd91f10ea8be944dd0b27a0.tar.gz
build_soong-0c3919e9962ce6d98cd91f10ea8be944dd0b27a0.tar.bz2
build_soong-0c3919e9962ce6d98cd91f10ea8be944dd0b27a0.zip
Fix OUT_DIR_COMMON_BASE with soong_uiandroid-o-preview-1
Currently, Kati is the only one that is respecting OUT_DIR_COMMON_BASE, causing the build to fail when ninja tries to match up the Soong and Kati ninja files. The soong_ui.bash script change is necessary to move the microfactory built outputs to the correct location. The config.go change takes care of setting OUT_DIR in the environment of every subprocess, so that we could remove the OUT_DIR_COMMON_BASE handling from Make once the USE_SOONG_UI=false path goes away. Bug: 35929763 Test: m -j blueprint_tools Test: OUT_DIR=... m -j blueprint_tools Test: OUT_DIR_COMMON_BASE=... m -j blueprint_tools Change-Id: I4184f2b4392d32c5bea51e51162a48df0e5c90d5
Diffstat (limited to 'ui')
-rw-r--r--ui/build/config.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/ui/build/config.go b/ui/build/config.go
index 4853643c..9a8a3fb3 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -50,6 +50,19 @@ func NewConfig(ctx Context, args ...string) Config {
environ: OsEnvironment(),
}
+ // Make sure OUT_DIR is set appropriately
+ if _, ok := ret.environ.Get("OUT_DIR"); !ok {
+ outDir := "out"
+ if baseDir, ok := ret.environ.Get("OUT_DIR_COMMON_BASE"); ok {
+ if wd, err := os.Getwd(); err != nil {
+ ctx.Fatalln("Failed to get working directory:", err)
+ } else {
+ outDir = filepath.Join(baseDir, filepath.Base(wd))
+ }
+ }
+ ret.environ.Set("OUT_DIR", outDir)
+ }
+
ret.environ.Unset(
// We're already using it
"USE_SOONG_UI",
@@ -67,6 +80,9 @@ func NewConfig(ctx Context, args ...string) Config {
// Used by the goma compiler wrapper, but should only be set by
// gomacc
"GOMACC_PATH",
+
+ // We handle this above
+ "OUT_DIR_COMMON_BASE",
)
// Tell python not to spam the source tree with .pyc files.