From d3243d5e74823cc60da1ff817ef4e932eed6c564 Mon Sep 17 00:00:00 2001 From: Trevor Radcliffe Date: Tue, 15 Aug 2023 15:07:22 +0000 Subject: [PATCH] Use relative path instead of base for python proto We encountered a duplicate sources bug in python proto generation because we're only using the base name. This CL makes it use the entire path to avoid this. Fixes: 295333879 Test: Presubmits Change-Id: I4ab821508cd5979bd595e327c1ccd3d68110fba6 --- python/proto.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/proto.go b/python/proto.go index 400e72c99..ad2b786e2 100644 --- a/python/proto.go +++ b/python/proto.go @@ -19,7 +19,8 @@ import ( ) func genProto(ctx android.ModuleContext, protoFile android.Path, flags android.ProtoFlags) android.Path { - srcsZipFile := android.PathForModuleGen(ctx, protoFile.Base()+".srcszip") + // Using protoFile.Base() would generate duplicate source errors in some cases, so we use Rel() instead + srcsZipFile := android.PathForModuleGen(ctx, protoFile.Rel()+".srcszip") outDir := srcsZipFile.ReplaceExtension(ctx, "tmp") depFile := srcsZipFile.ReplaceExtension(ctx, "srcszip.d")