Skip to content

Commit

Permalink
bootstrap: config: fix version comparison bug
Browse files Browse the repository at this point in the history
Rust requires a previous version of Rust to build, such as the current version, or the
previous version.  However, the version comparison logic did not take patch releases
into consideration when doing the version comparison for the current branch, e.g.
Rust 1.71.1 could not be built by Rust 1.71.0 because it is neither an exact version
match, or the previous version.

Adjust the version comparison logic to tolerate mismatches in the patch version.

Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
  • Loading branch information
kaniini committed Aug 3, 2023
1 parent defed62 commit 31a81a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,8 @@ impl Config {
.unwrap();
if !(source_version == rustc_version
|| (source_version.major == rustc_version.major
&& source_version.minor == rustc_version.minor + 1))
&& (source_version.minor == rustc_version.minor
|| source_version.minor == rustc_version.minor + 1)))
{
let prev_version = format!("{}.{}.x", source_version.major, source_version.minor - 1);
eprintln!(
Expand Down

0 comments on commit 31a81a0

Please sign in to comment.