Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hashmap changes causing rust binary non-reproducible #1117

Open
sundeep-kokkonda opened this issue Jul 1, 2024 · 2 comments
Open

Hashmap changes causing rust binary non-reproducible #1117

sundeep-kokkonda opened this issue Jul 1, 2024 · 2 comments

Comments

@sundeep-kokkonda
Copy link

Hello,

The changes referred below are adding the rust generated objects with a unique hash extension (as I understood, this to avoid overwriting the objects with same name).
https://github.com/rust-lang/cc-rs/blob/e5bbdfa1fa468c028cb38fee6c35a3cf2e5a2736/src/lib.rs#L1040C1-L1057C15

But this change making the rust binaries are non-reproducible. The rust libs/binaries containing objects names in it and those are differed between the builds with a different hash-id. Currently as a workaround, we reverted the respective changes and that fixed the problem for us.

@NobodyXu
Copy link
Collaborator

NobodyXu commented Jul 1, 2024

Hmm maybe we could use something that is more stable for the hashing.

BTW if you need to use the object files generated, then maybe you can use cc::Build::compile_intermediates?

@mati865
Copy link
Contributor

mati865 commented Aug 11, 2024

I doubt that code is the problem, current implementation of DefaultHasher is reproducible: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a9c791e10dcddcc0a72c6a17d1b66ea1

HashMap is not because it purposely randomizes seed, but I don't see it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants