On 18-02-2025 19:14, Alexander Kanavin wrote:
CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know
the content is safe.
On Tue, 18 Feb 2025 at 14:34, Varatharajan, Deepesh via
lists.openembedded.org
<[email protected]> wrote:
Rust stable version updated to 1.82.0.
https://blog.rust-lang.org/2024/10/17/Rust-1.82.0.html
Thanks. While it's good to have working recipes for each major rust
release, we're kind of falling behind upstream. Should we just jump
directly to latest rust?
---
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
@@ -1,4 +1,4 @@
-rust: reproducibility issue fix with v1.81
+rust: reproducibility issue fix with v1.82
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.
By the following changes same hash values will be genarted even for diffrent
build paths.
@@ -65,6 +65,92 @@ index fe919a5239..2b1f442019 100644
})?
.to_string_lossy();
++ // Function to find the position of the first occurrence of the
target substring
++ fn find_target_position(s: &str, targets: &[&str]) -> Option<usize> {
++ let mut pos = None;
++ for target in targets {
++ if let Some(index) = s.rfind(target) {
++ //If a target is found and pos is None, set it
++ if pos.is_none() || index < pos.unwrap() {
++ pos = Some(index);
++ }
++ }
++ }
++ pos
++ }
++
++ let filtered_dirname = if let Some(pos) = find_target_position(&dirname,
&target_substring) {
++ dirname[pos..].to_string() //Keep everything from the target
substring onwards
++ } else {
++ dirname.to_string() //If target substring is not found, keep the
original dirname
++ };
+ // Hash the dirname. This should prevent conflicts if we have multiple
+ // object files with the same filename in different subfolders.
+ let mut hasher = hash_map::DefaultHasher::new();
+- hasher.write(dirname.to_string().as_bytes());
++ hasher.write(filtered_dirname.as_bytes());
+ let obj = dst
+ .join(format!("{:016x}-{}", hasher.finish(), basename))
+ .with_extension("o");
repro-issue-fix-with-cc-crate-hashmap.patch header/commit message
should be updated to explain what this new code (added to the patch)
is for. There's presumably a problem with dirnames, what the code is
doing to address it?
Alex
Hi Alex,
There are few new CC crate versions, so the patch is adapted for newer
versions.
Previously, the hashes were generated for the absolute paths, which
causes different hashes to generate and so the reproducible builds are
failed.
With this patch the hashes were generated for relative build paths,
which makes the unique hashes to generate.
Regards,
Deepesh
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#211627):
https://lists.openembedded.org/g/openembedded-core/message/211627
Mute This Topic: https://lists.openembedded.org/mt/111250269/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-