Skip to content

Commit 7596f3f

Browse files
committed
Update rust to version 1.85.0
A regression in the cc crate breaks src/bootstrap for non-standard targets like *-arachsys-linux-musl. Until this is fixed, patch the inappropriately hard-coded list of targets in the version of vendor/cc pinned by src/bootstrap.
1 parent 72ce302 commit 7596f3f

8 files changed

+97
-33
lines changed

rust/build

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ require python rust
22

33
check() {
44
url https://github.com/rust-lang/rust/tags
5-
match version 1.84.1 'tags/([0-9.]+)\.tar'
5+
match version 1.85.0 'tags/([0-9.]+)\.tar'
66
}
77

88
prepare() {
9-
unpack https://static.rust-lang.org/dist/rustc-1.84.1-src.tar.gz
9+
unpack https://static.rust-lang.org/dist/rustc-1.85.0-src.tar.gz
1010
apply curl.diff # must patch vendor/curl-sys-*
1111
apply home.diff # must patch vendor/home-*, tools/cargo/crates/home
1212
apply libexec.diff
1313
apply libressl.diff # must patch vendor/openssl{,-sys}-*
1414
apply system.diff
15-
apply target.diff
15+
apply target.diff # must patch vendor/cc-* used by src/bootstrap
1616
apply verify.diff
1717
apply version.diff
18-
tree 48494699ded02e5836bb80fccbfeb71a06d8676bd682348ab12229366d31247a
18+
tree e2d59e1a96a0575772da7b5532d107970eae4afecbebab3591fad1b303bccdea
1919
}
2020

2121
build() {

rust/curl.diff

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ index 7d9a661f..24bc69d6 100644
3030
// Next, fall back and try to use pkg-config if its available.
3131
if windows {
3232
if try_vcpkg() {
33-
diff --git a/vendor/curl-sys-0.4.77+curl-8.10.1/build.rs b/vendor/curl-sys-0.4.77+curl-8.10.1/build.rs
34-
index fa57dd9b..b6b5e504 100644
35-
--- a/vendor/curl-sys-0.4.77+curl-8.10.1/build.rs
36-
+++ b/vendor/curl-sys-0.4.77+curl-8.10.1/build.rs
33+
diff --git a/vendor/curl-sys-0.4.78+curl-8.11.0/build.rs b/vendor/curl-sys-0.4.78+curl-8.11.0/build.rs
34+
index a451b244..b751688f 100644
35+
--- a/vendor/curl-sys-0.4.78+curl-8.11.0/build.rs
36+
+++ b/vendor/curl-sys-0.4.78+curl-8.11.0/build.rs
3737
@@ -35,6 +35,11 @@ fn main() {
3838
return println!("cargo:rustc-flags=-l curl");
3939
}

rust/home.diff

+22
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,28 @@ index f5a6a223..fd08f524 100644
1616
}
1717
_ => home_dir_with_env(env)
1818
- .map(|d| d.join(".rustup"))
19+
+ .map(|d| d.join(".cache").join("rustup"))
20+
.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "could not find rustup home dir")),
21+
}
22+
}
23+
diff --git a/vendor/home-0.5.11/src/env.rs b/vendor/home-0.5.11/src/env.rs
24+
index f5a6a223..fd08f524 100644
25+
--- a/vendor/home-0.5.11/src/env.rs
26+
+++ b/vendor/home-0.5.11/src/env.rs
27+
@@ -75,7 +75,7 @@ pub fn cargo_home_with_cwd_env(env: &dyn Env, cwd: &Path) -> io::Result<PathBuf>
28+
}
29+
}
30+
_ => home_dir_with_env(env)
31+
- .map(|p| p.join(".cargo"))
32+
+ .map(|p| p.join(".cache").join("cargo"))
33+
.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "could not find cargo home dir")),
34+
}
35+
}
36+
@@ -108,7 +108,7 @@ pub fn rustup_home_with_cwd_env(env: &dyn Env, cwd: &Path) -> io::Result<PathBuf
37+
}
38+
}
39+
_ => home_dir_with_env(env)
40+
- .map(|d| d.join(".rustup"))
1941
+ .map(|d| d.join(".cache").join("rustup"))
2042
.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "could not find rustup home dir")),
2143
}

