aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2021-06-01 11:43:55 -0700
committerColin Cross <ccross@android.com>2021-06-01 14:57:06 -0700
commit7dcd16c6eb7a20fe9f2b219edae2aa9b97ef56c7 (patch)
tree0cf2238cdecb1d936aa3c85b6059e5433ebfcfd8 /ui
parentf58e5e8f249357b9cdd43e614618d59e30c35946 (diff)
downloadsoong-7dcd16c6eb7a20fe9f2b219edae2aa9b97ef56c7.tar.gz
Fix propagating EMPTY_NINJA_FILE from multiproduct_kati to minibp
I6dca478f356f56a8aee1e457d71439272351390b replaced calling build/blueprint/bootstrap.bash with running minibp directly, but didn't propagate the EMPTY_NINJA_FILE environment variable to minibp. Since everything that uses EMPTY_NINJA_FILE is executed directly from soong_ui now, replace the EMPTY_NINJA_FILE environment variable with a config bool and pass it to minibp. Bug: 189148777 Test: build/soong/build_test.bash --dist --incremental --shard-count=300 --shard=1 && du out/multiproduct Change-Id: I4d64275ce02c5d68948012f71ac4dc3795af9e85 Merged-In: I4d64275ce02c5d68948012f71ac4dc3795af9e85 (cherry picked from commit f3bdbcbea3fb07d41ff7cf554e0f4db645890944)
Diffstat (limited to 'ui')
-rw-r--r--ui/build/config.go14
-rw-r--r--ui/build/kati.go2
-rw-r--r--ui/build/soong.go1
3 files changed, 13 insertions, 4 deletions
diff --git a/ui/build/config.go b/ui/build/config.go
index 1d1f71f67..3ebde0dbe 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -72,6 +72,9 @@ type configImpl struct {
// During Bazel execution, Bazel cannot write outside OUT_DIR.
// So if DIST_DIR is set to an external dir (outside of OUT_DIR), we need to rig it temporarily and then migrate files at the end of the build.
riggedDistDirForBazel string
+
+ // Set by multiproduct_kati
+ emptyNinjaFile bool
}
const srcDirFileCheck = "build/soong/root.bp"
@@ -203,9 +206,6 @@ func NewConfig(ctx Context, args ...string) Config {
"ANDROID_DEV_SCRIPTS",
"ANDROID_EMULATOR_PREBUILTS",
"ANDROID_PRE_BUILD_PATHS",
-
- // Only set in multiproduct_kati after config generation
- "EMPTY_NINJA_FILE",
)
if ret.UseGoma() || ret.ForceUseGoma() {
@@ -1189,3 +1189,11 @@ func (c *configImpl) LogsDir() string {
func (c *configImpl) BazelMetricsDir() string {
return filepath.Join(c.LogsDir(), "bazel_metrics")
}
+
+func (c *configImpl) SetEmptyNinjaFile(v bool) {
+ c.emptyNinjaFile = v
+}
+
+func (c *configImpl) EmptyNinjaFile() bool {
+ return c.emptyNinjaFile
+}
diff --git a/ui/build/kati.go b/ui/build/kati.go
index 06ec64607..dad68fac2 100644
--- a/ui/build/kati.go
+++ b/ui/build/kati.go
@@ -136,7 +136,7 @@ func runKati(ctx Context, config Config, extraSuffix string, args []string, envF
// information out with --empty_ninja_file.
//
// From https://github.com/google/kati/commit/87b8da7af2c8bea28b1d8ab17679453d859f96e5
- if config.Environment().IsEnvTrue("EMPTY_NINJA_FILE") {
+ if config.EmptyNinjaFile() {
args = append(args, "--empty_ninja_file")
}
diff --git a/ui/build/soong.go b/ui/build/soong.go
index a41dbe1b5..87818e386 100644
--- a/ui/build/soong.go
+++ b/ui/build/soong.go
@@ -119,6 +119,7 @@ func bootstrapBlueprint(ctx Context, config Config, integratedBp2Build bool) {
args.OutFile = shared.JoinPath(config.SoongOutDir(), ".bootstrap/build.ninja")
args.GlobFile = globFile
args.GeneratingPrimaryBuilder = true
+ args.EmptyNinjaFile = config.EmptyNinjaFile()
args.DelveListen = os.Getenv("SOONG_DELVE")
if args.DelveListen != "" {