diff options
author | 2025-02-03 23:17:22 +0000 | |
---|---|---|
committer | 2025-02-04 18:33:41 +0000 | |
commit | 7613bd1929057a0da89f4c85ca6506ea98869286 (patch) | |
tree | 31904703ce2015db4c5f81695453282146ce418a | |
parent | eb6a11412f1ee4df3fd7a7f9739920d45dc4ce45 (diff) |
Create install rule for loadplugins without adding to blueprint_tools
m checkbuild --soong-only currently runs into errors for "Test for
dangling rules" since the install rule for loadplugins is not created in
`m --soong-only`. In regular `m` builds kati generates the installation
rule since `LOCAL_SOONG_INSTALLED_MODULE` for `loadplugins` is empty in
the generated Android.mk file.
To solve the missing rule in soong-only mode, always generate the
installation rule.
To prevent repeated reanalysis in `m`, do not add the installed file to
`blueprint_tools`, which is a transitive dep of droid via droid_targets.
Bug: 394096939
Test: m blueprint_tools && m blueprint_tools (second one is noop)
Test: m checkbuild --soong-only (passes at top of stack)
Change-Id: I202bb2fa31543f8e3acbe11a4732f6236cd3b71f
-rw-r--r-- | golang/golang.go | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/golang/golang.go b/golang/golang.go index d33f5e050..3422f8bdf 100644 --- a/golang/golang.go +++ b/golang/golang.go @@ -97,17 +97,16 @@ func (g *GoBinary) GenerateAndroidBuildActions(ctx android.ModuleContext) { outputFile := android.PathForArbitraryOutput(ctx, android.Rel(ctx, ctx.Config().OutDir(), g.IntermediateFile())).WithoutRel() g.outputFile = outputFile - // Don't create install rules for modules used by bootstrap, the install command line will differ from - // what was used during bootstrap, which will cause ninja to rebuild the module on the next run, - // triggering reanalysis. - if !usedByBootstrap(ctx.ModuleName()) { - installPath := ctx.InstallFile(android.PathForModuleInstall(ctx, "bin"), ctx.ModuleName(), outputFile) - - // Modules in an unexported namespace have no install rule, only add modules in the exported namespaces - // to the blueprint_tools phony rules. - if !ctx.Config().KatiEnabled() || g.ExportedToMake() { - ctx.Phony("blueprint_tools", installPath) - } + installPath := ctx.InstallFile(android.PathForModuleInstall(ctx, "bin"), ctx.ModuleName(), outputFile) + + // Modules in an unexported namespace have no install rule, only add modules in the exported namespaces + // to the blueprint_tools phony rules. + if (!ctx.Config().KatiEnabled() || g.ExportedToMake()) && !usedByBootstrap(ctx.ModuleName()) { + // Don't add the installed file of bootstrap tools to the deps of `blueprint_tools`. + // The install command line will differ from what was used during bootstrap, + // which will cause ninja to rebuild the module on the next run, + // triggering reanalysis. + ctx.Phony("blueprint_tools", installPath) } ctx.SetOutputFiles(android.Paths{outputFile}, "") |