Rollup merge of #114440 - kaniini:fix/bootstrap-version-compare, r=ozkanonur

bootstrap: config: fix version comparison bug

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.
This commit is contained in:
Matthias Krüger 2023-08-04 09:19:00 +02:00 committed by GitHub
commit 50f47d907d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2004,7 +2004,8 @@ pub fn check_build_rustc_version(&self, rustc_path: &str) {
.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!(