-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x.py: allow a custom string appended to the version #79115
Conversation
This adds `rust.description` to the config as 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. For example, in Fedora 33, `gcc --version` outputs: gcc (GCC) 10.2.1 20201016 (Red Hat 10.2.1-6) With this change, we can add similar vendor info to `rustc --version`.
(rust_highfive has picked a reviewer for you, use r? to override) |
I would like to briefly run this by @rust-lang/release in case there's any concerns, but otherwise this seems good to me from an implementation perspective. |
I support this! It will be really useful for toolchain vendors to identify if an issue is coming from their build and whether a binary/bugreport is coming from their toolchain or not. |
While I'd love to see something like this added to the compiler, there are two questions I have:
|
There's already a difference in whether git info is present, e.g. rustup's Tools that parse should use
IMO we should let it be freeform, and don't offer any expectation of parsing meaning from this. If we wanted to add verbose fields for structured vendor specifics, that's possible, but ISTR it has been a problem for version-parsing crates to change/add fields. |
@bors r+ I figure we can iterate if needed. |
📌 Commit 5f08568 has been approved by |
…mulacrum x.py: allow a custom string appended to the version This adds `rust.description` to the config as 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. For example, in Fedora 33, `gcc --version` outputs: gcc (GCC) 10.2.1 20201016 (Red Hat 10.2.1-6) With this change, we can add similar vendor info to `rustc --version`.
⌛ Testing commit 5f08568 with merge b5d6b6e202853e4b132cb605bafae8fede3dc911... |
💔 Test failed - checks-actions |
@bors retry |
☀️ Test successful - checks-actions |
The plain `rustc --version` string is not well structured, and in particular the git commit info is not necessarily present when rustc was built out of tree, like distro builds. Furthermore, rust-lang/rust#79115 made it possible to have completely custom information in that version's parenthesized block, which may not look like git info at all. Adding `--verbose` outputs each field on its own line, in particular "release: ..." for the version number and "commit-date: ..." for the git info, although the latter is just "unknown" for out-of-tree builds. This still works all the way back to Rust 1.0.0.
The plain `rustc --version` string is not well structured, and in particular the git commit info is not necessarily present when rustc was built out of tree, like distro builds. Furthermore, rust-lang/rust#79115 made it possible to have completely custom information in that version's parenthesized block, which may not look like git info at all. Adding `--verbose` outputs each field on its own line, in particular "release: ..." for the version number and "commit-date: ..." for the git info, although the latter is just "unknown" for out-of-tree builds. This still works all the way back to Rust 1.0.0.
The plain `rustc --version` string is not well structured, and in particular the git commit info is not necessarily present when rustc was built out of tree, like distro builds. Furthermore, rust-lang/rust#79115 made it possible to have completely custom information in that version's parenthesized block, which may not look like git info at all. Adding `--verbose` outputs each field on its own line, in particular "release: ..." for the version number and "commit-date: ..." for the git info, although the latter is just "unknown" for out-of-tree builds. This still works all the way back to Rust 1.0.0.
The plain `rustc --version` string is not well structured, and in particular the git commit info is not necessarily present when rustc was built out of tree, like distro builds. Furthermore, rust-lang/rust#79115 made it possible to have completely custom information in that version's parenthesized block, which may not look like git info at all. Adding `--verbose` outputs each field on its own line, in particular "release: ..." for the version number and "commit-date: ..." for the git info, although the latter is just "unknown" for out-of-tree builds. This still works all the way back to Rust 1.0.0.
The plain `rustc --version` string is not well structured, and in particular the git commit info is not necessarily present when rustc is built out of tree, such as in distro builds. Furthermore, rust-lang/rust#79115 made it possible to have completely custom information in a version's parenthesized block, which may not look like git info at all. Adding `--verbose` outputs each field on its own line, in particular "release: ..." for the version number and "commit-date: ..." for the git info, although the latter is just "unknown" for out-of-tree builds. MSRV remains 1.0.0.
This adds
rust.description
to the config as a descriptive string to beappended to
rustc --version
output, which is also used in places likedebuginfo
DW_AT_producer
. This may be useful for supplementary buildinformation, like distro-specific package versions.
For example, in Fedora 33,
gcc --version
outputs:With this change, we can add similar vendor info to
rustc --version
.