summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorYash Shinde <Yash.Shinde@windriver.com>2024-08-08 03:00:35 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-08-09 22:33:38 +0100
commit66d81c81b692e34bf0193e36b52e575510d011c0 (patch)
tree28946ca20a6ed25e110631058b2779aaca4516f0 /meta/recipes-devtools
parentbe70d81a3cc2775c38270653570e9089f0a68701 (diff)
downloadpoky-66d81c81b692e34bf0193e36b52e575510d011c0.tar.gz
rust: reproducibility issue fix with v1.76
A few crates are using the updated version of the 'cc' crate and this is causing the generated object file names containing a unique hashmap id. The hashmap addition to generated files is reverted here. (From OE-Core rev: 25fed23ea9dcd1e7f0c11a1e3a988a33d5676c0b) Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com> Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/rust/files/repro-issue-fix-with-cc-crate-hashmap.patch59
-rw-r--r--meta/recipes-devtools/rust/rust-source.inc1
2 files changed, 60 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rust/files/repro-issue-fix-with-cc-crate-hashmap.patch b/meta/recipes-devtools/rust/files/repro-issue-fix-with-cc-crate-hashmap.patch
new file mode 100644
index 0000000000..26775ef38a
--- /dev/null
+++ b/meta/recipes-devtools/rust/files/repro-issue-fix-with-cc-crate-hashmap.patch
@@ -0,0 +1,59 @@
1rust: reproducibility issue fix with v1.76
2
3A few crates are using the updated version of the 'cc' crate and this is causing the generated object file names containing a unique hashmap id.
4The hashmap addition to generated files is reverted here.
5
6
7Upstream-Status: Inappropriate [https://github.com/rust-lang/cc-rs/issues/1117]
8Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com>
9---
10--- a/vendor/cc-1.0.79/src/lib.rs
11+++ b/vendor/cc-1.0.79/src/lib.rs
12@@ -56,12 +56,11 @@
13 #![allow(deprecated)]
14 #![deny(missing_docs)]
15
16-use std::collections::{hash_map, HashMap};
17+use std::collections::HashMap;
18 use std::env;
19 use std::ffi::{OsStr, OsString};
20 use std::fmt::{self, Display, Formatter};
21 use std::fs;
22-use std::hash::Hasher;
23 use std::io::{self, BufRead, BufReader, Read, Write};
24 use std::path::{Component, Path, PathBuf};
25 use std::process::{Child, Command, Stdio};
26@@ -1037,24 +1036,7 @@
27
28 let mut objects = Vec::new();
29 for file in self.files.iter() {
30- let obj = if file.has_root() {
31- // If `file` is an absolute path, prefix the `basename`
32- // with the `dirname`'s hash to ensure name uniqueness.
33- let basename = file
34- .file_name()
35- .ok_or_else(|| Error::new(ErrorKind::InvalidArgument, "file_name() failure"))?
36- .to_string_lossy();
37- let dirname = file
38- .parent()
39- .ok_or_else(|| Error::new(ErrorKind::InvalidArgument, "parent() failure"))?
40- .to_string_lossy();
41- let mut hasher = hash_map::DefaultHasher::new();
42- hasher.write(dirname.to_string().as_bytes());
43- dst.join(format!("{:016x}-{}", hasher.finish(), basename))
44- .with_extension("o")
45- } else {
46- dst.join(file).with_extension("o")
47- };
48+ let obj = dst.join(file).with_extension("o");
49 let obj = if !obj.starts_with(&dst) {
50 dst.join(obj.file_name().ok_or_else(|| {
51 Error::new(ErrorKind::IOError, "Getting object file details failed.")
52Index: rustc-1.77.0-src/vendor/cc-1.0.79/.cargo-checksum.json
53===================================================================
54--- a/vendor/cc-1.0.79/.cargo-checksum.json
55+++ b/vendor/cc-1.0.79/.cargo-checksum.json
56@@ -1 +1 @@
57-{"files":{"Cargo.lock":"dddb9c49058d411a098e98dc1c06e3bc89f859a2080d96c11b11aec67394bb8c","Cargo.toml":"1953a8bc4b98e351fe75917c151b1e08a46531d562aebba25a90add4aadecac2","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"58af5106352aafa62175a90f8a5f25fa114028bf909220dc0735d79745999ec1","src/bin/gcc-shim.rs":"36dc4e447428e73c548cc7106ca1e8f282c098463b014e13a729a44445de4880","src/com.rs":"29d0dee08a656ab1a4cc3e5fe24542e0fab5c1373cbc9b05059f7572cf9b8313","src/lib.rs":"17a4659710aa290c4ed9c23063c7b202c5bcf2a84de33aa1f01fc6fded69a1f8","src/registry.rs":"98ae2b71781acc49297e5544fa0cf059f735636f8f1338edef8dbf7232443945","src/setup_config.rs":"72deaf1927c0b713fd5c2b2d5b8f0ea3a303a00fda1579427895cac26a94122d","src/vs_instances.rs":"2d3f8278a803b0e7052f4eeb1979b29f963dd0143f4458e2cb5f33c4e5f0963b","src/winapi.rs":"e128e95b2d39ae7a02f54a7e25d33c488c14759b9f1a50a449e10545856950c3","src/windows_registry.rs":"1f973f804b4b451e48ff6d98ce660355772f164dfdf79a6ae514645c7c764005","tests/cc_env.rs":"e02b3b0824ad039b47e4462c5ef6dbe6c824c28e7953af94a0f28f7b5158042e","tests/cflags.rs":"57f06eb5ce1557e5b4a032d0c4673e18fbe6f8d26c1deb153126e368b96b41b3","tests/cxxflags.rs":"c2c6c6d8a0d7146616fa1caed26876ee7bc9fcfffd525eb4743593cade5f3371","tests/support/mod.rs":"a3c8d116973bb16066bf6ec4de5143183f97de7aad085d85f8118a2eaac3e1e0","tests/test.rs":"61fb35ae6dd5cf506ada000bdd82c92e9f8eac9cc053b63e83d3f897436fbf8f"},"package":"50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"}
58\ No newline at end of file
59+{"files":{"Cargo.lock":"dddb9c49058d411a098e98dc1c06e3bc89f859a2080d96c11b11aec67394bb8c","Cargo.toml":"1953a8bc4b98e351fe75917c151b1e08a46531d562aebba25a90add4aadecac2","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"58af5106352aafa62175a90f8a5f25fa114028bf909220dc0735d79745999ec1","src/bin/gcc-shim.rs":"36dc4e447428e73c548cc7106ca1e8f282c098463b014e13a729a44445de4880","src/com.rs":"29d0dee08a656ab1a4cc3e5fe24542e0fab5c1373cbc9b05059f7572cf9b8313","src/lib.rs":"dfb36b17362e9a5b266cb19a229d982e8c0bba784b1e99769f690692b0cd5c4e","src/registry.rs":"98ae2b71781acc49297e5544fa0cf059f735636f8f1338edef8dbf7232443945","src/setup_config.rs":"72deaf1927c0b713fd5c2b2d5b8f0ea3a303a00fda1579427895cac26a94122d","src/vs_instances.rs":"2d3f8278a803b0e7052f4eeb1979b29f963dd0143f4458e2cb5f33c4e5f0963b","src/winapi.rs":"e128e95b2d39ae7a02f54a7e25d33c488c14759b9f1a50a449e10545856950c3","src/windows_registry.rs":"1f973f804b4b451e48ff6d98ce660355772f164dfdf79a6ae514645c7c764005","tests/cc_env.rs":"e02b3b0824ad039b47e4462c5ef6dbe6c824c28e7953af94a0f28f7b5158042e","tests/cflags.rs":"57f06eb5ce1557e5b4a032d0c4673e18fbe6f8d26c1deb153126e368b96b41b3","tests/cxxflags.rs":"c2c6c6d8a0d7146616fa1caed26876ee7bc9fcfffd525eb4743593cade5f3371","tests/support/mod.rs":"a3c8d116973bb16066bf6ec4de5143183f97de7aad085d85f8118a2eaac3e1e0","tests/test.rs":"61fb35ae6dd5cf506ada000bdd82c92e9f8eac9cc053b63e83d3f897436fbf8f"},"package":"50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"}
diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc
index 50d94662ec..dff95ec322 100644
--- a/meta/recipes-devtools/rust/rust-source.inc
+++ b/meta/recipes-devtools/rust/rust-source.inc
@@ -12,6 +12,7 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n
12 file://rustdoc-repro-issue-fix-cargo-config-for-codegenunits.patch;patchdir=${RUSTSRC} \ 12 file://rustdoc-repro-issue-fix-cargo-config-for-codegenunits.patch;patchdir=${RUSTSRC} \
13 file://cross-targets-backport.patch;patchdir=${RUSTSRC} \ 13 file://cross-targets-backport.patch;patchdir=${RUSTSRC} \
14 file://rust-oe-selftest.patch;patchdir=${RUSTSRC} \ 14 file://rust-oe-selftest.patch;patchdir=${RUSTSRC} \
15 file://repro-issue-fix-with-cc-crate-hashmap.patch;patchdir=${RUSTSRC} \
15" 16"
16SRC_URI[rust.sha256sum] = "805482b436442a6786d270cacbab8f00529e06141b27b7fb01909b97ce4f3464" 17SRC_URI[rust.sha256sum] = "805482b436442a6786d270cacbab8f00529e06141b27b7fb01909b97ce4f3464"
17 18