summaryrefslogtreecommitdiff
path: root/golang/golang.go
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-09-13 17:41:24 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-09-13 17:41:24 +0000
commit05d906905193ca79e49fe435e6368a4991154842 (patch)
treedcdcc25e7642d69521a90faf557c4392c3b8da4a /golang/golang.go
parent24627096c18de711c787c7796831186dd4c037e7 (diff)
parent893528a4c903ef8c81927fb89764cc037b0e9a58 (diff)
Merge "Fix reanalysis after full build" into main
Diffstat (limited to 'golang/golang.go')
-rw-r--r--golang/golang.go20
1 files changed, 17 insertions, 3 deletions
diff --git a/golang/golang.go b/golang/golang.go
index ede2150dc..618a0852b 100644
--- a/golang/golang.go
+++ b/golang/golang.go
@@ -96,17 +96,31 @@ func (g *GoBinary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
outputFile := android.PathForArbitraryOutput(ctx, android.Rel(ctx, ctx.Config().OutDir(), g.IntermediateFile())).WithoutRel()
g.outputFile = outputFile
- installPath := ctx.InstallFile(android.PathForModuleInstall(ctx, "bin"), ctx.ModuleName(), 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)
- if !ctx.Config().KatiEnabled() || g.ExportedToMake() {
// Modules in an unexported namespace have no install rule, only add modules in the exported namespaces
// to the blueprint_tools phony rules.
- ctx.Phony("blueprint_tools", installPath)
+ if !ctx.Config().KatiEnabled() || g.ExportedToMake() {
+ ctx.Phony("blueprint_tools", installPath)
+ }
}
ctx.SetOutputFiles(android.Paths{outputFile}, "")
}
+func usedByBootstrap(name string) bool {
+ switch name {
+ case "loadplugins", "soong_build":
+ return true
+ default:
+ return false
+ }
+}
+
func (g *GoBinary) HostToolPath() android.OptionalPath {
return android.OptionalPathForPath(g.outputFile)
}