Files
poky/meta/recipes-devtools/rust/files/0001-Handle-vendored-sources-when-remapping-paths.patch
Yash Shinde a62cee4479 rust: Upgrade 1.74.1 -> 1.75.0
* Drop backported musl fixes.

* Set `change-id` rather than `changelog-seen`
to fix build warning.

* Add fixes for 4b7e0a0b56aa24 ("Handle vendored sources
when remapping paths") which otherwise cause build failures:

| thread 'main' panicked at src/core/builder.rs:1795:26:
| std::fs::read_dir(registry_src) failed with No such file or directory (os=
 error 2)

https://blog.rust-lang.org/2023/12/28/Rust-1.75.0.html

(From OE-Core rev: 9aec2c6c777388bb3129aa4c4f27a40f912522b4)

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-01 09:31:10 +00:00

47 lines
1.8 KiB
Diff

From 5e37ea7cb9d99d91f2c5ac6edf19ff777f95bb88 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
Upstream-Status: Submitted [https://github.com/rust-lang/rust/pull/119582]
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.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 cd276674dee6..48fdb2c7f7b7 100644
--- a/src/bootstrap/src/core/builder.rs
+++ b/src/bootstrap/src/core/builder.rs
@@ -1789,15 +1789,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.39.0