From af6590fab1aa4ed378b4f9ba941740c3576535ee Mon Sep 17 00:00:00 2001 From: Marcin Puc Date: Fri, 14 Jul 2023 14:16:35 +0200 Subject: [PATCH] rust: update to 1.71.0 --- ...dlib-and-musl_root-from-musl-targets.patch | 46 +++++++++---------- srcpkgs/rust/patches/0015-fix-lint-doc.patch | 45 ++++++++++++++++++ srcpkgs/rust/template | 4 +- 3 files changed, 70 insertions(+), 25 deletions(-) create mode 100644 srcpkgs/rust/patches/0015-fix-lint-doc.patch diff --git a/srcpkgs/rust/patches/0002-Remove-nostdlib-and-musl_root-from-musl-targets.patch b/srcpkgs/rust/patches/0002-Remove-nostdlib-and-musl_root-from-musl-targets.patch index 07c24412f6d..ef3154a84cd 100644 --- a/srcpkgs/rust/patches/0002-Remove-nostdlib-and-musl_root-from-musl-targets.patch +++ b/srcpkgs/rust/patches/0002-Remove-nostdlib-and-musl_root-from-musl-targets.patch @@ -60,7 +60,7 @@ index 61553e71b..88f807a58 100644 base } diff --git a/config.example.toml b/config.example.toml -index 6d9c762ce..7a1375d8a 100644 +index d0eaa9fd7..b92f9488e 100644 --- a/config.example.toml +++ b/config.example.toml @@ -556,14 +556,6 @@ changelog-seen = 2 @@ -136,10 +136,10 @@ index 65c882fb8..f35a92821 100644 } } diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs -index 4a4e7adcb..f2cdc4a07 100644 +index 33addb90d..fb6c97d82 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs -@@ -246,39 +246,7 @@ fn copy_self_contained_objects( +@@ -237,39 +237,7 @@ fn copy_self_contained_objects( let mut target_deps = vec![]; // Copies the libc and CRT objects. @@ -180,9 +180,9 @@ index 4a4e7adcb..f2cdc4a07 100644 let srcdir = builder .wasi_root(target) .unwrap_or_else(|| { -@@ -375,15 +343,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car +@@ -366,15 +334,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car .arg("--manifest-path") - .arg(builder.src.join("library/test/Cargo.toml")); + .arg(builder.src.join("library/sysroot/Cargo.toml")); - // Help the libc crate compile by assisting it in finding various - // sysroot native libraries. @@ -197,10 +197,10 @@ index 4a4e7adcb..f2cdc4a07 100644 if let Some(p) = builder.wasi_root(target) { let root = format!("native={}/lib/wasm32-wasi", p.to_str().unwrap()); diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs -index cc3b3bc25..eb472c5e8 100644 +index e192cda9a..a7c39c40e 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs -@@ -210,7 +210,6 @@ pub struct Config { +@@ -211,7 +211,6 @@ pub struct Config { pub missing_tools: bool, // Fallback musl-root for all targets @@ -208,16 +208,16 @@ index cc3b3bc25..eb472c5e8 100644 pub prefix: Option, pub sysconfdir: Option, pub datadir: Option, -@@ -456,8 +455,6 @@ pub struct Target { - pub sanitizers: Option, +@@ -470,8 +469,6 @@ pub struct Target { pub profiler: Option, + pub rpath: Option, pub crt_static: Option, - pub musl_root: Option, - pub musl_libdir: Option, pub wasi_root: Option, pub qemu_rootfs: Option, pub no_std: bool, -@@ -753,7 +750,6 @@ define_config! { +@@ -834,7 +831,6 @@ define_config! { default_linker: Option = "default-linker", channel: Option = "channel", description: Option = "description", @@ -225,24 +225,24 @@ index cc3b3bc25..eb472c5e8 100644 rpath: Option = "rpath", verbose_tests: Option = "verbose-tests", optimize_tests: Option = "optimize-tests", -@@ -801,8 +797,6 @@ define_config! { - sanitizers: Option = "sanitizers", +@@ -883,8 +879,6 @@ define_config! { profiler: Option = "profiler", + rpath: Option = "rpath", crt_static: Option = "crt-static", - musl_root: Option = "musl-root", - musl_libdir: Option = "musl-libdir", wasi_root: Option = "wasi-root", qemu_rootfs: Option = "qemu-rootfs", no_std: Option = "no-std", -@@ -1133,7 +1127,6 @@ impl Config { +@@ -1247,7 +1241,6 @@ impl Config { set(&mut config.llvm_tools_enabled, rust.llvm_tools); config.rustc_parallel = rust.parallel_compiler.unwrap_or(false); config.rustc_default_linker = rust.default_linker; - config.musl_root = rust.musl_root.map(PathBuf::from); config.save_toolstates = rust.save_toolstates.map(PathBuf::from); - set(&mut config.deny_warnings, flags.deny_warnings.or(rust.deny_warnings)); - set(&mut config.backtrace_on_ice, rust.backtrace_on_ice); -@@ -1293,8 +1286,6 @@ impl Config { + set( + &mut config.deny_warnings, +@@ -1414,8 +1407,6 @@ impl Config { target.ranlib = cfg.ranlib.map(PathBuf::from); target.linker = cfg.linker.map(PathBuf::from); target.crt_static = cfg.crt_static; @@ -252,7 +252,7 @@ index cc3b3bc25..eb472c5e8 100644 target.qemu_rootfs = cfg.qemu_rootfs.map(PathBuf::from); target.sanitizers = cfg.sanitizers; diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py -index abd28b400..6f0f8d879 100755 +index 571062a3a..a6fe35975 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -111,34 +111,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk", @@ -287,14 +287,14 @@ index abd28b400..6f0f8d879 100755 - "mips64-unknown-linux-muslabi64 install directory") -v("musl-root-mips64el", "target.mips64el-unknown-linux-muslabi64.musl-root", - "mips64el-unknown-linux-muslabi64 install directory") - v("qemu-armhf-rootfs", "target.arm-unknown-linux-gnueabihf.qemu-rootfs", - "rootfs in qemu testing, you probably don't want to use this") - v("qemu-aarch64-rootfs", "target.aarch64-unknown-linux-gnu.qemu-rootfs", + v("musl-root-riscv32gc", "target.riscv32gc-unknown-linux-musl.musl-root", + "riscv32gc-unknown-linux-musl install directory") + v("musl-root-riscv64gc", "target.riscv64gc-unknown-linux-musl.musl-root", diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs -index 419bcbc63..dc98f5197 100644 +index 943f51341..688e64296 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs -@@ -1139,25 +1139,6 @@ impl Build { +@@ -1219,25 +1219,6 @@ impl Build { } } @@ -321,7 +321,7 @@ index 419bcbc63..dc98f5197 100644 fn wasi_root(&self, target: TargetSelection) -> Option<&Path> { self.config.target_config.get(&target).and_then(|t| t.wasi_root.as_ref()).map(|p| &**p) diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs -index 8a40b0f64..59e11d304 100644 +index 140259b02..24bfb6019 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -11,7 +11,6 @@ diff --git a/srcpkgs/rust/patches/0015-fix-lint-doc.patch b/srcpkgs/rust/patches/0015-fix-lint-doc.patch new file mode 100644 index 00000000000..e36e1727536 --- /dev/null +++ b/srcpkgs/rust/patches/0015-fix-lint-doc.patch @@ -0,0 +1,45 @@ +From 67b5990472e3cac643d8cf90f45fe42201ddec3c Mon Sep 17 00:00:00 2001 +From: jyn +Date: Mon, 10 Jul 2023 15:59:30 -0500 +Subject: [PATCH] Revert "Fix `x test lint-docs` when download-rustc is + enabled" + +This was not the correct fix. The problem was two-fold: +- `download-rustc` didn't respect `llvm.assertions` +- `rust-dev` was missing a bump to `download-ci-llvm-stamp` + +The first is fixed in this PR and the latter was fixed a while ago. Revert this change to avoid breaking `rpath = false`. +--- + src/tools/lint-docs/src/groups.rs | 1 - + src/tools/lint-docs/src/lib.rs | 6 ------ + 2 files changed, 7 deletions(-) + +diff --git a/src/tools/lint-docs/src/groups.rs b/src/tools/lint-docs/src/groups.rs +index b11fb287cf4dd..5be8ef7996bb2 100644 +--- a/src/tools/lint-docs/src/groups.rs ++++ b/src/tools/lint-docs/src/groups.rs +@@ -39,7 +39,6 @@ impl<'a> LintExtractor<'a> { + fn collect_groups(&self) -> Result> { + let mut result = BTreeMap::new(); + let mut cmd = Command::new(self.rustc_path); +- cmd.env_remove("LD_LIBRARY_PATH"); + cmd.arg("-Whelp"); + let output = cmd.output().map_err(|e| format!("failed to run command {:?}\n{}", cmd, e))?; + if !output.status.success() { +diff --git a/src/tools/lint-docs/src/lib.rs b/src/tools/lint-docs/src/lib.rs +index fe29b9abda39a..b7c8b9ed2e318 100644 +--- a/src/tools/lint-docs/src/lib.rs ++++ b/src/tools/lint-docs/src/lib.rs +@@ -403,12 +403,6 @@ impl<'a> LintExtractor<'a> { + fs::write(&tempfile, source) + .map_err(|e| format!("failed to write {}: {}", tempfile.display(), e))?; + let mut cmd = Command::new(self.rustc_path); +- // NOTE: bootstrap sets `LD_LIBRARY_PATH` for building lint-docs itself. +- // Unfortunately, lint-docs is a bootstrap tool while rustc is built from source, +- // and sometimes the paths conflict. In particular, when using `download-rustc`, +- // the LLVM versions can differ between `ci-llvm` and `ci-rustc-sysroot`. +- // Unset LD_LIBRARY_PATH here so it doesn't interfere with running the compiler. +- cmd.env_remove("LD_LIBRARY_PATH"); + if options.contains(&"edition2015") { + cmd.arg("--edition=2015"); + } else { diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template index 523f2ccfe58..3331675ac25 100644 --- a/srcpkgs/rust/template +++ b/srcpkgs/rust/template @@ -8,7 +8,7 @@ # uploaded to https://repo-default.voidlinux.org/distfiles/ # pkgname=rust -version=1.70.0 +version=1.71.0 revision=1 hostmakedepends="cmake curl pkg-config python3 tar cargo-bootstrap" makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm15" @@ -18,7 +18,7 @@ maintainer="Enno Boland " license="MIT, Apache-2.0" homepage="https://www.rust-lang.org/" distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz" -checksum=b2bfae000b7a5040e4ec4bbc50a09f21548190cb7570b0ed77358368413bd27c +checksum=a667e4abdc5588ebfea35c381e319d840ffbf8d2dbfb79771730573642034c96 lib32disabled=yes make_check=no # CBA for now python_version=3 # needed for python files in rust-src