rust/libexec.diff

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
2-
index d7ae0299..5a8e6aff 100644
2+
index 535bdecb..3dff90bd 100644
33
--- a/src/bootstrap/bootstrap.py
44
+++ b/src/bootstrap/bootstrap.py
5-
@@ -639,7 +639,7 @@ class RustBuild(object):
6-
5+
@@ -705,7 +705,7 @@ class RustBuild(object):
76
self.fix_bin_or_dylib("{}/bin/rustc".format(bin_root))
87
self.fix_bin_or_dylib("{}/bin/rustdoc".format(bin_root))
9-
- self.fix_bin_or_dylib("{}/libexec/rust-analyzer-proc-macro-srv".format(bin_root))
10-
+ self.fix_bin_or_dylib("{}/bin/rust-analyzer-proc-macro-srv".format(bin_root))
8+
self.fix_bin_or_dylib(
9+
- "{}/libexec/rust-analyzer-proc-macro-srv".format(bin_root)
10+
+ "{}/bin/rust-analyzer-proc-macro-srv".format(bin_root)
11+
)
1112
lib_dir = "{}/lib".format(bin_root)
1213
rustlib_bin_dir = "{}/rustlib/{}/bin".format(lib_dir, self.build)
13-
self.fix_bin_or_dylib("{}/rust-lld".format(rustlib_bin_dir))
1414
diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
15-
index 0cb89716..6fd3f913 100644
15+
index 34e6a1e1..94d2db62 100644
1616
--- a/src/bootstrap/src/core/build_steps/dist.rs
1717
+++ b/src/bootstrap/src/core/build_steps/dist.rs
1818
@@ -427,7 +427,7 @@ impl Step for Rustc {
@@ -25,10 +25,10 @@ index 0cb89716..6fd3f913 100644
2525

2626
let libdir_relative = builder.libdir_relative(compiler);
2727
diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs
28-
index 3cfbef27..3820558b 100644
28+
index 9ae03ac7..342de5e8 100644
2929
--- a/src/bootstrap/src/core/build_steps/tool.rs
3030
+++ b/src/bootstrap/src/core/build_steps/tool.rs
31-
@@ -834,7 +834,7 @@ impl Step for RustAnalyzerProcMacroSrv {
31+
@@ -864,7 +864,7 @@ impl Step for RustAnalyzerProcMacroSrv {
3232

3333
// Copy `rust-analyzer-proc-macro-srv` to `<sysroot>/libexec/`
3434
// so that r-a can use it.
@@ -38,10 +38,10 @@ index 3cfbef27..3820558b 100644
3838
builder.copy_link(&path, &libexec_path.join("rust-analyzer-proc-macro-srv"));
3939

4040
diff --git a/src/bootstrap/src/core/download.rs b/src/bootstrap/src/core/download.rs
41-
index db1f5b08..38a52433 100644
41+
index b5f7ed53..602d3fc0 100644
4242
--- a/src/bootstrap/src/core/download.rs
4343
+++ b/src/bootstrap/src/core/download.rs
44-
@@ -592,7 +592,7 @@ impl Config {
44+
@@ -590,7 +590,7 @@ impl Config {
4545
self.fix_bin_or_dylib(&bin_root.join("bin").join("rustc"));
4646
self.fix_bin_or_dylib(&bin_root.join("bin").join("rustdoc"));
4747
self.fix_bin_or_dylib(
@@ -51,10 +51,10 @@ index db1f5b08..38a52433 100644
5151
let lib_dir = bin_root.join("lib");
5252
for lib in t!(fs::read_dir(&lib_dir), lib_dir.display().to_string()) {
5353
diff --git a/src/tools/rust-analyzer/crates/project-model/src/sysroot.rs b/src/tools/rust-analyzer/crates/project-model/src/sysroot.rs
54-
index 19f4c35b..4b0f73d9 100644
54+
index 8426e689..b0b7846e 100644
5555
--- a/src/tools/rust-analyzer/crates/project-model/src/sysroot.rs
5656
+++ b/src/tools/rust-analyzer/crates/project-model/src/sysroot.rs
57-
@@ -176,7 +176,7 @@ impl Sysroot {
57+
@@ -192,7 +192,7 @@ impl Sysroot {
5858
let Some(root) = self.root() else {
5959
return Err(anyhow::format_err!("no sysroot",));
6060
};

rust/system.diff

+7-7
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ index e3b6430a..482ea807 100644
7070
new(&[
7171
(LinkOutputKind::DynamicNoPicExe, &["crtend.o", "crtn.o"]),
7272
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
73-
index 8e088682..7876a2c1 100644
73+
index eeb5b18f..c2f78817 100644
7474
--- a/src/bootstrap/src/core/build_steps/compile.rs
7575
+++ b/src/bootstrap/src/core/build_steps/compile.rs
76-
@@ -351,40 +351,7 @@ fn copy_self_contained_objects(
76+
@@ -330,40 +330,7 @@ fn copy_self_contained_objects(
7777
t!(fs::create_dir_all(&libdir_self_contained));
7878
let mut target_deps = vec![];
7979

@@ -116,7 +116,7 @@ index 8e088682..7876a2c1 100644
116116
panic!(
117117
"Target {:?} does not have a \"wasi-root\" key in Config.toml \
118118
diff --git a/src/bootstrap/src/core/sanity.rs b/src/bootstrap/src/core/sanity.rs
119-
index fabb4f2b..72466683 100644
119+
index ed015562..9873a6c0 100644
120120
--- a/src/bootstrap/src/core/sanity.rs
121121
+++ b/src/bootstrap/src/core/sanity.rs
122122
@@ -11,7 +11,7 @@
@@ -127,8 +127,8 @@ index fabb4f2b..72466683 100644
127127
+use std::env;
128128

129129
use crate::Build;
130-
#[cfg(not(feature = "bootstrap-self-test"))]
131-
@@ -326,28 +326,6 @@ than building it.
130+
#[cfg(not(test))]
131+
@@ -321,28 +321,6 @@ than building it.
132132
continue;
133133
}
134134

@@ -158,10 +158,10 @@ index fabb4f2b..72466683 100644
158158
// There are three builds of cmake on windows: MSVC, MinGW, and
159159
// Cygwin. The Cygwin build does not have generators for Visual
160160
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
161-
index c384fd6b..be66c972 100644
161+
index ccc115a2..4df0773c 100644
162162
--- a/src/bootstrap/src/lib.rs
163163
+++ b/src/bootstrap/src/lib.rs
164-
@@ -179,6 +179,7 @@ pub struct Build {
164+
@@ -181,6 +181,7 @@ pub struct Build {
165165
metrics: crate::utils::metrics::BuildMetrics,
166166
}
167167

rust/target.diff

+44-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
2-
index 321ab404..5e8bac11 100644
2+
index 02962d55..d857b0a4 100644
33
--- a/compiler/rustc_target/src/spec/mod.rs
44
+++ b/compiler/rustc_target/src/spec/mod.rs
5-
@@ -1619,6 +1619,9 @@ macro_rules! supported_targets {
5+
@@ -1649,6 +1649,9 @@ macro_rules! supported_targets {
66
}
77

88
supported_targets! {
@@ -44,3 +44,45 @@ index 00000000..5e08e5fd
4444
+ base.options.static_position_independent_executables = true;
4545
+ base
4646
+}
47+
diff --git a/vendor/cc-1.2.0/src/target/generated.rs b/vendor/cc-1.2.0/src/target/generated.rs
48+
index 0c9b0ae1..23d18039 100644
49+
--- a/vendor/cc-1.2.0/src/target/generated.rs
50+
+++ b/vendor/cc-1.2.0/src/target/generated.rs
51+
@@ -124,6 +124,18 @@ pub(crate) const LIST: &[(&str, TargetInfo<'static>)] = &[
52+
unversioned_llvm_target: "arm64-apple-watchos-simulator",
53+
},
54+
),
55+
+ (
56+
+ "aarch64-arachsys-linux-musl",
57+
+ TargetInfo {
58+
+ full_arch: "aarch64",
59+
+ arch: "aarch64",
60+
+ vendor: "arachsys",
61+
+ os: "linux",
62+
+ env: "musl",
63+
+ abi: "",
64+
+ unversioned_llvm_target: "aarch64-arachsys-linux-musl",
65+
+ },
66+
+ ),
67+
(
68+
"aarch64-fuchsia",
69+
TargetInfo {
70+
@@ -2848,6 +2860,18 @@ pub(crate) const LIST: &[(&str, TargetInfo<'static>)] = &[
71+
unversioned_llvm_target: "x86_64-apple-watchos-simulator",
72+
},
73+
),
74+
+ (
75+
+ "x86_64-arachsys-linux-musl",
76+
+ TargetInfo {
77+
+ full_arch: "x86_64",
78+
+ arch: "x86_64",
79+
+ vendor: "arachsys",
80+
+ os: "linux",
81+
+ env: "musl",
82+
+ abi: "",
83+
+ unversioned_llvm_target: "x86_64-arachsys-linux-musl",
84+
+ },
85+
+ ),
86+
(
87+
"x86_64-fortanix-unknown-sgx",
88+
TargetInfo {

rust/verify.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/src/tools/cargo/src/cargo/sources/directory.rs b/src/tools/cargo/src/cargo/sources/directory.rs
2-
index 6fff8ed2..a21555b3 100644
2+
index 6f676a79..14a46d01 100644
33
--- a/src/tools/cargo/src/cargo/sources/directory.rs
44
+++ b/src/tools/cargo/src/cargo/sources/directory.rs
55
@@ -1,4 +1,5 @@

rust/version.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
2-
index be66c972..76ec2670 100644
2+
index 4df0773c..85443e99 100644
33
--- a/src/bootstrap/src/lib.rs
44
+++ b/src/bootstrap/src/lib.rs
5-
@@ -377,7 +377,7 @@ impl Build {
5+
@@ -352,7 +352,7 @@ impl Build {
66
}
77

88
if rust_info.is_from_tarball() && config.description.is_none() {

0 commit comments

Comments
 (0)