There are lots of config knobs in bootstrap, and it is hard to understand how they interact. Consider two recent examples off the top of my head:
We should really catch these issues in tests, not review, and avoid relying too much on specific reviewers who know parts of the code.
Since bootstrap does I/O and interacts with external tooling, it is inherently difficult to test. The strategy I know involves mocking out the build environment (enough to make tests run in <~1s). From there you can record what the implementation does and take two approaches for the test:
- Assert on specific conditions, like "the flag
-D FOO was passed to LLVM cmake" or "foo/bar/baz was moved to foo/bar/quux".
- Record everything in a golden file for some "representative" set of configurations. You can update these with
--bless. This helps guard against unexpected behavior changes.
I think both are helpful. In fact, combining the two is exactly what we do in ui tests.
cc @jyn514 @Mark-Simulacrum
There are lots of config knobs in bootstrap, and it is hard to understand how they interact. Consider two recent examples off the top of my head:
cfeature forcompiler-builtinsan explicit opt-in #101833 (comment)is_rust_llvmllvm_from_ciWe should really catch these issues in tests, not review, and avoid relying too much on specific reviewers who know parts of the code.
Since bootstrap does I/O and interacts with external tooling, it is inherently difficult to test. The strategy I know involves mocking out the build environment (enough to make tests run in <~1s). From there you can record what the implementation does and take two approaches for the test:
-D FOOwas passed to LLVM cmake" or "foo/bar/baz was moved to foo/bar/quux".--bless. This helps guard against unexpected behavior changes.I think both are helpful. In fact, combining the two is exactly what we do in ui tests.
cc @jyn514 @Mark-Simulacrum