diff options
Diffstat (limited to 'meta/recipes-devtools/rust/files/0001-cargo-do-not-write-host-information-into-compilation.patch')
| -rw-r--r-- | meta/recipes-devtools/rust/files/0001-cargo-do-not-write-host-information-into-compilation.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rust/files/0001-cargo-do-not-write-host-information-into-compilation.patch b/meta/recipes-devtools/rust/files/0001-cargo-do-not-write-host-information-into-compilation.patch new file mode 100644 index 0000000000..a6ee867605 --- /dev/null +++ b/meta/recipes-devtools/rust/files/0001-cargo-do-not-write-host-information-into-compilation.patch | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | From 065d7c263091118437465d714d8a29dbb6296921 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alexander Kanavin <alex@linutronix.de> | ||
| 3 | Date: Mon, 13 May 2024 14:57:54 +0200 | ||
| 4 | Subject: [PATCH] cargo: do not write host information into compilation unit | ||
| 5 | hashes | ||
| 6 | |||
| 7 | This breaks reproducibility in cross-builds where the cross-target | ||
| 8 | can be the same, but build hosts are different, as seen with | ||
| 9 | "rustc --version -v": | ||
| 10 | ... | ||
| 11 | host: x86_64-unknown-linux-gnu | ||
| 12 | |||
| 13 | vs. | ||
| 14 | |||
| 15 | host: aarch64-unknown-linux-gnu | ||
| 16 | |||
| 17 | This can possibly be improved by only hashing host info if the build | ||
| 18 | is a native one (e.g. there's no --target option passed to cargo | ||
| 19 | invocation) but I'm not sure how. | ||
| 20 | |||
| 21 | Upstream-Status: Inappropriate [reported at https://github.com/rust-lang/cargo/issues/13922] | ||
| 22 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> | ||
| 23 | --- | ||
| 24 | .../src/cargo/core/compiler/context/compilation_files.rs | 4 ++-- | ||
| 25 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 26 | |||
| 27 | diff --git a/src/tools/cargo/src/cargo/core/compiler/context/compilation_files.rs b/src/tools/cargo/src/cargo/core/compiler/context/compilation_files.rs | ||
| 28 | index d83dbf10c..b2ad8d9f3 100644 | ||
| 29 | --- a/src/tools/cargo/src/cargo/core/compiler/context/compilation_files.rs | ||
| 30 | +++ b/src/tools/cargo/src/cargo/core/compiler/context/compilation_files.rs | ||
| 31 | @@ -652,7 +652,7 @@ fn hash_rustc_version(bcx: &BuildContext<'_, '_>, hasher: &mut StableHasher) { | ||
| 32 | if vers.pre.is_empty() || bcx.config.cli_unstable().separate_nightlies { | ||
| 33 | // For stable, keep the artifacts separate. This helps if someone is | ||
| 34 | // testing multiple versions, to avoid recompiles. | ||
| 35 | - bcx.rustc().verbose_version.hash(hasher); | ||
| 36 | + //bcx.rustc().verbose_version.hash(hasher); | ||
| 37 | return; | ||
| 38 | } | ||
| 39 | // On "nightly"/"beta"/"dev"/etc, keep each "channel" separate. Don't hash | ||
| 40 | @@ -665,7 +665,7 @@ fn hash_rustc_version(bcx: &BuildContext<'_, '_>, hasher: &mut StableHasher) { | ||
| 41 | // Keep "host" since some people switch hosts to implicitly change | ||
| 42 | // targets, (like gnu vs musl or gnu vs msvc). In the future, we may want | ||
| 43 | // to consider hashing `unit.kind.short_name()` instead. | ||
| 44 | - bcx.rustc().host.hash(hasher); | ||
| 45 | + //bcx.rustc().host.hash(hasher); | ||
| 46 | // None of the other lines are important. Currently they are: | ||
| 47 | // binary: rustc <-- or "rustdoc" | ||
| 48 | // commit-hash: 38114ff16e7856f98b2b4be7ab4cd29b38bed59a | ||
| 49 | -- | ||
| 50 | 2.39.2 | ||
| 51 | |||
