-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Mock environment testing for bootstrap #102563
Copy link
Copy link
Open
Labels
A-technical-debtArea: Internal cleanup workArea: Internal cleanup workA-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Metadata
Metadata
Assignees
Labels
A-technical-debtArea: Internal cleanup workArea: Internal cleanup workA-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Type
Fields
Give feedbackNo fields configured for issues without a type.
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