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

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

Change-Id: I67d9c22741b5e9e9816f0273a16f09d6aa00efc0
This commit is contained in:
Lukacs T. Berki 2021-11-10 17:29:12 +00:00 committed by Automerger Merge Worker
commit ffa095e33e
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
@ -85,7 +83,6 @@ func GlobFile(ctx GlobFileContext, pattern string, excludes []string, fileListFi
Outputs: []string{fileListFile},
Args: map[string]string{
"args": args,
"globCmd": "$primaryBuilderGlobCmd",
},
Description: "glob " + pattern,
})
@ -117,7 +114,6 @@ func multipleGlobFilesRule(ctx GlobFileContext, fileListFile string, shard int,
Outputs: []string{fileListFile},
Args: map[string]string{
"args": args.String(),
"globCmd": "$bootstrapGlobCmd",
},
Description: fmt.Sprintf("regenerate globs shard %d of %d", shard, numGlobBuckets),
})