Browse Source

Skip cloning modules in bp2build

This paves the way for some feature work for bp2build, and also shaves
0.25-0.5s from the runtime of bp2build (as tested on my machine).

Test: Treehugger
Bug: 285631638
Change-Id: I841f3f904731d02468a6a68a9535d45e0ea9d7c1
Chris Parsons 1 year ago
parent
commit
3a5c170584
1 changed files with 3 additions and 0 deletions
  1. 3 0
      cmd/soong_build/main.go

+ 3 - 0
cmd/soong_build/main.go

@@ -817,6 +817,9 @@ func runBp2Build(ctx *android.Context, extraNinjaDeps []string, metricsDir strin
 		ctx.SetNameInterface(newNameResolver(ctx.Config()))
 		ctx.RegisterForBazelConversion()
 		ctx.SetModuleListFile(cmdlineArgs.ModuleListFile)
+		// Skip cloning modules during bp2build's blueprint run. Some mutators set
+		// bp2build-related module values which should be preserved during codegen.
+		ctx.SkipCloneModulesAfterMutators = true
 
 		var ninjaDeps []string
 		ninjaDeps = append(ninjaDeps, extraNinjaDeps...)