Use three stage builds

This splits the current bootstrap stage into two stages:

A bootstrap stage, which like today, a reference is checked into the
tree. It just builds the "core" blueprint binaries -- minibp,
gotestmain, and choosestage. Just enough to build the next stage's ninja
file.

A primary builder stage. This builds the primary builder, the main ninja
file, and any other bootstrap binaries (bpfmt, etc).

The main advantage here is that the checked in file really only contains
references to blueprint -- not the primary builder. This will allow us
to make the primary builder more dynamic, by loading more module types
that may or may not exist in all trees.

It's even possible to reuse the build.ninja.in in the blueprint repo
directly now. We don't currently do that, since we still want to turn on
tests.

Change-Id: I18683891ed7348b0d7af93084e3a68a04fbd5dbc
16 files changed
tree: ad6f8364ce9baa1e68e691abf11fec5a68f69b8a
  1. bootstrap/
  2. bpfmt/
  3. bpmodify/
  4. choosestage/
  5. deptools/
  6. gotestmain/
  7. parser/
  8. pathtools/
  9. proptools/
  10. tests/
  11. .gitignore
  12. .travis.yml
  13. Blueprints
  14. bootstrap.bash
  15. build.ninja.in
  16. context.go
  17. context_test.go
  18. CONTRIBUTING.md
  19. doc.go
  20. LICENSE
  21. live_tracker.go
  22. mangle.go
  23. module_ctx.go
  24. ninja_defs.go
  25. ninja_strings.go
  26. ninja_strings_test.go
  27. ninja_writer.go
  28. ninja_writer_test.go
  29. package_ctx.go
  30. README.md
  31. scope.go
  32. singleton_ctx.go
  33. splice_modules_test.go
  34. unpack.go
  35. unpack_test.go
README.md

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.