Description
When building from released sources (https://static.rust-lang.org/dist/rustc-<version>-src.tar.xz
), the resulting rustc binary is missing detailed version information like commit hash and commit date.
Looking at the source it seems to only rely on git commands/paths to assemble this information (https://github.com/rust-lang/rust/blob/5a7834050f3a0ebcd117b4ddf0bc1e8459594309/src/bootstrap/channel.rs#L26-L36
), but it could also be obtained/parsed from rustc-<version>-src/version
when compiling from the released source files (and rustc-<version>-src/git-commit-hash
if the entire commit hash is required too).
As far as I know this affects all rust releases that are not obtained via rustup (i.e. packaged by distributions or built from scratch).
Sample output of rustc -vV
:
rustc 1.51.0
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-pc-windows-gnu
release: 1.51.0
LLVM version: 11.0.0