From: Deepesh.Varatharajan@windriver.com
To: openembedded-core@lists.openembedded.org
Cc: Sundeep.Kokkonda@windriver.com,
Deepesh.Varatharajan@windriver.com,
richard.purdie@linuxfoundation.org
Subject: [PATCH v4 1/3] rust: Fix reproducibility with shared source trees
Date: Tue, 28 Jul 2026 21:47:11 -0700 [thread overview]
Message-ID: <20260729044714.1239545-1-Deepesh.Varatharajan@windriver.com> (raw)
From: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Backport an upstream Rust commit to fix a reproducibility
issue when Rust family recipes share the same source tree.
Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
---
...ild-script-path-leakage-in-artifacts.patch | 28 +++++++++++++++++++
meta/recipes-devtools/rust/rust-source.inc | 1 +
2 files changed, 29 insertions(+)
create mode 100644 meta/recipes-devtools/rust/files/0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch
diff --git a/meta/recipes-devtools/rust/files/0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch b/meta/recipes-devtools/rust/files/0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch
new file mode 100644
index 0000000000..8c93624df7
--- /dev/null
+++ b/meta/recipes-devtools/rust/files/0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch
@@ -0,0 +1,28 @@
+Backport a commit that remap OUT_DIR paths to fix build script path leakage in artifacts
+
+Upstream-Status: Backport [https://github.com/rust-lang/rust/commit/e743a4db62336027dcc1f1a755f4ca35f56b67df]
+
+Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
+
+diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs
+index f785254..0264667 100644
+--- a/src/bootstrap/src/core/builder/cargo.rs
++++ b/src/bootstrap/src/core/builder/cargo.rs
+@@ -1077,6 +1077,8 @@ impl Builder<'_> {
+ // rustc creates absolute paths (in part bc of the `rust-src` unremap
+ // and for working directory) so let's remap the build directory as well.
+ format!("{}={map_to}", self.build.src.display()),
++ // remap OUT_DIR so they don't leak into artifacts.
++ format!("{}={map_to}/out", self.build.out.display()),
+ ]
+ .join("\t");
+ cargo.env("RUSTC_DEBUGINFO_MAP", map);
+@@ -1097,6 +1099,8 @@ impl Builder<'_> {
+ // rustc creates absolute paths (in part bc of the `rust-src` unremap
+ // and for working directory) so let's remap the build directory as well.
+ format!("{}={map_to}", self.build.src.display()),
++ // remap OUT_DIR so they don't leak into artifacts.
++ format!("{}={map_to}/out", self.build.out.display()),
+ ]
+ .join("\t");
+ cargo.env("RUSTC_DEBUGINFO_MAP", map);
diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc
index a8d8de7165..5678e00671 100644
--- a/meta/recipes-devtools/rust/rust-source.inc
+++ b/meta/recipes-devtools/rust/rust-source.inc
@@ -9,6 +9,7 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n
file://0002-Fix-rust-build-failure-with-unstable-options.patch;patchdir=${RUSTSRC} \
file://0003-explicit-tail-calls-disable-two-tests.patch;patchdir=${RUSTSRC} \
file://0004-explicit-tail-calls-ignore-tests-on-unsupported-llvm.patch;patchdir=${RUSTSRC} \
+ file://0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch;patchdir=${RUSTSRC} \
"
SRC_URI[rust.sha256sum] = "77a6ff3003a4ad0cb00697b043c879e3e1a15d945b1a1f63818903bfc3fa8b98"
--
2.49.0
next reply other threads:[~2026-07-29 4:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 4:47 Deepesh.Varatharajan [this message]
2026-07-29 4:47 ` [PATCH v4 2/3] rust: refactor source handling into a shared work-shared recipe Deepesh.Varatharajan
2026-07-29 5:02 ` Patchtest results for " patchtest
2026-07-29 5:24 ` Varatharajan, Deepesh
2026-07-29 4:47 ` [PATCH v4 3/3] rust: Move do_update_snapshot to rust-source Deepesh.Varatharajan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260729044714.1239545-1-Deepesh.Varatharajan@windriver.com \
--to=deepesh.varatharajan@windriver.com \
--cc=Sundeep.Kokkonda@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=richard.purdie@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox