about summary refs log tree commit diff
path: root/compiler/rustc_plugin_impl/src
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 /compiler/rustc_plugin_impl/src
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 'compiler/rustc_plugin_impl/src')
0 files changed, 0 insertions, 0 deletions