From 95f18bd6c5922bd1d2d7033865960ad751168c8c Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 14 Dec 2022 15:43:39 -0800 Subject: [PATCH] Strip device name from gen_notice license files The output libcore-library-notices gen_notice module is embedded in core-module-lib-stubs, which is a transtiive dependency of effectively every javac invocation targeting the device. The output files listed in the notice file can contain a path that includes the device name, for example "target/product/generic_arm64/system/framework/core-libart.jar". This causes the stubs contents to be different for every product, which drastically reduces the cache hit rate of RBE. Strip the "out/target/product/generic_arm64" prefix from paths in the notice file. Bug: 262620891 Test: unzip -p out/soong/.intermediates/libcore/art.module.public.api.stubs.module_lib/android_common/turbine-combined/art.module.public.api.stubs.module_lib.jar NOTICES/libcore-NOTICES.txt Change-Id: I705ed1252ef2a595dae53873993adefa1ea85662 --- android/gen_notice.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/gen_notice.go b/android/gen_notice.go index 28fddbcee..091345b9f 100644 --- a/android/gen_notice.go +++ b/android/gen_notice.go @@ -16,6 +16,7 @@ package android import ( "fmt" + "path/filepath" "strings" "github.com/google/blueprint/proptools" @@ -73,6 +74,7 @@ func (s *genNoticeBuildRules) GenerateBuildActions(ctx SingletonContext) { out(ctx, gm.output, ctx.ModuleName(gm), proptools.StringDefault(gm.properties.ArtifactName, defaultName), []string{ + filepath.Join(ctx.Config().OutDir(), "target", "product", ctx.Config().DeviceName()) + "/", ctx.Config().OutDir() + "/", ctx.Config().SoongOutDir() + "/", }, modules...)