Move bpglob to outside of the Ninja action graph. am: 6fbc68d41d am: ffa095e33e am: 47f1fb8fb6

Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1879698

Change-Id: Ie989c6fe4d07055164212c2d13b1ae31bb489faa
This commit is contained in:
Lukacs T. Berki 2021-11-10 17:53:18 +00:00 committed by Automerger Merge Worker
commit e40adf699a
2 changed files with 4 additions and 22 deletions

View file

@ -149,13 +149,6 @@ var (
},
"depfile")
noop = pctx.StaticRule("noop",
blueprint.RuleParams{
Command: "true",
Description: "noop",
Restat: true,
})
_ = pctx.VariableFunc("ToolDir", func(config interface{}) (string, error) {
return config.(BootstrapConfig).HostToolDir(), nil
})
@ -716,13 +709,6 @@ func (s *singleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
Inputs: blueprintGoPackages,
Optional: true,
})
// out/soong/bpglob is built by microfactory before any ninja runs, write a rule that
// convinces ninja that it has been built to avoid tripping Soong's dangling rules check.
ctx.Build(pctx, blueprint.BuildParams{
Rule: noop,
Outputs: []string{"$bootstrapGlobCmd"},
})
}
// packageRoot returns the module-specific package root directory path. This

View file

@ -44,12 +44,10 @@ import (
// in a build failure with a "missing and no known rule to make it" error.
var (
_ = pctx.VariableFunc("bootstrapGlobCmd", func(config interface{}) (string, error) {
_ = pctx.VariableFunc("globCmd", func(config interface{}) (string, error) {
return filepath.Join(config.(BootstrapConfig).SoongOutDir(), "bpglob"), nil
})
_ = pctx.StaticVariable("primaryBuilderGlobCmd", filepath.Join("$ToolDir", "bpglob"))
// globRule rule traverses directories to produce a list of files that match $glob
// and writes it to $out if it has changed, and writes the directories to $out.d
GlobRule = pctx.StaticRule("GlobRule",
@ -62,7 +60,7 @@ var (
Deps: blueprint.DepsGCC,
Depfile: "$out.d",
},
"args", "globCmd")
"args")
)
// GlobFileContext is the subset of ModuleContext and SingletonContext needed by GlobFile
@ -84,8 +82,7 @@ func GlobFile(ctx GlobFileContext, pattern string, excludes []string, fileListFi
Rule: GlobRule,
Outputs: []string{fileListFile},
Args: map[string]string{
"args": args,
"globCmd": "$primaryBuilderGlobCmd",
"args": args,
},
Description: "glob " + pattern,
})
@ -116,8 +113,7 @@ func multipleGlobFilesRule(ctx GlobFileContext, fileListFile string, shard int,
Rule: GlobRule,
Outputs: []string{fileListFile},
Args: map[string]string{
"args": args.String(),
"globCmd": "$bootstrapGlobCmd",
"args": args.String(),
},
Description: fmt.Sprintf("regenerate globs shard %d of %d", shard, numGlobBuckets),
})