aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2015-07-22 17:05:59 -0700
committerDan Willemsen <dwillemsen@google.com>2015-07-23 22:06:02 -0700
commit91a657e219aa226df400ac30c0982820912051fa (patch)
tree1a074f9126d2f730bf67fc873e78c0526339f0a0 /tests
parentf04c55172fb4810fc8aa463322a40ac130375df7 (diff)
downloadplatform_build_blueprint-91a657e219aa226df400ac30c0982820912051fa.tar.gz
platform_build_blueprint-91a657e219aa226df400ac30c0982820912051fa.tar.bz2
platform_build_blueprint-91a657e219aa226df400ac30c0982820912051fa.zip
Enhance bootstrap stage selection
This simplifies the bootstrap process while making it more flexible by moving the stage selection into a go binary(choosestage). It will now be possible to have more than two build stages. Now each stage has a ninja template(main.ninja.in) and a timestamp file(main.ninja.in.timestamp). The timestamp file may be updated by any build stage that wishes to regenerate the ninja template. If the choosestage binaries sees that the timestamp is newer than the template, it will choose the prior stage. The main stage no longer writes to the source tree to update the build.ninja.in file. This was a problem for read-only source trees. Instead, the choosestage binary first checks to see if that file is newer than the last bootstrap.ninja.in, copies it in place, and starts the boostrap stage. The bootstrap stage regenerates it's own ninja template, but that required a loop through the main stage to actually run it. The choosestage binary now detects if the template has changed for the current stage, and will restart the stage. One change is that if dependencies do get messed up, instead of silently failing, there's a higher chance that the bootstrap step will just continue looping, doing nothing. This can happen if the main stage has a dependency that triggers the bootstrap stage, but the bootstrap stage doesn't see anything required to rebuild the main ninja file. A side effect of this requirement is that changes to test code will now rebuild the main ninja file. Change-Id: I9965cfba79dc0dbbd3af05f5944f7653054455a2
Diffstat (limited to 'tests')
-rw-r--r--tests/expected_all2
-rw-r--r--tests/expected_manifest3
-rw-r--r--tests/expected_rebuild_test2
-rw-r--r--tests/expected_regen5
-rw-r--r--tests/expected_start22
-rw-r--r--tests/expected_start_add_tests2
6 files changed, 12 insertions, 4 deletions
diff --git a/tests/expected_all b/tests/expected_all
index 380b0cc..a92f0b3 100644
--- a/tests/expected_all
+++ b/tests/expected_all
@@ -1,2 +1,2 @@
-Choosing build.ninja.in for next stage
+Choosing bootstrap.ninja.in for next stage
Choosing main.ninja.in for next stage
diff --git a/tests/expected_manifest b/tests/expected_manifest
index 380b0cc..ab67d4b 100644
--- a/tests/expected_manifest
+++ b/tests/expected_manifest
@@ -1,2 +1,3 @@
-Choosing build.ninja.in for next stage
+Newer source version of build.ninja.in. Copying to bootstrap.ninja.in
+Choosing bootstrap.ninja.in for next stage
Choosing main.ninja.in for next stage
diff --git a/tests/expected_rebuild_test b/tests/expected_rebuild_test
index 162d1db..a92f0b3 100644
--- a/tests/expected_rebuild_test
+++ b/tests/expected_rebuild_test
@@ -1,2 +1,2 @@
-Choosing src.build.ninja.in for next stage
+Choosing bootstrap.ninja.in for next stage
Choosing main.ninja.in for next stage
diff --git a/tests/expected_regen b/tests/expected_regen
index 162d1db..4f7adaa 100644
--- a/tests/expected_regen
+++ b/tests/expected_regen
@@ -1,2 +1,5 @@
-Choosing src.build.ninja.in for next stage
+Newer source version of src.build.ninja.in. Copying to bootstrap.ninja.in
+Choosing bootstrap.ninja.in for next stage
+Stage bootstrap.ninja.in has changed, restarting
+Choosing bootstrap.ninja.in for next stage
Choosing main.ninja.in for next stage
diff --git a/tests/expected_start2 b/tests/expected_start2
index dc55ac3..d0b3900 100644
--- a/tests/expected_start2
+++ b/tests/expected_start2
@@ -1 +1,3 @@
+Stage bootstrap.ninja.in has changed, restarting
+Choosing bootstrap.ninja.in for next stage
Choosing main.ninja.in for next stage
diff --git a/tests/expected_start_add_tests b/tests/expected_start_add_tests
index dc55ac3..d0b3900 100644
--- a/tests/expected_start_add_tests
+++ b/tests/expected_start_add_tests
@@ -1 +1,3 @@
+Stage bootstrap.ninja.in has changed, restarting
+Choosing bootstrap.ninja.in for next stage
Choosing main.ninja.in for next stage