summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWANG Xuerui <xen0n@gentoo.org>2024-02-13 17:11:40 +0800
committerWANG Xuerui <xen0n@gentoo.org>2024-03-09 10:54:51 +0800
commit893fc56d0f99d942d9059ac4ddd8ec095d61063f (patch)
tree56746ab8d8d27d1c2381411f94c7c47c1548b32f /sys-devel/rust-std
parentdev-lang/rust: backport the loong code model change to 1.76.0 (diff)
downloadgentoo-893fc56d0f99d942d9059ac4ddd8ec095d61063f.tar.gz
gentoo-893fc56d0f99d942d9059ac4ddd8ec095d61063f.tar.bz2
gentoo-893fc56d0f99d942d9059ac4ddd8ec095d61063f.zip
sys-devel/rust-std: apply vendored-sources patch to rust-std too
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
Diffstat (limited to 'sys-devel/rust-std')
-rw-r--r--sys-devel/rust-std/files/1.75.0-handle-vendored-sources.patch45
-rw-r--r--sys-devel/rust-std/rust-std-1.75.0.ebuild6
-rw-r--r--sys-devel/rust-std/rust-std-1.76.0.ebuild4
3 files changed, 54 insertions, 1 deletions
diff --git a/sys-devel/rust-std/files/1.75.0-handle-vendored-sources.patch b/sys-devel/rust-std/files/1.75.0-handle-vendored-sources.patch
new file mode 100644
index 000000000000..c68ceba15e82
--- /dev/null
+++ b/sys-devel/rust-std/files/1.75.0-handle-vendored-sources.patch
@@ -0,0 +1,45 @@
+From 4b7e0a0b56aa2446e670dfd6558380a1039a86aa Mon Sep 17 00:00:00 2001
+From: Arlo Siemsen <arsiem@microsoft.com>
+Date: Thu, 4 Jan 2024 11:40:56 -0600
+Subject: [PATCH] Handle vendored sources when remapping paths
+
+Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
+---
+ src/bootstrap/src/core/builder.rs | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
+index 4e20babc55a..3770d0687b2 100644
+--- a/src/bootstrap/src/core/builder.rs
++++ b/src/bootstrap/src/core/builder.rs
+@@ -1799,15 +1799,20 @@ pub fn cargo(
+ }
+
+ if self.config.rust_remap_debuginfo {
+- // FIXME: handle vendored sources
+- let registry_src = t!(home::cargo_home()).join("registry").join("src");
+ let mut env_var = OsString::new();
+- for entry in t!(std::fs::read_dir(registry_src)) {
+- if !env_var.is_empty() {
+- env_var.push("\t");
+- }
+- env_var.push(t!(entry).path());
++ if self.config.vendor {
++ let vendor = self.build.src.join("vendor");
++ env_var.push(vendor);
+ env_var.push("=/rust/deps");
++ } else {
++ let registry_src = t!(home::cargo_home()).join("registry").join("src");
++ for entry in t!(std::fs::read_dir(registry_src)) {
++ if !env_var.is_empty() {
++ env_var.push("\t");
++ }
++ env_var.push(t!(entry).path());
++ env_var.push("=/rust/deps");
++ }
+ }
+ cargo.env("RUSTC_CARGO_REGISTRY_SRC_TO_REMAP", env_var);
+ }
+--
+2.43.0
+
diff --git a/sys-devel/rust-std/rust-std-1.75.0.ebuild b/sys-devel/rust-std/rust-std-1.75.0.ebuild
index 1432096c3a0d..c63efccf3b0c 100644
--- a/sys-devel/rust-std/rust-std-1.75.0.ebuild
+++ b/sys-devel/rust-std/rust-std-1.75.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2020-2023 Gentoo Authors
+# Copyright 2020-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -36,6 +36,10 @@ RESTRICT="test"
QA_FLAGS_IGNORED="usr/lib/rust/${PV}/rustlib/.*/lib/lib.*.so"
+PATCHES=(
+ "${FILESDIR}"/1.75.0-handle-vendored-sources.patch # remove for >=1.77.0
+)
+
S="${WORKDIR}/${P/-std/c}-src"
#
diff --git a/sys-devel/rust-std/rust-std-1.76.0.ebuild b/sys-devel/rust-std/rust-std-1.76.0.ebuild
index 7037dfd72e6f..c63efccf3b0c 100644
--- a/sys-devel/rust-std/rust-std-1.76.0.ebuild
+++ b/sys-devel/rust-std/rust-std-1.76.0.ebuild
@@ -36,6 +36,10 @@ RESTRICT="test"
QA_FLAGS_IGNORED="usr/lib/rust/${PV}/rustlib/.*/lib/lib.*.so"
+PATCHES=(
+ "${FILESDIR}"/1.75.0-handle-vendored-sources.patch # remove for >=1.77.0
+)
+
S="${WORKDIR}/${P/-std/c}-src"
#