about summary refs log tree commit diff
path: root/config.toml.example
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-02 20:55:17 +0000
committerbors <bors@rust-lang.org>2022-10-02 20:55:17 +0000
commitde692f1fae957fcfb0efb46db044a61261169963 (patch)
tree923168bceeeda6cb7548cdf5f456ae83092b537f /config.toml.example
parenta8a847e30d206f5ff913c5286f92bce427f0f7f3 (diff)
parentfdb39551ddfb431ee1edb61731a68927a06649f7 (diff)
downloadrust-de692f1fae957fcfb0efb46db044a61261169963.tar.gz
rust-de692f1fae957fcfb0efb46db044a61261169963.zip
Auto merge of #100557 - dawnofmidnight:tarball-commit-info, r=Mark-Simulacrum
fix: use git-commit-info for version information

Fixes #33286.
Fixes #86587.

This PR changes the current `git-commit-hash` file that `./x.py` dist puts in the `rustc-{version}-src.tar.{x,g}z` to contain the hash, the short hash, and the commit date from which the tarball was created, assuming git was available when it was. It uses this for reading the version so that rustc has all the appropriate metadata.

# Testing

Testing this is kind of a pain. I did it with something like
```sh
./x.py dist # ensure that `ignore-git` is `false` in config.toml
cp ./build/dist/rustc-1.65.0-dev-src.tar.gz ../rustc-1.65.0-dev-src.tar.gz
cd .. && tar -xzf rustc-1.65.0-dev-src && cd rustc-1.65.0-dev-src
./x.py build
```

Then, the output of  `rustc -vV` with the stage1 compiler should have the `commit-hash` and `commit-date` fields filled, rather than be `unknown`. To be completely sure, you can use `rustc --sysroot` with the stdlib that the original `./x.py dist` made, which will require that the metadata matches.
Diffstat (limited to 'config.toml.example')
-rw-r--r--config.toml.example6
1 files changed, 6 insertions, 0 deletions
diff --git a/config.toml.example b/config.toml.example
index ff08dfc553d..1f5747456e9 100644
--- a/config.toml.example
+++ b/config.toml.example
@@ -525,6 +525,12 @@ changelog-seen = 2
 # A descriptive string to be appended to `rustc --version` output, which is
 # also used in places like debuginfo `DW_AT_producer`. This may be useful for
 # supplementary build information, like distro-specific package versions.
+#
+# The Rust compiler will differentiate between versions of itself, including
+# based on this string, which means that if you wish to be compatible with
+# upstream Rust you need to set this to "". However, note that if you are not
+# actually compatible -- for example if you've backported patches that change
+# behavior -- this may lead to miscompilations or other bugs.
 #description = <none> (string)
 
 # The root location of the musl installation directory. The library directory