From 03e50cb4d76a99f439230dacb908da4510f84310 Mon Sep 17 00:00:00 2001 From: Jeongik Cha Date: Wed, 2 Aug 2023 00:57:32 +0900 Subject: [PATCH] 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 --- ui/build/soong.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/build/soong.go b/ui/build/soong.go index a4cf7fbf0..44ce3ad08 100644 --- a/ui/build/soong.go +++ b/ui/build/soong.go @@ -195,9 +195,13 @@ func (pb PrimaryBuilderFactory) primaryBuilderInvocation() bootstrap.PrimaryBuil 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)...)