diff options
| -rw-r--r-- | bootstrap/bootstrap.go | 51 | ||||
| -rw-r--r-- | build.ninja.in | 26 | ||||
| -rw-r--r-- | context.go | 2 |
3 files changed, 17 insertions, 62 deletions
diff --git a/bootstrap/bootstrap.go b/bootstrap/bootstrap.go index c07f863..1b6d4e7 100644 --- a/bootstrap/bootstrap.go +++ b/bootstrap/bootstrap.go @@ -16,9 +16,7 @@ package bootstrap import ( "fmt" - "os" "path/filepath" - "strconv" "strings" "github.com/google/blueprint" @@ -34,28 +32,6 @@ var ( linkCmd = pctx.StaticVariable("linkCmd", "$goToolDir/${goChar}l") goTestMainCmd = pctx.StaticVariable("goTestMainCmd", filepath.Join(bootstrapDir, "bin", "gotestmain")) - // Ninja only reinvokes itself once when it regenerates a .ninja file. For - // the re-bootstrap process we need that to happen more than once, so we - // invoke an additional Ninja process from the rebootstrap rule. - // Unfortunately this seems to cause "warning: bad deps log signature or - // version; starting over" messages from Ninja. This warning can be - // avoided by having the bootstrap and non-bootstrap build manifests have - // a different builddir (so they use different log files). - // - // This workaround can be avoided entirely by making a simple change to - // Ninja that would allow it to rebuild the manifest multiple times rather - // than just once. If the Ninja being used is capable of this, then the - // workaround we're doing can be disabled by setting the - // BLUEPRINT_NINJA_HAS_MULTIPASS environment variable to a true value. - runChildNinja = pctx.VariableFunc("runChildNinja", - func(config interface{}) (string, error) { - if ninjaHasMultipass(config) { - return "", nil - } else { - return " && ninja", nil - } - }) - gc = pctx.StaticRule("gc", blueprint.RuleParams{ Command: "GOROOT='$goRoot' $gcCmd -o $out -p $pkgPath -complete " + @@ -99,13 +75,6 @@ var ( Generator: true, }) - rebootstrap = pctx.StaticRule("rebootstrap", - blueprint.RuleParams{ - Command: "$bootstrapCmd -i $in$runChildNinja", - Description: "re-bootstrap $in", - Generator: true, - }) - // Work around a Ninja issue. See https://github.com/martine/ninja/pull/634 phony = pctx.StaticRule("phony", blueprint.RuleParams{ @@ -151,17 +120,6 @@ func isBootstrapBinaryModule(module blueprint.Module) bool { return isBinary } -// ninjaHasMultipass returns true if Ninja will perform multiple passes -// that can regenerate the build manifest. -func ninjaHasMultipass(config interface{}) bool { - envString := os.Getenv("BLUEPRINT_NINJA_HAS_MULTIPASS") - envValue, err := strconv.ParseBool(envString) - if err != nil { - return false - } - return envValue -} - // A goPackage is a module for building Go packages. type goPackage struct { properties struct { @@ -563,11 +521,8 @@ func (s *singleton) GenerateBuildActions(ctx blueprint.SingletonContext) { // We're generating a bootstrapper Ninja file, so we need to set things // up to rebuild the build.ninja file using the primary builder. - // Because the non-bootstrap build.ninja file manually re-invokes Ninja, - // its builddir must be different than that of the bootstrap build.ninja - // file. Otherwise we occasionally get "warning: bad deps log signature - // or version; starting over" messages from Ninja, presumably because - // two Ninja processes try to write to the same log concurrently. + // BuildDir must be different between bootstrap and the main build, + // otherwise the cleanup process will remove files from the other build. ctx.SetBuildDir(pctx, bootstrapDir) // Generate build system docs for the primary builder. Generating docs reads the source @@ -687,7 +642,7 @@ func (s *singleton) GenerateBuildActions(ctx blueprint.SingletonContext) { buildNinjaDeps = append(buildNinjaDeps, rebootstrapDeps...) ctx.Build(pctx, blueprint.BuildParams{ - Rule: rebootstrap, + Rule: bootstrap, Outputs: []string{"build.ninja"}, Inputs: []string{"$bootstrapManifest"}, Implicits: buildNinjaDeps, diff --git a/build.ninja.in b/build.ninja.in index 3f43e21..0bc9450 100644 --- a/build.ninja.in +++ b/build.ninja.in @@ -7,7 +7,7 @@ # # bootstrap [from Go package github.com/google/blueprint/bootstrap] # -ninja_required_version = 1.1.0 +ninja_required_version = 1.6.0 g.bootstrap.bootstrapCmd = @@Bootstrap@@ @@ -52,7 +52,7 @@ rule g.bootstrap.link # Module: blueprint # Variant: # Type: bootstrap_go_package -# Factory: github.com/google/blueprint/bootstrap.func·002 +# Factory: github.com/google/blueprint/bootstrap.func·001 # Defined: Blueprints:1:1 build .bootstrap/blueprint/pkg/github.com/google/blueprint.a: g.bootstrap.gc $ @@ -75,7 +75,7 @@ default .bootstrap/blueprint/pkg/github.com/google/blueprint.a # Module: blueprint-bootstrap # Variant: # Type: bootstrap_go_package -# Factory: github.com/google/blueprint/bootstrap.func·002 +# Factory: github.com/google/blueprint/bootstrap.func·001 # Defined: Blueprints:70:1 build $ @@ -101,7 +101,7 @@ default $ # Module: blueprint-bootstrap-bpdoc # Variant: # Type: bootstrap_go_package -# Factory: github.com/google/blueprint/bootstrap.func·002 +# Factory: github.com/google/blueprint/bootstrap.func·001 # Defined: Blueprints:89:1 build $ @@ -121,7 +121,7 @@ default $ # Module: blueprint-deptools # Variant: # Type: bootstrap_go_package -# Factory: github.com/google/blueprint/bootstrap.func·002 +# Factory: github.com/google/blueprint/bootstrap.func·001 # Defined: Blueprints:46:1 build .bootstrap/blueprint-deptools/pkg/github.com/google/blueprint/deptools.a $ @@ -135,7 +135,7 @@ default $ # Module: blueprint-parser # Variant: # Type: bootstrap_go_package -# Factory: github.com/google/blueprint/bootstrap.func·002 +# Factory: github.com/google/blueprint/bootstrap.func·001 # Defined: Blueprints:31:1 build .bootstrap/blueprint-parser/pkg/github.com/google/blueprint/parser.a: $ @@ -150,7 +150,7 @@ default .bootstrap/blueprint-parser/pkg/github.com/google/blueprint/parser.a # Module: blueprint-pathtools # Variant: # Type: bootstrap_go_package -# Factory: github.com/google/blueprint/bootstrap.func·002 +# Factory: github.com/google/blueprint/bootstrap.func·001 # Defined: Blueprints:52:1 build $ @@ -165,7 +165,7 @@ default $ # Module: blueprint-proptools # Variant: # Type: bootstrap_go_package -# Factory: github.com/google/blueprint/bootstrap.func·002 +# Factory: github.com/google/blueprint/bootstrap.func·001 # Defined: Blueprints:64:1 build $ @@ -180,7 +180,7 @@ default $ # Module: bpfmt # Variant: # Type: bootstrap_go_binary -# Factory: github.com/google/blueprint/bootstrap.func·003 +# Factory: github.com/google/blueprint/bootstrap.func·002 # Defined: Blueprints:110:1 build .bootstrap/bpfmt/obj/bpfmt.a: g.bootstrap.gc $ @@ -202,7 +202,7 @@ default .bootstrap/bin/bpfmt # Module: bpmodify # Variant: # Type: bootstrap_go_binary -# Factory: github.com/google/blueprint/bootstrap.func·003 +# Factory: github.com/google/blueprint/bootstrap.func·002 # Defined: Blueprints:116:1 build .bootstrap/bpmodify/obj/bpmodify.a: g.bootstrap.gc $ @@ -224,7 +224,7 @@ default .bootstrap/bin/bpmodify # Module: gotestmain # Variant: # Type: bootstrap_go_binary -# Factory: github.com/google/blueprint/bootstrap.func·003 +# Factory: github.com/google/blueprint/bootstrap.func·002 # Defined: Blueprints:122:1 build .bootstrap/gotestmain/obj/gotestmain.a: g.bootstrap.gc $ @@ -243,7 +243,7 @@ default .bootstrap/bin/gotestmain # Module: minibp # Variant: # Type: bootstrap_go_binary -# Factory: github.com/google/blueprint/bootstrap.func·003 +# Factory: github.com/google/blueprint/bootstrap.func·002 # Defined: Blueprints:101:1 build .bootstrap/minibp/obj/minibp.a: g.bootstrap.gc $ @@ -269,7 +269,7 @@ default .bootstrap/bin/minibp # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Singleton: bootstrap -# Factory: github.com/google/blueprint/bootstrap.func·008 +# Factory: github.com/google/blueprint/bootstrap.func·007 rule s.bootstrap.bigbpDocs command = .bootstrap/bin/minibp -p --docs ${out} ${g.bootstrap.srcDir}/Blueprints @@ -1631,7 +1631,7 @@ func spliceModulesAtIndex(modules []*moduleInfo, i int, newModules []*moduleInfo func (c *Context) initSpecialVariables() { c.buildDir = nil c.requiredNinjaMajor = 1 - c.requiredNinjaMinor = 1 + c.requiredNinjaMinor = 6 c.requiredNinjaMicro = 0 } |
