From 59baa0901223417a8b77ab05676ceae152d366c2 Mon Sep 17 00:00:00 2001 From: Marcin Puc Date: Thu, 8 Feb 2024 15:31:23 +0100 Subject: [PATCH] rust: update to 1.76.0 --- ...dlib-and-musl_root-from-musl-targets.patch | 52 +++++++++++-------- ...ng-native-sysroot-to-use-for-linkage.patch | 24 ++++----- srcpkgs/rust/template | 10 ++-- 3 files changed, 47 insertions(+), 39 deletions(-) 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 7b7adf3a73f..fd039c031bf 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 @@ -61,10 +61,10 @@ index 53f710b8f..2a4eec15f 100644 new(&[ (LinkOutputKind::DynamicNoPicExe, &["crt2.o", "rsbegin.o"]), diff --git a/config.example.toml b/config.example.toml -index e5df28a49..31c682ab9 100644 +index a7d4df545..feaa0f861 100644 --- a/config.example.toml +++ b/config.example.toml -@@ -589,14 +589,6 @@ change-id = 116881 +@@ -586,14 +586,6 @@ # behavior -- this may lead to miscompilations or other bugs. #description = "" @@ -119,7 +119,7 @@ index 544a42d9a..8bd3fc755 100755 "riscv32gc-unknown-linux-musl install directory") v("musl-root-riscv64gc", "target.riscv64gc-unknown-linux-musl.musl-root", diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs -index 7021a9543..b314bbb8d 100644 +index df4d1a43d..b34309a27 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -307,39 +307,7 @@ fn copy_self_contained_objects( @@ -180,10 +180,10 @@ index 7021a9543..b314bbb8d 100644 if let Some(p) = builder.wasi_root(target) { let root = format!( diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs -index 0a9175aa3..029f32912 100644 +index f1e1b89d9..e706b9d65 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs -@@ -270,7 +270,6 @@ pub struct Config { +@@ -308,7 +308,6 @@ pub struct Config { pub missing_tools: bool, // Fallback musl-root for all targets @@ -191,7 +191,7 @@ index 0a9175aa3..029f32912 100644 pub prefix: Option, pub sysconfdir: Option, pub datadir: Option, -@@ -528,8 +527,6 @@ pub struct Target { +@@ -574,8 +573,6 @@ pub struct Target { pub profiler: Option, pub rpath: Option, pub crt_static: Option, @@ -200,15 +200,15 @@ index 0a9175aa3..029f32912 100644 pub wasi_root: Option, pub qemu_rootfs: Option, pub no_std: bool, -@@ -998,7 +995,6 @@ define_config! { +@@ -1080,7 +1077,6 @@ define_config! { default_linker: Option = "default-linker", channel: Option = "channel", description: Option = "description", - musl_root: Option = "musl-root", rpath: Option = "rpath", - verbose_tests: Option = "verbose-tests", - optimize_tests: Option = "optimize-tests", -@@ -1046,8 +1042,6 @@ define_config! { + strip: Option = "strip", + stack_protector: Option = "stack-protector", +@@ -1131,8 +1127,6 @@ define_config! { profiler: Option = "profiler", rpath: Option = "rpath", crt_static: Option = "crt-static", @@ -217,15 +217,23 @@ index 0a9175aa3..029f32912 100644 wasi_root: Option = "wasi-root", qemu_rootfs: Option = "qemu-rootfs", no_std: Option = "no-std", -@@ -1437,7 +1431,6 @@ impl Config { - .parallel_compiler - .unwrap_or(config.channel == "dev" || config.channel == "nightly"); - 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); +@@ -1532,7 +1526,6 @@ impl Config { + default_linker, + channel, + description, +- musl_root, + rpath, + verbose_tests, + optimize_tests, +@@ -1634,7 +1627,6 @@ impl Config { + config.rustc_parallel = + parallel_compiler.unwrap_or(config.channel == "dev" || config.channel == "nightly"); + config.rustc_default_linker = default_linker; +- config.musl_root = musl_root.map(PathBuf::from); + config.save_toolstates = save_toolstates.map(PathBuf::from); set( &mut config.deny_warnings, -@@ -1606,8 +1599,6 @@ impl Config { +@@ -1827,8 +1819,6 @@ impl Config { target.ranlib = cfg.ranlib.map(PathBuf::from); target.linker = cfg.linker.map(PathBuf::from); target.crt_static = cfg.crt_static; @@ -235,7 +243,7 @@ index 0a9175aa3..029f32912 100644 target.qemu_rootfs = cfg.qemu_rootfs.map(PathBuf::from); target.sanitizers = cfg.sanitizers; diff --git a/src/bootstrap/src/core/sanity.rs b/src/bootstrap/src/core/sanity.rs -index eec3be66a..a2d1cb5df 100644 +index 9101d94ea..df72d6f9a 100644 --- a/src/bootstrap/src/core/sanity.rs +++ b/src/bootstrap/src/core/sanity.rs @@ -11,7 +11,6 @@ @@ -272,14 +280,14 @@ index eec3be66a..a2d1cb5df 100644 - } - } - - if need_cmake && target.contains("msvc") { + if need_cmake && target.is_msvc() { // There are three builds of cmake on windows: MSVC, MinGW, and // Cygwin. The Cygwin build does not have generators for Visual diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs -index 33b8f1a7c..4ba88439b 100644 +index 871318de5..b3f1eff91 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs -@@ -1306,25 +1306,6 @@ impl Build { +@@ -1290,25 +1290,6 @@ impl Build { } } @@ -306,7 +314,7 @@ index 33b8f1a7c..4ba88439b 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/src/utils/cc_detect.rs b/src/bootstrap/src/utils/cc_detect.rs -index 52b36ce75..a67d05075 100644 +index fb5b9d8c8..c6c9368a0 100644 --- a/src/bootstrap/src/utils/cc_detect.rs +++ b/src/bootstrap/src/utils/cc_detect.rs @@ -201,30 +201,6 @@ fn default_compiler( diff --git a/srcpkgs/rust/patches/0013-allow-specifying-native-sysroot-to-use-for-linkage.patch b/srcpkgs/rust/patches/0013-allow-specifying-native-sysroot-to-use-for-linkage.patch index 0ed9659474f..37ca0845b69 100644 --- a/srcpkgs/rust/patches/0013-allow-specifying-native-sysroot-to-use-for-linkage.patch +++ b/srcpkgs/rust/patches/0013-allow-specifying-native-sysroot-to-use-for-linkage.patch @@ -7,25 +7,25 @@ This allows us to get around the linker attempting to use incompatible libs. diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs -index cd276674d..a67a0cbcc 100644 +index e18096443..b48742ae4 100644 --- a/src/bootstrap/src/core/builder.rs +++ b/src/bootstrap/src/core/builder.rs -@@ -1687,6 +1687,10 @@ impl<'a> Builder<'a> { - } +@@ -1706,6 +1706,10 @@ impl<'a> Builder<'a> { + hostflags.arg(&arg); } + if let Some(sysroot) = self.native_sysroot(target) { + rustflags.arg(&format!("-Clink-args=--sysroot={}", sysroot.display())); + } + - if let Some(host_linker) = self.linker(compiler.host) { - hostflags.arg(format!("-Clinker={}", host_linker.display())); - } + if let Some(target_linker) = self.linker(target) { + let target = crate::envify(&target.triple); + cargo.env(&format!("CARGO_TARGET_{target}_LINKER"), target_linker); diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs -index 0a9175aa3..d6f31b0cd 100644 +index f1e1b89d9..30e61161d 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs -@@ -524,6 +524,7 @@ pub struct Target { +@@ -570,6 +570,7 @@ pub struct Target { pub ranlib: Option, pub default_linker: Option, pub linker: Option, @@ -33,7 +33,7 @@ index 0a9175aa3..d6f31b0cd 100644 pub sanitizers: Option, pub profiler: Option, pub rpath: Option, -@@ -1038,6 +1039,7 @@ define_config! { +@@ -1123,6 +1124,7 @@ define_config! { ranlib: Option = "ranlib", default_linker: Option = "default-linker", linker: Option = "linker", @@ -41,7 +41,7 @@ index 0a9175aa3..d6f31b0cd 100644 llvm_config: Option = "llvm-config", llvm_has_rust_patches: Option = "llvm-has-rust-patches", llvm_filecheck: Option = "llvm-filecheck", -@@ -1605,6 +1607,7 @@ impl Config { +@@ -1826,6 +1828,7 @@ impl Config { target.ar = cfg.ar.map(PathBuf::from); target.ranlib = cfg.ranlib.map(PathBuf::from); target.linker = cfg.linker.map(PathBuf::from); @@ -50,10 +50,10 @@ index 0a9175aa3..d6f31b0cd 100644 target.musl_root = cfg.musl_root.map(PathBuf::from); target.musl_libdir = cfg.musl_libdir.map(PathBuf::from); diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs -index 33b8f1a7c..edfafa173 100644 +index 871318de5..96abbe721 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs -@@ -1305,6 +1305,10 @@ impl Build { +@@ -1289,6 +1289,10 @@ impl Build { self.config.target_config.get(&target).and_then(|t| t.crt_static) } } diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template index d33e713857a..2ce75af7b3a 100644 --- a/srcpkgs/rust/template +++ b/srcpkgs/rust/template @@ -8,17 +8,17 @@ # uploaded to https://repo-default.voidlinux.org/distfiles/ # pkgname=rust -version=1.75.0 -revision=2 +version=1.76.0 +revision=1 hostmakedepends="curl pkg-config python3 tar cargo-bootstrap" -makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm15" +makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm17-devel" depends="rust-std gcc" short_desc="Safe, concurrent, practical systems language" 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=5b739f45bc9d341e2d1c570d65d2375591e22c2d23ef5b8a37711a0386abc088 +checksum=9e5cff033a7f0d2266818982ad90e4d3e4ef8f8ee1715776c6e25073a136c021 lib32disabled=yes make_check=no # CBA for now python_version=3 # needed for python files in rust-src @@ -34,7 +34,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then fi if [ "$CROSS_BUILD" ]; then - hostmakedepends+=" rust llvm15" + hostmakedepends+=" rust llvm17-devel" # These are required for building the buildhost's stage0/1 hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel" else