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
diff --git a/cmd/soong_build/main.go b/cmd/soong_build/main.go
index e903c0a..d2eadba 100644
--- a/cmd/soong_build/main.go
+++ b/cmd/soong_build/main.go
@@ -817,6 +817,9 @@
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...)