Ensure bpglob is built early

This matches the change to blueprint's blueprint_impl.bash:
https://github.com/google/blueprint/pull/213

It allows us to run bpglob during the two bootstrap phases, so we're
never running minibp or the primary builder in a later phase than
normal.

Also removes the dependency on out/soong/build.ninja from the main
phase, since it's never generated by the main phase anymore, and is
tripping the dangling dependency checks.

Bug: 73646380
Test: m nothing
Test: rm frameworks/base/core/java/android/content/pm/dex/ArtManager.java
Test: m nothing   (soong re-runs)
Change-Id: Ia3952d015ad6091ad5a841f555acda78c9390e84
This commit is contained in:
Dan Willemsen
2018-07-05 21:46:51 -07:00
parent 878c662602
commit 5af1cbe776
2 changed files with 15 additions and 6 deletions

View File

@@ -40,7 +40,6 @@ builddir = {{.OutDir}}
{{if .HasKatiSuffix}}include {{.KatiNinjaFile}} {{if .HasKatiSuffix}}include {{.KatiNinjaFile}}
{{end -}} {{end -}}
include {{.SoongNinjaFile}} include {{.SoongNinjaFile}}
build {{.CombinedNinjaFile}}: phony {{.SoongNinjaFile}}
`)) `))
func createCombinedBuildNinjaFile(ctx Context, config Config) { func createCombinedBuildNinjaFile(ctx Context, config Config) {

View File

@@ -71,21 +71,31 @@ func runSoong(ctx Context, config Config) {
} }
}() }()
var cfg microfactory.Config
cfg.Map("github.com/google/blueprint", "build/blueprint")
cfg.TrimPath = absPath(ctx, ".")
func() { func() {
ctx.BeginTrace("minibp") ctx.BeginTrace("minibp")
defer ctx.EndTrace() defer ctx.EndTrace()
var cfg microfactory.Config
cfg.Map("github.com/google/blueprint", "build/blueprint")
cfg.TrimPath = absPath(ctx, ".")
minibp := filepath.Join(config.SoongOutDir(), ".minibootstrap/minibp") minibp := filepath.Join(config.SoongOutDir(), ".minibootstrap/minibp")
if _, err := microfactory.Build(&cfg, minibp, "github.com/google/blueprint/bootstrap/minibp"); err != nil { if _, err := microfactory.Build(&cfg, minibp, "github.com/google/blueprint/bootstrap/minibp"); err != nil {
ctx.Fatalln("Failed to build minibp:", err) ctx.Fatalln("Failed to build minibp:", err)
} }
}() }()
func() {
ctx.BeginTrace("bpglob")
defer ctx.EndTrace()
bpglob := filepath.Join(config.SoongOutDir(), ".minibootstrap/bpglob")
if _, err := microfactory.Build(&cfg, bpglob, "github.com/google/blueprint/bootstrap/bpglob"); err != nil {
ctx.Fatalln("Failed to build bpglob:", err)
}
}()
ninja := func(name, file string) { ninja := func(name, file string) {
ctx.BeginTrace(name) ctx.BeginTrace(name)
defer ctx.EndTrace() defer ctx.EndTrace()