No description
Find a file
Dan Willemsen 7d0dddd84d Simplify bootstrap
tl;dr: Read if you don't use the wrapper or use SKIP_NINJA

Previously, we were relying on the ninja behavior of restarting the
build when the build.ninja file was updated to switch between different
bootstrap stages. But that means that every step that could produce a
build.ninja must pass in order to switch to a different stage. That
wasn't a big problem when we had a two stage build -- there was very
little that could fail in the second stage before we chose to go back to
the first stage. But when we had a three stage build, it was possible to
get into a state (usually during development) where you were in the
second stage, but the build was failing because the first stage needed
to be run. This was fixed in d79f1af742
by adding a wrapper that always started building at the first stage.

But this kept all of the complexity of using ninja restarts without any
of the benefits, so this change removes that complexity and just runs
each stage sequentially in the wrapper. So the wrapper is now required.

Since we're no longer going through choosestage, we can also skip the
template parsing for the later stages that don't need to be templated --
this can save a couple of seconds for large files.

In addition to all of the above, this also lets Soong reduce the number
of times the main ninja file is loaded. We had been running the wrapper
once (3 stages), then running ninja again after combining the
Soong-generated build.ninja with the Kati-generated build.ninja. This
change lets us removing the intermediate parsing of Soong's build.ninja,
so that we only execute ninja 3 times per build. It also lets us have
dependencies on pools or rules from Kati in the primary builder, since
we're never executing the main build.ninja without the Kati build.ninja.

The wrapper has a new option, NINJA to provide the path to ninja. This
used to be hardcoded to `ninja`, and will still default to that. But
we'll be running the first two bootstrap stages with $NINJA even if
SKIP_NINJA is set.

The wrapper passes "-w dupbuild=err" to ninja now -- this really should
always be turned on if you care about reliable builds.

Change-Id: I6f656b74eb3d064b8b9e69d1d6dac1129d72b747
2016-08-30 17:26:56 -07:00
bootstrap Simplify bootstrap 2016-08-30 17:26:56 -07:00
bpfmt Update import paths to include github 2015-03-21 01:03:36 -04:00
bpmodify Remove blueprint/parser.Ident 2016-06-14 15:26:49 -07:00
deptools Make WriteDepFile escape spaces and special characters 2015-04-14 23:34:24 -04:00
gotestmain Fix package names for executables. 2016-03-23 20:57:43 -07:00
gotestrunner Add a test runner 2015-09-18 10:28:36 -07:00
loadplugins Implement plugins for bootstrap go modules 2015-09-14 15:35:12 -07:00
parser Fix error messages containing variable types 2016-07-15 16:43:42 -07:00
pathtools Fix glob dependencies when initial non-wild path does not exist 2015-06-18 10:49:36 -07:00
proptools Relax type requirements when extending properties 2016-08-22 15:35:17 -07:00
tests Simplify bootstrap 2016-08-30 17:26:56 -07:00
.gitignore Add test suite for bootstrapping 2015-07-23 22:04:42 -07:00
.travis.fix-fork.sh Fix running travis on forked repos 2015-07-23 21:07:32 -07:00
.travis.gofmt.sh Enforce gofmt in travis 2016-08-11 10:21:37 -07:00
.travis.install-ninja.sh Switch to custom-built ninja v1.6.0 2015-07-23 21:07:32 -07:00
.travis.yml Simplify bootstrap 2016-08-30 17:26:56 -07:00
blueprint.bash Simplify bootstrap 2016-08-30 17:26:56 -07:00
Blueprints Simplify bootstrap 2016-08-30 17:26:56 -07:00
bootstrap.bash Simplify bootstrap 2016-08-30 17:26:56 -07:00
build.ninja.in Simplify bootstrap 2016-08-30 17:26:56 -07:00
context.go Merge pull request #117 from colincross/variant 2016-08-15 12:22:37 -07:00
context_test.go Reimplement VisitDirectDeps[If] in on Context.walkdeps 2016-08-08 17:30:38 -07:00
CONTRIBUTING.md Add CONTRIBUTING.md file 2015-03-16 00:12:49 -07:00
doc.go Indent code block in doc.go 2015-04-11 09:52:11 -07:00
fs.go Allow tests to mock filesystem 2016-08-08 17:26:57 -07:00
LICENSE Add license headers and LICENSE file 2015-01-23 14:23:27 -08:00
live_tracker.go Add common implicit deps to Rules 2015-11-17 17:08:05 -08:00
mangle.go Add license headers and LICENSE file 2015-01-23 14:23:27 -08:00
module_ctx.go Parallelize BottomUpMutators 2016-08-10 16:31:35 -07:00
ninja_defs.go Fix gofmt 2016-08-10 16:31:35 -07:00
ninja_strings.go Allow wrapping of PackageContext 2015-11-30 17:03:34 -08:00
ninja_strings_test.go Fix formatting 2015-04-20 16:41:55 -07:00
ninja_writer.go Support comments in build rules. 2015-11-08 12:21:58 -08:00
ninja_writer_test.go Support comments in build rules. 2015-11-08 12:21:58 -08:00
package_ctx.go Add NewBuiltinRule and NewBuiltinPool 2016-08-29 15:12:33 -07:00
README.md Update link to Ninja 2016-08-18 00:48:20 -04:00
scope.go Allow wrapping of PackageContext 2015-11-30 17:03:34 -08:00
singleton_ctx.go Expose ModuleType to Singletons 2016-07-25 15:51:50 -07:00
splice_modules_test.go Parallelize BottomUpMutators 2016-08-10 16:31:35 -07:00
unpack.go Only instantiate nil struct pointers that are used 2016-08-08 17:35:29 -07:00
unpack_test.go Support nil pointers to structs in properties 2016-08-05 17:19:36 -07:00
visit_test.go Reimplement VisitDirectDeps[If] in on Context.walkdeps 2016-08-08 17:30:38 -07:00

Blueprint Build System

Build Status

Blueprint is a meta-build system that reads in Blueprints files that describe modules that need to be built, and produces a Ninja manifest describing the commands that need to be run and their dependencies. Where most build systems use built-in rules or a domain-specific language to describe the logic for converting module descriptions to build rules, Blueprint delegates this to per-project build logic written in Go. For large, heterogenous projects this allows the inherent complexity of the build logic to be maintained in a high-level language, while still allowing simple changes to individual modules by modifying easy to understand Blueprints files.