Pass TARGET_DEVICE_DIR from dumpvars to later kati runs
The find commands used to locate the BoardConfig.mk can't be optimized
by Kati, so we're currently spending ~125ms three times during every
build (dumpvars, cleanspec, and the main kati run). Preserve the value
of TARGET_DEVICE_DIR from the dumpvars run so that we only need to run
the find commands once.
Bug: 78020936
Test: out/build-taimen.ninja is identical
Test: out/soong.log shows that we're not running these finds again
Change-Id: Iee56b454c3661de2b58c161169218ecaf2135398
diff --git a/ui/build/dumpvars.go b/ui/build/dumpvars.go
index eb43ed6..cc9e742 100644
--- a/ui/build/dumpvars.go
+++ b/ui/build/dumpvars.go
@@ -157,6 +157,9 @@
// To find target/product/<DEVICE>
"TARGET_DEVICE",
+ // So that later Kati runs can find BoardConfig.mk faster
+ "TARGET_DEVICE_DIR",
+
// Whether --werror_overriding_commands will work
"BUILD_BROKEN_DUP_RULES",
}, exportEnvVars...), BannerVars...)
@@ -182,6 +185,7 @@
config.SetKatiArgs(strings.Fields(make_vars["KATI_GOALS"]))
config.SetNinjaArgs(strings.Fields(make_vars["NINJA_GOALS"]))
config.SetTargetDevice(make_vars["TARGET_DEVICE"])
+ config.SetTargetDeviceDir(make_vars["TARGET_DEVICE_DIR"])
config.SetBuildBrokenDupRules(make_vars["BUILD_BROKEN_DUP_RULES"] != "false")
}