diff options
author | 2025-03-05 10:42:50 -0800 | |
---|---|---|
committer | 2025-03-05 10:46:59 -0800 | |
commit | d1bf2723c049639ea94d603cd58cfdfd3341f84c (patch) | |
tree | 71e89a5f6dd913334a270cc843dadccc74142083 /android/module.go | |
parent | de3a5c4be8aff15998cbf898e06fcc4679fe911f (diff) |
Fix -host and -target phonies building both variants
The -install, -checkbuild, -outputs get deduped across all variants,
so when the -host / -target phonies depended on them they were
depending on all variants when they should've only depended on the
host/target variants. Instead of depending on those phonies, depend
on their dependencies for the current variant directly.
Fixes: 400503755
Test: atest CtsCompilationTestCases:android.compilation.cts.CompilationTest
Test: Ran all 4 of these commands, before they all had a successful path, now half of them show there's no path cross-variants:
aninja -t path junit-params-test-host out/host/linux-x86/framework/junit-params-test.jar
aninja -t path junit-params-test-host out/target/product/vsoc_x86_64/testcases/junit-params-test/x86_64/junit-params-test.jar
aninja -t path junit-params-test-target out/host/linux-x86/framework/junit-params-test.jar
aninja -t path junit-params-test-target out/target/product/vsoc_x86_64/testcases/junit-params-test/x86_64/junit-params-test.jar
Change-Id: Iffec01948d7287f7e000ff17a4f65f883f46a87c
Diffstat (limited to 'android/module.go')
-rw-r--r-- | android/module.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/android/module.go b/android/module.go index 7786f13ee..14190f36e 100644 --- a/android/module.go +++ b/android/module.go @@ -1669,9 +1669,10 @@ func (m *ModuleBase) generateModuleTarget(ctx *moduleContext) { if len(ctx.installFiles) > 0 { name := namespacePrefix + ctx.ModuleName() + "-install" - ctx.Phony(name, ctx.installFiles.Paths()...) + installFiles := ctx.installFiles.Paths() + ctx.Phony(name, installFiles...) info.InstallTarget = PathForPhony(ctx, name) - deps = append(deps, info.InstallTarget) + deps = append(deps, installFiles...) } // A module's -checkbuild phony targets should @@ -1681,13 +1682,13 @@ func (m *ModuleBase) generateModuleTarget(ctx *moduleContext) { if (!ctx.Config().KatiEnabled() || !shouldSkipAndroidMkProcessing(ctx, m)) && !ctx.uncheckedModule && ctx.checkbuildTarget != nil { name := namespacePrefix + ctx.ModuleName() + "-checkbuild" ctx.Phony(name, ctx.checkbuildTarget) - deps = append(deps, PathForPhony(ctx, name)) + deps = append(deps, ctx.checkbuildTarget) } if outputFiles, err := outputFilesForModule(ctx, ctx.Module(), ""); err == nil && len(outputFiles) > 0 { name := namespacePrefix + ctx.ModuleName() + "-outputs" ctx.Phony(name, outputFiles...) - deps = append(deps, PathForPhony(ctx, name)) + deps = append(deps, outputFiles...) } if len(deps) > 0 { |