rust-lang / cc-rs

Rust library for build scripts to compile C/C++ code into a Rust library
https://docs.rs/cc
Apache License 2.0
1.76k stars 425 forks source link

Hashmap changes causing rust binary non-reproducible #1117

Open sundeep-kokkonda opened 6 days ago

sundeep-kokkonda commented 6 days ago

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 commented 6 days ago

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?