Skip to content

Commit 299c1fe

Browse files
committed
rustc-dev-guide: document RUSTC_TEST_GIT_HASH
1 parent 204231f commit 299c1fe

File tree

1 file changed

+18
-0
lines changed
  • src/doc/rustc-dev-guide/src/tests

1 file changed

+18
-0
lines changed

src/doc/rustc-dev-guide/src/tests/misc.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,21 @@ fn main() {
3838
.run();
3939
}
4040
```
41+
42+
## `RUSTC_TEST_GIT_HASH` env var
43+
44+
> Context:
45+
>
46+
> - <https://github.com/rust-lang/rust/issues/132875>
47+
> - <https://github.com/rust-lang/rust/issues/132845>
48+
49+
`RUSTC_TEST_GIT_HASH` is a special env var used intentionally to bypass
50+
bootstrap to make sure that the built rustc and rustdoc binaries correctly
51+
report git hash information. We can't rely on information reported by bootstrap
52+
regarding git hash availability because the bootstrap logic itself can be wrong
53+
(see linked issues above).
54+
55+
- This env var must be set in CI.
56+
- To run `tests/run-make/version-verbose-commit-hash` locally, set
57+
`RUSTC_TEST_GIT_HASH` to any non-empty value. Otherwise, this test will be
58+
skipped.

0 commit comments

Comments
 (0)