Skip to content

Commit

Permalink
Unrolled build for rust-lang#130900
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#130900 - capickett:empty-description-rust-version, r=albertlarsan68

Do not output () on empty description

When passing an explicitly empty description string, as explained here /~https://github.com/rust-lang/rust/blob/master/config.example.toml#L611-L613, my expectation is that the resulting rustc will be compatible with upstream.

However, it seems that instead, a `()` is added to the end of the version string, causing the version compatibility check to fail. My proposed fix here would be to instead only print `({description})` if `description` is a non-empty string.
  • Loading branch information
rust-timer authored Oct 14, 2024
2 parents 27861c4 + d3ea0e4 commit 02706db
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1575,9 +1575,11 @@ Executed at: {executed_at}"#,
fn rust_version(&self) -> String {
let mut version = self.rust_info().version(self, &self.version);
if let Some(ref s) = self.config.description {
version.push_str(" (");
version.push_str(s);
version.push(')');
if !s.is_empty() {
version.push_str(" (");
version.push_str(s);
version.push(')');
}
}
version
}
Expand Down

0 comments on commit 02706db

Please sign in to comment.