Clean up unnecessary dependencies
Other than cleaning up the code, the only change in behavior is to run the docs build in parallel with the primary builder, saving about a second on a Soong bootstrap (10s -> 9s). Change-Id: Iaff51d6d1a37af842f294f12db11d5774d48d440
This commit is contained in:
parent
b6d88a4f0a
commit
460c80eb12
3 changed files with 16 additions and 54 deletions
|
@ -53,10 +53,10 @@ else
|
|||
fi
|
||||
|
||||
# Build minibp and the primary build.ninja
|
||||
"${NINJA}" -w dupbuild=err -f "${BUILDDIR}/.minibootstrap/build.ninja" "${BUILDDIR}/.bootstrap/build.ninja"
|
||||
"${NINJA}" -w dupbuild=err -f "${BUILDDIR}/.minibootstrap/build.ninja"
|
||||
|
||||
# Build the primary builder and the main build.ninja
|
||||
"${NINJA}" -w dupbuild=err -f "${BUILDDIR}/.bootstrap/build.ninja" "${BUILDDIR}/build.ninja"
|
||||
"${NINJA}" -w dupbuild=err -f "${BUILDDIR}/.bootstrap/build.ninja"
|
||||
|
||||
# SKIP_NINJA can be used by wrappers that wish to run ninja themselves.
|
||||
if [ -z "$SKIP_NINJA" ]; then
|
||||
|
|
|
@ -596,10 +596,6 @@ func (s *singleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
|
|||
// creating the binary that we'll use to generate the non-bootstrap
|
||||
// build.ninja file.
|
||||
var primaryBuilders []*goBinary
|
||||
// bootstrapDeps contains modules that will be built in StageBootstrap
|
||||
var bootstrapDeps []string
|
||||
// primaryBootstrapDeps contains modules that will be built in StagePrimary
|
||||
var primaryBootstrapDeps []string
|
||||
// blueprintTools contains blueprint go binaries that will be built in StageMain
|
||||
var blueprintTools []string
|
||||
ctx.VisitAllModulesIf(isBootstrapBinaryModule,
|
||||
|
@ -608,12 +604,7 @@ func (s *singleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
|
|||
binaryModuleName := ctx.ModuleName(binaryModule)
|
||||
installPath := filepath.Join(binaryModule.InstallPath(), binaryModuleName)
|
||||
|
||||
switch binaryModule.BuildStage() {
|
||||
case StageBootstrap:
|
||||
bootstrapDeps = append(bootstrapDeps, installPath)
|
||||
case StagePrimary:
|
||||
primaryBootstrapDeps = append(primaryBootstrapDeps, installPath)
|
||||
case StageMain:
|
||||
if binaryModule.BuildStage() == StageMain {
|
||||
blueprintTools = append(blueprintTools, installPath)
|
||||
}
|
||||
if binaryModule.properties.PrimaryBuilder {
|
||||
|
@ -653,35 +644,12 @@ func (s *singleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
|
|||
topLevelBlueprints := filepath.Join("$srcDir",
|
||||
filepath.Base(s.config.topLevelBlueprintsFile))
|
||||
|
||||
bootstrapDeps = append(bootstrapDeps, topLevelBlueprints)
|
||||
|
||||
mainNinjaFile := filepath.Join("$buildDir", "build.ninja")
|
||||
primaryBuilderNinjaFile := filepath.Join(bootstrapDir, "build.ninja")
|
||||
bootstrapNinjaFileTemplate := filepath.Join(miniBootstrapDir, "build.ninja.in")
|
||||
bootstrapNinjaFile := filepath.Join(miniBootstrapDir, "build.ninja")
|
||||
docsFile := filepath.Join(docsDir, primaryBuilderName+".html")
|
||||
|
||||
primaryBootstrapDeps = append(primaryBootstrapDeps, docsFile)
|
||||
|
||||
// If the tests change, be sure to re-run them. These need to be
|
||||
// dependencies for the ninja file so that it's updated after these
|
||||
// run.
|
||||
ctx.VisitAllModulesIf(isGoTestProducer,
|
||||
func(module blueprint.Module) {
|
||||
testModule := module.(goTestProducer)
|
||||
target := testModule.GoTestTarget()
|
||||
if target != "" {
|
||||
switch testModule.BuildStage() {
|
||||
case StageBootstrap:
|
||||
bootstrapDeps = append(bootstrapDeps, target)
|
||||
case StagePrimary:
|
||||
primaryBootstrapDeps = append(primaryBootstrapDeps, target)
|
||||
case StageMain:
|
||||
blueprintTools = append(blueprintTools, target)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
switch s.config.stage {
|
||||
case StageBootstrap:
|
||||
// We're generating a bootstrapper Ninja file, so we need to set things
|
||||
|
@ -696,7 +664,6 @@ func (s *singleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
|
|||
Rule: generateBuildNinja,
|
||||
Outputs: []string{primaryBuilderNinjaFile},
|
||||
Inputs: []string{topLevelBlueprints},
|
||||
Implicits: bootstrapDeps,
|
||||
Args: map[string]string{
|
||||
"builder": minibpFile,
|
||||
"extra": "--build-primary" + extraTestFlags,
|
||||
|
@ -733,7 +700,6 @@ func (s *singleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
|
|||
Rule: generateBuildNinja,
|
||||
Outputs: []string{primaryBuilderNinjaFile},
|
||||
Inputs: []string{topLevelBlueprints},
|
||||
Implicits: bootstrapDeps,
|
||||
Args: map[string]string{
|
||||
"builder": minibpFile,
|
||||
"extra": "--build-primary" + extraTestFlags,
|
||||
|
@ -746,7 +712,6 @@ func (s *singleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
|
|||
Rule: generateBuildNinja,
|
||||
Outputs: []string{mainNinjaFile},
|
||||
Inputs: []string{topLevelBlueprints},
|
||||
Implicits: primaryBootstrapDeps,
|
||||
Args: map[string]string{
|
||||
"builder": primaryBuilderFile,
|
||||
"extra": primaryBuilderExtraFlags,
|
||||
|
@ -780,7 +745,6 @@ func (s *singleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
|
|||
Rule: generateBuildNinja,
|
||||
Outputs: []string{mainNinjaFile},
|
||||
Inputs: []string{topLevelBlueprints},
|
||||
Implicits: primaryBootstrapDeps,
|
||||
Args: map[string]string{
|
||||
"builder": primaryBuilderFile,
|
||||
"extra": primaryBuilderExtraFlags,
|
||||
|
|
|
@ -270,9 +270,7 @@ default ${g.bootstrap.BinDir}/minibp
|
|||
# Factory: github.com/google/blueprint/bootstrap.newSingletonFactory.func1
|
||||
|
||||
build ${g.bootstrap.buildDir}/.bootstrap/build.ninja: g.bootstrap.build.ninja $
|
||||
${g.bootstrap.srcDir}/Blueprints | ${builder} $
|
||||
${g.bootstrap.BinDir}/gotestmain ${g.bootstrap.BinDir}/gotestrunner $
|
||||
${g.bootstrap.BinDir}/minibp ${g.bootstrap.srcDir}/Blueprints
|
||||
${g.bootstrap.srcDir}/Blueprints | ${builder}
|
||||
builder = ${g.bootstrap.BinDir}/minibp
|
||||
extra = --build-primary
|
||||
default ${g.bootstrap.buildDir}/.bootstrap/build.ninja
|
||||
|
|
Loading…
Reference in a new issue