From 110c64aedcb15de23e99c59da9c3f22bd0cc728b Mon Sep 17 00:00:00 2001 From: Marcin Puc Date: Wed, 31 May 2023 00:31:35 +0200 Subject: [PATCH 1/5] rust-bootstrap: update to 1.70.0 --- srcpkgs/rust-bootstrap/template | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/srcpkgs/rust-bootstrap/template b/srcpkgs/rust-bootstrap/template index 567c4ae1e69d..d1025550e850 100644 --- a/srcpkgs/rust-bootstrap/template +++ b/srcpkgs/rust-bootstrap/template @@ -1,6 +1,6 @@ # Template file for 'rust-bootstrap' pkgname=rust-bootstrap -version=1.69.0 +version=1.70.0 revision=1 short_desc="Rust programming language bootstrap toolchain" maintainer="Orphaned " @@ -31,24 +31,24 @@ case "$XBPS_TARGET_MACHINE" in ${_bootstrap_url}/rustc-${version}-i686-unknown-linux-gnu.tar.xz ${_bootstrap_url}/rust-std-${version}-i686-unknown-linux-gnu.tar.xz" checksum=" - 788ff61555857680d5ea7cf76023f74a7f4820dd1c26abf76536561d4de3cbe6 - bef330af5bfb381a01349186e05402983495a3e2d4d1c35723a8443039d19a2d" + f89c90f80864f68e42b70d9c14984195629ed9894bb5cfe6c8a0f1140f7816ff + 0e5543c35196ca5b08f1b7e49fa3f3b671444d75648504cdbcfd854e2e7efd2d" ;; x86_64) distfiles=" ${_bootstrap_url}/rustc-${version}-x86_64-unknown-linux-gnu.tar.xz ${_bootstrap_url}/rust-std-${version}-x86_64-unknown-linux-gnu.tar.xz" checksum=" - 70e97ab5b9600328b977268fc92ca4aa53064e4e97468df35215d4396e509279 - 4c95739e6f0f1d4defd937f6d60360b566e051dfb2fa71879d0f9751392f3709" + 7d891d3e9bc4f1151545c83cbe3bc6af9ed234388c45ca2e19641262f48615e2 + 0c0129717da1e27ccf2c56da950d2fe56973f71beec9e80ae6904b282d2f0ee9" ;; x86_64-musl) distfiles=" ${_bootstrap_url}/rustc-${version}-x86_64-unknown-linux-musl.tar.xz ${_bootstrap_url}/rust-std-${version}-x86_64-unknown-linux-musl.tar.xz" checksum=" - 7d9e64850a79292d2cda6f4464dfd67d2cbd22ac8c7f3e170291396ef8be8041 - 29d98c004629ab536bd2461f715f26ddce3b0f0212db85939c7bc66a8d234b2d" + 69a3ba1273aedaf7aadc91f6ccf59061eb00205c9c523f0b1f91ca14cfa2058c + 7ebaba08385d1ec87d0a27ca8b4e1eb454374da18ffa12621bd1578973754101" ;; # placeholders for user-supplied distfiles ppc64le) From 0083f772a747d2fc836841148f190b8930a93281 Mon Sep 17 00:00:00 2001 From: Marcin Puc Date: Wed, 31 May 2023 00:33:09 +0200 Subject: [PATCH 2/5] cargo-bootstrap: update to 1.70.0 --- srcpkgs/cargo-bootstrap/template | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/srcpkgs/cargo-bootstrap/template b/srcpkgs/cargo-bootstrap/template index b5dc2e9aed89..d591e4233c57 100644 --- a/srcpkgs/cargo-bootstrap/template +++ b/srcpkgs/cargo-bootstrap/template @@ -1,6 +1,6 @@ # Template file for 'cargo-bootstrap' pkgname=cargo-bootstrap -version=1.69.0 +version=1.70.0 revision=1 short_desc="Bootstrap binaries of Rust package manager" maintainer="Orphaned " @@ -24,15 +24,15 @@ esac case "$XBPS_TARGET_MACHINE" in i686) distfiles="${_bootstrap_url}/cargo-${version}-i686-unknown-linux-gnu.tar.xz" - checksum="4c9b1b2fb692bb0c81e524df6368723f061c8bb0d21a1f487eb8e5c2bdf323ab" + checksum="5d20e9b8e56f641c3ef4aef965563806aa220044397485ec56f784657451a329" ;; x86_64) distfiles="${_bootstrap_url}/cargo-${version}-x86_64-unknown-linux-gnu.tar.xz" - checksum="336eeabf231a7665c26c127a37b8aefffe28cb087c5c8d4ba0460419f5f8eff2" + checksum="650e7a890a52869cd14e2305652bff775aec7fc2cf47fc62cf4a89ff07242333" ;; x86_64-musl) distfiles="${_bootstrap_url}/cargo-${version}-x86_64-unknown-linux-musl.tar.xz" - checksum="17f5c6481a881599adb5f665480d9985073155eda9c9fdc1e5663563db51b970" + checksum="4d7513e23b8710ebacb01ed333d00692331295e45191f5c0795aada00f291d19" ;; # placeholders for user-supplied distfiles ppc64le) From 633eb7021610cce24114152fc034e128c235665d Mon Sep 17 00:00:00 2001 From: Marcin Puc Date: Wed, 31 May 2023 00:36:10 +0200 Subject: [PATCH 3/5] rust: update to 1.70.0 --- srcpkgs/rust-src | 1 + ...dlib-and-musl_root-from-musl-targets.patch | 63 +++----- ...e-debugger-scripts-to-usr-share-rust.patch | 26 +-- ...4-fix-shebang-on-install-template.sh.patch | 15 +- ...kage-of-musl-libc-for-the-libc-crate.patch | 28 ++-- srcpkgs/rust/template | 149 +++++++++--------- 6 files changed, 124 insertions(+), 158 deletions(-) create mode 120000 srcpkgs/rust-src diff --git a/srcpkgs/rust-src b/srcpkgs/rust-src new file mode 120000 index 000000000000..6ef8575b5fa4 --- /dev/null +++ b/srcpkgs/rust-src @@ -0,0 +1 @@ +rust \ No newline at end of file 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 1759147c989f..07c24412f6d9 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 @@ -4,17 +4,6 @@ Date: Sun, 3 May 2020 17:53:33 +0200 Subject: [PATCH 02/15] Remove -nostdlib and musl_root from musl targets extended by various void contributors to match our musl setup ---- - compiler/rustc_target/src/spec/crt_objects.rs | 22 ---------- - .../rustc_target/src/spec/linux_musl_base.rs | 7 --- - config.toml.example | 8 ---- - src/bootstrap/cc_detect.rs | 25 +---------- - src/bootstrap/compile.rs | 43 +------------------ - src/bootstrap/config.rs | 9 ---- - src/bootstrap/configure.py | 28 ------------ - src/bootstrap/lib.rs | 19 -------- - src/bootstrap/sanity.rs | 23 ---------- - 9 files changed, 3 insertions(+), 181 deletions(-) diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs index c126390f5..7aef73d3b 100644 @@ -70,13 +59,13 @@ index 61553e71b..88f807a58 100644 base } -diff --git a/config.toml.example b/config.toml.example -index ca54cbd2d..beec9bb04 100644 ---- a/config.toml.example -+++ b/config.toml.example -@@ -540,14 +540,6 @@ changelog-seen = 2 +diff --git a/config.example.toml b/config.example.toml +index 6d9c762ce..7a1375d8a 100644 +--- a/config.example.toml ++++ b/config.example.toml +@@ -556,14 +556,6 @@ changelog-seen = 2 # behavior -- this may lead to miscompilations or other bugs. - #description = (string) + #description = "" -# The root location of the musl installation directory. The library directory -# will also need to contain libunwind.a for an unwinding implementation. Note @@ -90,10 +79,10 @@ index ca54cbd2d..beec9bb04 100644 # platforms to ensure that the compiler is usable by default from the build # directory (as it links to a number of dynamic libraries). This may not be diff --git a/src/bootstrap/cc_detect.rs b/src/bootstrap/cc_detect.rs -index 7128d542a..668245f3c 100644 +index 65c882fb8..f35a92821 100644 --- a/src/bootstrap/cc_detect.rs +++ b/src/bootstrap/cc_detect.rs -@@ -101,7 +101,7 @@ pub fn find(build: &mut Build) { +@@ -103,7 +103,7 @@ pub fn find(build: &mut Build) { if let Some(cc) = config.and_then(|c| c.cc.as_ref()) { cfg.compiler(cc); } else { @@ -102,7 +91,7 @@ index 7128d542a..668245f3c 100644 } let compiler = cfg.get_compiler(); -@@ -122,7 +122,7 @@ pub fn find(build: &mut Build) { +@@ -124,7 +124,7 @@ pub fn find(build: &mut Build) { cfg.compiler(cxx); true } else if build.hosts.contains(&target) || build.build == target { @@ -111,7 +100,7 @@ index 7128d542a..668245f3c 100644 true } else { // Use an auto-detected compiler (or one configured via `CXX_target_triple` env vars). -@@ -158,7 +158,6 @@ fn set_compiler( +@@ -160,7 +160,6 @@ fn set_compiler( compiler: Language, target: TargetSelection, config: Option<&Target>, @@ -119,7 +108,7 @@ index 7128d542a..668245f3c 100644 ) { match &*target.triple { // When compiling for android we may have the NDK configured in the -@@ -194,26 +193,6 @@ fn set_compiler( +@@ -196,26 +195,6 @@ fn set_compiler( } } @@ -147,10 +136,10 @@ index 7128d542a..668245f3c 100644 } } diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs -index 0deed3f99..0bddac5d1 100644 +index 4a4e7adcb..f2cdc4a07 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs -@@ -228,39 +228,7 @@ fn copy_self_contained_objects( +@@ -246,39 +246,7 @@ fn copy_self_contained_objects( let mut target_deps = vec![]; // Copies the libc and CRT objects. @@ -174,7 +163,7 @@ index 0deed3f99..0bddac5d1 100644 - DependencyType::TargetSelfContained, - ); - } -- let crt_path = builder.ensure(native::CrtBeginEnd { target }); +- let crt_path = builder.ensure(llvm::CrtBeginEnd { target }); - for &obj in &["crtbegin.o", "crtbeginS.o", "crtend.o", "crtendS.o"] { - let src = crt_path.join(obj); - let target = libdir_self_contained.join(obj); @@ -191,7 +180,7 @@ index 0deed3f99..0bddac5d1 100644 let srcdir = builder .wasi_root(target) .unwrap_or_else(|| { -@@ -344,15 +312,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car +@@ -375,15 +343,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car .arg("--manifest-path") .arg(builder.src.join("library/test/Cargo.toml")); @@ -208,10 +197,10 @@ index 0deed3f99..0bddac5d1 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 d8c15c76e..53f95e49b 100644 +index cc3b3bc25..eb472c5e8 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs -@@ -200,7 +200,6 @@ pub struct Config { +@@ -210,7 +210,6 @@ pub struct Config { pub missing_tools: bool, // Fallback musl-root for all targets @@ -219,7 +208,7 @@ index d8c15c76e..53f95e49b 100644 pub prefix: Option, pub sysconfdir: Option, pub datadir: Option, -@@ -440,8 +439,6 @@ pub struct Target { +@@ -456,8 +455,6 @@ pub struct Target { pub sanitizers: Option, pub profiler: Option, pub crt_static: Option, @@ -228,7 +217,7 @@ index d8c15c76e..53f95e49b 100644 pub wasi_root: Option, pub qemu_rootfs: Option, pub no_std: bool, -@@ -734,7 +731,6 @@ define_config! { +@@ -753,7 +750,6 @@ define_config! { default_linker: Option = "default-linker", channel: Option = "channel", description: Option = "description", @@ -236,7 +225,7 @@ index d8c15c76e..53f95e49b 100644 rpath: Option = "rpath", verbose_tests: Option = "verbose-tests", optimize_tests: Option = "optimize-tests", -@@ -781,8 +777,6 @@ define_config! { +@@ -801,8 +797,6 @@ define_config! { sanitizers: Option = "sanitizers", profiler: Option = "profiler", crt_static: Option = "crt-static", @@ -245,7 +234,7 @@ index d8c15c76e..53f95e49b 100644 wasi_root: Option = "wasi-root", qemu_rootfs: Option = "qemu-rootfs", no_std: Option = "no-std", -@@ -1187,7 +1181,6 @@ impl Config { +@@ -1133,7 +1127,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; @@ -253,7 +242,7 @@ index d8c15c76e..53f95e49b 100644 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); -@@ -1251,8 +1244,6 @@ impl Config { +@@ -1293,8 +1286,6 @@ impl Config { target.ranlib = cfg.ranlib.map(PathBuf::from); target.linker = cfg.linker.map(PathBuf::from); target.crt_static = cfg.crt_static; @@ -263,10 +252,10 @@ index d8c15c76e..53f95e49b 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 6b139decb..a2e19b8f4 100755 +index abd28b400..6f0f8d879 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py -@@ -112,34 +112,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk", +@@ -111,34 +111,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk", "aarch64-linux-android NDK standalone path") v("x86_64-linux-android-ndk", "target.x86_64-linux-android.android-ndk", "x86_64-linux-android NDK standalone path") @@ -302,10 +291,10 @@ index 6b139decb..a2e19b8f4 100755 "rootfs in qemu testing, you probably don't want to use this") v("qemu-aarch64-rootfs", "target.aarch64-unknown-linux-gnu.qemu-rootfs", diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs -index 3ed534523..c7c7a75f0 100644 +index 419bcbc63..dc98f5197 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs -@@ -1181,25 +1181,6 @@ impl Build { +@@ -1139,25 +1139,6 @@ impl Build { } } diff --git a/srcpkgs/rust/patches/0003-move-debugger-scripts-to-usr-share-rust.patch b/srcpkgs/rust/patches/0003-move-debugger-scripts-to-usr-share-rust.patch index bc7053800945..b10510ca6f27 100644 --- a/srcpkgs/rust/patches/0003-move-debugger-scripts-to-usr-share-rust.patch +++ b/srcpkgs/rust/patches/0003-move-debugger-scripts-to-usr-share-rust.patch @@ -3,18 +3,11 @@ From: Daniel Kolesa Date: Mon, 20 Dec 2021 00:45:35 +0100 Subject: [PATCH 03/15] move debugger scripts to /usr/share/rust ---- - src/bootstrap/dist.rs | 2 +- - src/etc/rust-gdb | 2 +- - src/etc/rust-gdbgui | 2 +- - src/etc/rust-lldb | 4 ++-- - 4 files changed, 5 insertions(+), 5 deletions(-) - diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs -index b1fae356d..e7a077134 100644 +index 76aad16c1..db53459e8 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs -@@ -460,7 +460,7 @@ impl Step for DebuggerScripts { +@@ -528,7 +528,7 @@ impl Step for DebuggerScripts { fn run(self, builder: &Builder<'_>) { let host = self.host; let sysroot = self.sysroot; @@ -24,7 +17,7 @@ index b1fae356d..e7a077134 100644 let cp_debugger_script = |file: &str| { builder.install(&builder.src.join("src/etc/").join(file), &dst, 0o644); diff --git a/src/etc/rust-gdb b/src/etc/rust-gdb -index b950cea79..559bfe3f1 100755 +index 9abed30ea..4c7f953ed 100755 --- a/src/etc/rust-gdb +++ b/src/etc/rust-gdb @@ -12,7 +12,7 @@ fi @@ -33,11 +26,11 @@ index b950cea79..559bfe3f1 100755 RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)" -GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc" +GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/share/rust" + # Get the commit hash for path remapping + RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')" - # Run GDB with the additional arguments that load the pretty printers - # Set the environment variable `RUST_GDB` to overwrite the call to a diff --git a/src/etc/rust-gdbgui b/src/etc/rust-gdbgui -index 9744913b6..8722acdcc 100755 +index 913269316..f444fbc4b 100755 --- a/src/etc/rust-gdbgui +++ b/src/etc/rust-gdbgui @@ -41,7 +41,7 @@ fi @@ -46,9 +39,9 @@ index 9744913b6..8722acdcc 100755 RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)" -GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc" +GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/share/rust" + # Get the commit hash for path remapping + RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')" - # Set the environment variable `RUST_GDB` to overwrite the call to a - # different/specific command (defaults to `gdb`). diff --git a/src/etc/rust-lldb b/src/etc/rust-lldb index bce72f1ba..8abb01245 100755 --- a/src/etc/rust-lldb @@ -64,6 +57,3 @@ index bce72f1ba..8abb01245 100755 # Call LLDB with the commands added to the argument list exec "$lldb" --one-line-before-file "$script_import" --source-before-file "$commands_file" "$@" --- -2.37.2 - diff --git a/srcpkgs/rust/patches/0004-fix-shebang-on-install-template.sh.patch b/srcpkgs/rust/patches/0004-fix-shebang-on-install-template.sh.patch index 2ca7ffeaf73f..2326d3cc4232 100644 --- a/srcpkgs/rust/patches/0004-fix-shebang-on-install-template.sh.patch +++ b/srcpkgs/rust/patches/0004-fix-shebang-on-install-template.sh.patch @@ -3,20 +3,13 @@ From: Daniel Kolesa Date: Mon, 20 Dec 2021 00:55:18 +0100 Subject: [PATCH 04/15] fix shebang on install-template.sh ---- - src/tools/rust-installer/install-template.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - diff --git a/src/tools/rust-installer/install-template.sh b/src/tools/rust-installer/install-template.sh -index e68be8911..beaa90f7b 100644 +index 92a3f1f2c..fca281191 100644 --- a/src/tools/rust-installer/install-template.sh +++ b/src/tools/rust-installer/install-template.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh - # Copyright 2014 The Rust Project Developers. See the COPYRIGHT - # file at the top-level directory of this distribution and at - # http://rust-lang.org/COPYRIGHT. --- -2.37.2 - + + # No undefined variables + set -u diff --git a/srcpkgs/rust/patches/0010-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch b/srcpkgs/rust/patches/0010-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch index f2780ae08dfb..0f09cef58f70 100644 --- a/srcpkgs/rust/patches/0010-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch +++ b/srcpkgs/rust/patches/0010-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch @@ -3,29 +3,23 @@ From: q66 Date: Sun, 3 May 2020 18:02:03 +0200 Subject: [PATCH 10/15] Fix dynamic linkage of musl libc for the libc crate ---- - vendor/libc/src/unix/mod.rs | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - diff --git a/vendor/libc/src/unix/mod.rs b/vendor/libc/src/unix/mod.rs -index ecee44411..7ae05f24e 100644 +index b005970b9..c53093a09 100644 --- a/vendor/libc/src/unix/mod.rs +++ b/vendor/libc/src/unix/mod.rs -@@ -337,11 +337,11 @@ cfg_if! { +@@ -351,7 +351,14 @@ cfg_if! { + #[link(name = "dl", cfg(not(target_feature = "crt-static")))] #[link(name = "c", cfg(not(target_feature = "crt-static")))] extern {} - } else if #[cfg(target_env = "musl")] { +- } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] { ++ } else if #[cfg(target_env = "musl")] { + #[link(name = "c")] + extern {} - #[cfg_attr(feature = "rustc-dep-of-std", -- link(name = "c", kind = "static", modifiers = "-bundle", ++ #[cfg_attr(feature = "rustc-dep-of-std", + link(name = "gcc", kind = "static", modifiers = "-bundle", ++ cfg(target_feature = "crt-static")))] ++ extern {} ++ } else if #[cfg(target_env = "ohos")] { + #[cfg_attr(feature = "rustc-dep-of-std", + link(name = "c", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static")))] -- #[cfg_attr(feature = "rustc-dep-of-std", -- link(name = "c", cfg(not(target_feature = "crt-static"))))] - extern {} - } else if #[cfg(target_os = "emscripten")] { - #[link(name = "c")] --- -2.37.2 - diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template index 88e35a5a43ad..d792ef2b5efe 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.69.0 +version=1.70.0 revision=1 hostmakedepends="cmake curl pkg-config python3 tar cargo-bootstrap" makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm15" @@ -18,9 +18,10 @@ 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=fb05971867ad6ccabbd3720279f5a94b99f61024923187b56bb5c455fa3cf60f +checksum=b2bfae000b7a5040e4ec4bbc50a09f21548190cb7570b0ed77358368413bd27c lib32disabled=yes make_check=no # CBA for now +python_version=3 # needed for python files in rust-src build_options="bindist" desc_option_bindist="Generate tarballs for bootstrap" @@ -70,97 +71,85 @@ post_patch() { } do_configure() { - local _local_rebuild _use_debug _use_debug_rustc _use_rpath _use_docs _llvm_shared + local _local_rebuild _debug _debug_rustc _rpath _docs _llvm_shared + local _cross_args if [ "$CROSS_BUILD" ]; then - _local_rebuild="true" + _local_rebuild="enable" else - _local_rebuild="false" + _local_rebuild="disable" fi # disable rustc debug info as it bloats up rust-std significantly # set to 1 or 2 if you wish to have debug info for rustc, it won't # link on 32-bit platforms though (too big) - _use_debug_rustc="0" + _debug_rustc="0" # just disable debug for now - _use_debug="0" + _debug="0" # if true, the binaries will be built with rpath, so the binaries will be # usable directly from the build directory, this is not desirable for # packaging but is useful when building bootstrap binaries if [ "$build_option_bindist" ]; then - _use_rpath="true" - _use_docs="false" - _llvm_shared="false" + _rpath="enable" + _docs="disable" + _llvm_shared="disable" else - _use_rpath="false" - _use_docs="true" - _llvm_shared="true" + _rpath="disable" + _docs="enable" + _llvm_shared="enable" fi - cat > config.toml <<- EOF - changelog-seen = 2 - [llvm] - ninja = false - link-shared = ${_llvm_shared} - [build] - build = "${RUST_BUILD}" - host = [ "${RUST_TARGET}" ] - target = [ "${RUST_TARGET}" ] - cargo = "/usr/bin/cargo" - rustc = "/usr/bin/rustc" - submodules = false - python = "python3" - locked-deps = true - vendor = true - full-bootstrap = false - local-rebuild = ${_local_rebuild} - extended = false - docs = ${_use_docs} - tools = [] - [install] - prefix = "/usr" - [rust] - optimize = true - debug = false - codegen-units = 1 - codegen-units-std = 1 - debuginfo-level = ${_use_debug} - debuginfo-level-rustc = ${_use_debug_rustc} - debuginfo-level-tests = 0 - incremental = false - parallel-compiler = false - channel = "stable" - description = "Void Linux" - rpath = ${_use_rpath} - verbose-tests = true - dist-src = false - jemalloc = false - llvm-libunwind = "no" - codegen-tests = false - [dist] - src-tarball = false - [target.${RUST_BUILD}] - llvm-config = "/usr/bin/llvm-config" - crt-static = false - cc = "${CC_host:-$CC}" - cxx = "${CXX_host:-$CXX}" - ar = "${AR_host:-$AR}" - linker = "${CC_host:-$CC}" - EOF - if [ "$CROSS_BUILD" ]; then - cat >> config.toml <<- EOF - [target.${RUST_TARGET}] - llvm-config = "/usr/bin/llvm-config" - crt-static = false - cc = "${CC}" - cxx = "${CXX}" - ar = "${AR}" - linker = "${CC}" - sysroot = "${XBPS_CROSS_BASE}" - EOF + _cross_args="--set=target.${RUST_TARGET}.llvm-config=/usr/bin/llvm-config + --set=target.${RUST_TARGET}.crt-static=false + --set=target.${RUST_TARGET}.cc=${CC} + --set=target.${RUST_TARGET}.cxx=${CXX} + --set=target.${RUST_TARGET}.ar=${AR} + --set=target.${RUST_TARGET}.linker=${CC} fi + + ./configure \ + --build="${RUST_BUILD}" \ + --host="${RUST_TARGET}" \ + --target="${RUST_TARGET}" \ + --prefix=/usr \ + --python=python3 \ + --enable-vendor \ + --enable-locked-deps \ + --enable-verbose-tests \ + --disable-full-bootstrap \ + --disable-extended \ + --disable-codegen-tests \ + --disable-dist-src \ + --${_llvm_shared}-llvm-link-shared \ + --${_rpath}-rpath \ + --${_local_rebuild}-local-rebuild \ + --${_docs}-docs \ + --debuginfo-level="${_debug}" \ + --debuginfo-level-rustc="${_debug_rustc}" \ + --debuginfo-level-tests=0 \ + --release-channel=stable \ + --release-description="Void Linux" \ + --llvm-libunwind=no \ + --llvm-config=/usr/bin/llvm-config \ + --set="rust.optimize=true" \ + --set="rust.debug=false" \ + --set="rust.codegen-units=1" \ + --set="rust.codegen-units-std=1" \ + --set="rust.incremental=false" \ + --set="rust.parallel-compiler=false" \ + --set="rust.jemalloc=false" \ + --set="build.submodules=false" \ + --set="build.rustc=/usr/bin/rustc" \ + --set="build.cargo=/usr/bin/cargo" \ + --set="target.${RUST_BUILD}.crt-static=false" \ + --set="target.${RUST_BUILD}.cc=${CC_host:-$CC}" \ + --set="target.${RUST_BUILD}.cxx=${CXX_host:-$CXX}" \ + --set="target.${RUST_BUILD}.ar=${AR_host:-$AR}" \ + --set="target.${RUST_BUILD}.linker=${CC_host:-$CC}" \ + --set="dist.src-tarball=false" \ + ${_cross_args} } # Set the correct CFLAGS for the build host, we have to compile libbacktrace @@ -213,6 +202,8 @@ do_install() { -C "$DESTDIR/usr/lib" --strip-components=3 --exclude=manifest.in tar xf build/dist/rust-docs-${version}-${RUST_TARGET}.tar.gz \ -C "$DESTDIR/usr" --strip-components=2 --exclude=manifest.in + tar xf build/dist/rust-src-${version}.tar.gz \ + -C "$DESTDIR/usr" --strip-components=2 --exclude=manifest.in vlicense COPYRIGHT vlicense LICENSE-APACHE @@ -237,6 +228,14 @@ rust-std_package() { depends="libexecinfo-devel" fi pkg_install() { - vmove usr/lib/rustlib + vmove usr/lib/rustlib/${RUST_TARGET} + vmove usr/lib/rustlib/rustc-src + } +} + +rust-src_package() { + short_desc+=" - source code" + pkg_install() { + vmove usr/lib/rustlib/src } } From fb348cd905523b36ed4fb5f2d79c99fd9bff5cb6 Mon Sep 17 00:00:00 2001 From: Marcin Puc Date: Wed, 31 May 2023 00:37:18 +0200 Subject: [PATCH 4/5] cargo: update to 1.70.0 --- srcpkgs/cargo/template | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/srcpkgs/cargo/template b/srcpkgs/cargo/template index 6b748e7f95f3..1ef9216f882f 100644 --- a/srcpkgs/cargo/template +++ b/srcpkgs/cargo/template @@ -1,8 +1,8 @@ # Template file for 'cargo' pkgname=cargo -version=1.69.0 +version=1.70.0 revision=1 -_cargo_revision=0.70.0 +_cargo_revision=0.71.0 build_helper=rust hostmakedepends="cargo-bootstrap rust python3 curl cmake pkg-config zlib-devel" makedepends="rust libcurl-devel openssl-devel" @@ -11,8 +11,9 @@ short_desc="Rust package manager" maintainer="Enno Boland " license="MIT, Apache-2.0" homepage="https://crates.io/" -distfiles="https://github.com/rust-lang/cargo/archive/refs/tags/${_cargo_revision}.tar.gz" -checksum=35d9a86e8d6d942e6c7c8e3333760de33a886063a918a86083724df02a43da7f +# distfiles="https://github.com/rust-lang/cargo/archive/refs/tags/${_cargo_revision}.tar.gz" +distfiles="https://github.com/rust-lang/cargo/archive/ec8a8a0cabb0e0cadef58902470f6c7ee7868bdc.tar.gz" +checksum=0f0aebf36e270ad38063e2c9d36bd710fb52a48bc0e123b2107057779c7cabe2 replaces="cargo-tree>=0" build_options="static bindist" From 94ff76453f978a36237a9b267c75b952ff1d934f Mon Sep 17 00:00:00 2001 From: Marcin Puc Date: Wed, 31 May 2023 00:37:43 +0200 Subject: [PATCH 5/5] common/environment/build-style/cargo.sh: remove obsolete sparse crates.io config --- common/environment/build-style/cargo.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/environment/build-style/cargo.sh b/common/environment/build-style/cargo.sh index bc836b06cf06..473750c7a359 100644 --- a/common/environment/build-style/cargo.sh +++ b/common/environment/build-style/cargo.sh @@ -8,6 +8,4 @@ if [ "$CROSS_BUILD" ]; then makedepends+=" rust-std" fi -export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse - build_helper+=" rust"