Revert "Rollup merge of #111538 - chenyukang:yukang-fix-110067-version-issue, r=jyn514"
This reverts commit9267843e72
, reversing changes made toe52fbff5e8
. This breaks our ability to bump the src/version where we're bootstrapping with an older compiler than usual (according to version number). It's not clear whether the intended use case has a clean solution given this constraint, so reverting for now - we can reland with a fix of some kind implemented.
This commit is contained in:
parent
78acd5df8e
commit
0809338a13
@ -58,7 +58,6 @@ dependencies = [
|
|||||||
"once_cell",
|
"once_cell",
|
||||||
"opener",
|
"opener",
|
||||||
"pretty_assertions",
|
"pretty_assertions",
|
||||||
"semver",
|
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@ -646,12 +645,6 @@ version = "1.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "semver"
|
|
||||||
version = "1.0.17"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.160"
|
version = "1.0.160"
|
||||||
|
@ -57,7 +57,6 @@ walkdir = "2"
|
|||||||
sysinfo = { version = "0.26.0", optional = true }
|
sysinfo = { version = "0.26.0", optional = true }
|
||||||
clap = { version = "4.2.4", default-features = false, features = ["std", "usage", "help", "derive", "error-context"] }
|
clap = { version = "4.2.4", default-features = false, features = ["std", "usage", "help", "derive", "error-context"] }
|
||||||
clap_complete = "4.2.2"
|
clap_complete = "4.2.2"
|
||||||
semver = "1.0.17"
|
|
||||||
|
|
||||||
# Solaris doesn't support flock() and thus fd-lock is not option now
|
# Solaris doesn't support flock() and thus fd-lock is not option now
|
||||||
[target.'cfg(not(target_os = "solaris"))'.dependencies]
|
[target.'cfg(not(target_os = "solaris"))'.dependencies]
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
use crate::flags::{Color, Flags, Warnings};
|
use crate::flags::{Color, Flags, Warnings};
|
||||||
use crate::util::{exe, output, t};
|
use crate::util::{exe, output, t};
|
||||||
use once_cell::sync::OnceCell;
|
use once_cell::sync::OnceCell;
|
||||||
use semver::Version;
|
|
||||||
use serde::{Deserialize, Deserializer};
|
use serde::{Deserialize, Deserializer};
|
||||||
use serde_derive::Deserialize;
|
use serde_derive::Deserialize;
|
||||||
|
|
||||||
@ -1118,7 +1117,6 @@ fn get_table(option: &str) -> Result<TomlConfig, toml::de::Error> {
|
|||||||
config.download_beta_toolchain();
|
config.download_beta_toolchain();
|
||||||
config.out.join(config.build.triple).join("stage0/bin/rustc")
|
config.out.join(config.build.triple).join("stage0/bin/rustc")
|
||||||
});
|
});
|
||||||
|
|
||||||
config.initial_cargo = build
|
config.initial_cargo = build
|
||||||
.cargo
|
.cargo
|
||||||
.map(|cargo| {
|
.map(|cargo| {
|
||||||
@ -1780,42 +1778,6 @@ pub fn default_codegen_backend(&self) -> Option<Interned<String>> {
|
|||||||
self.rust_codegen_backends.get(0).cloned()
|
self.rust_codegen_backends.get(0).cloned()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn check_build_rustc_version(&self) {
|
|
||||||
if self.dry_run() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check rustc version is same or lower with 1 apart from the building one
|
|
||||||
let mut cmd = Command::new(&self.initial_rustc);
|
|
||||||
cmd.arg("--version");
|
|
||||||
let rustc_output = output(&mut cmd)
|
|
||||||
.lines()
|
|
||||||
.next()
|
|
||||||
.unwrap()
|
|
||||||
.split(' ')
|
|
||||||
.nth(1)
|
|
||||||
.unwrap()
|
|
||||||
.split('-')
|
|
||||||
.next()
|
|
||||||
.unwrap()
|
|
||||||
.to_owned();
|
|
||||||
let rustc_version = Version::parse(&rustc_output.trim()).unwrap();
|
|
||||||
let source_version =
|
|
||||||
Version::parse(&fs::read_to_string(self.src.join("src/version")).unwrap().trim())
|
|
||||||
.unwrap();
|
|
||||||
if !(source_version == rustc_version
|
|
||||||
|| (source_version.major == rustc_version.major
|
|
||||||
&& source_version.minor == rustc_version.minor + 1))
|
|
||||||
{
|
|
||||||
let prev_version = format!("{}.{}.x", source_version.major, source_version.minor - 1);
|
|
||||||
eprintln!(
|
|
||||||
"Unexpected rustc version: {}, we should use {}/{} to build source with {}",
|
|
||||||
rustc_version, prev_version, source_version, source_version
|
|
||||||
);
|
|
||||||
crate::detail_exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns the commit to download, or `None` if we shouldn't download CI artifacts.
|
/// Returns the commit to download, or `None` if we shouldn't download CI artifacts.
|
||||||
fn download_ci_rustc_commit(&self, download_rustc: Option<StringOrBool>) -> Option<String> {
|
fn download_ci_rustc_commit(&self, download_rustc: Option<StringOrBool>) -> Option<String> {
|
||||||
// If `download-rustc` is not set, default to rebuilding.
|
// If `download-rustc` is not set, default to rebuilding.
|
||||||
|
@ -414,7 +414,6 @@ pub fn new(mut config: Config) -> Build {
|
|||||||
bootstrap_out.display()
|
bootstrap_out.display()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
config.check_build_rustc_version();
|
|
||||||
|
|
||||||
if rust_info.is_from_tarball() && config.description.is_none() {
|
if rust_info.is_from_tarball() && config.description.is_none() {
|
||||||
config.description = Some("built from a source tarball".to_owned());
|
config.description = Some("built from a source tarball".to_owned());
|
||||||
|
Loading…
Reference in New Issue
Block a user