Make glob output include product name
glob pattern could vary, depending on device configuration, but it uses
the same glob output path for now. It makes unnecessary soong
reevaluation due to the previous result is always overwritten whenever
the target is changed.
So make it product specific to avoid this.
Bug: 294058160
Test: lunch a && m nothing && lunch b && m nothing && lunch a && m
nothing and then check if there is no glob work. (a and b has different
glob pattern due to RRO configuration or something)
Change-Id: I7b6b7a326de681b046a55dbdb34d812cace510e6
diff --git a/ui/build/soong.go b/ui/build/soong.go
index a4cf7fb..44ce3ad 100644
--- a/ui/build/soong.go
+++ b/ui/build/soong.go
@@ -195,9 +195,13 @@
var allArgs []string
allArgs = append(allArgs, pb.specificArgs...)
+ globPathName, ok := pb.config.TargetProductOrErr()
+ if ok != nil {
+ globPathName = pb.name
+ }
allArgs = append(allArgs,
- "--globListDir", pb.name,
- "--globFile", pb.config.NamedGlobFile(pb.name))
+ "--globListDir", globPathName,
+ "--globFile", pb.config.NamedGlobFile(globPathName))
allArgs = append(allArgs, commonArgs...)
allArgs = append(allArgs, environmentArgs(pb.config, pb.name)...)