Here is what we know so far: while the libxul.so usually matches between different builds if one tries hard enough (building over and over again) one gets different libraries. Looking at the diff shows that gkrust-f4d3d8c9a1eaf037.gkrust.eac5ce9j-cgu.0.rcgu.o is different from non-matching builds.
might be interesting as those to lines are the only difference in that particular block: in the first build they are at the end while they are at the beginning of the second one.
Either way: Alex/Manish: is there anything know on Rust's side that could be causing that? That's with ESR 68 and the self-compiled Rust 1.34.2. Any ideas what we could try to get a smaller testcase/scenario to reproduce the bug would be highly appreciated as well. :)
Back then in #26475 (moved) we had been fighting Rust related reproducibility issues but I double-checked that this bug is something different.
Thanks for the cc and for the investigation into this! This looks like it's either a compiler but or a bug in the build system because the Rust object file is what's changing here. A compiler bug could definitely cause it but there may also be something nondeterministic being fed into rustc (e.g. generated code or something like that).
I don't know of rustc bugs off-hand (although I'm not exactly all-knowing!). In terms of minimization I think the "easiest" way would be to start playing whack-a-mole with code. Basically get to a point where you can edit the gkrust crate and then delete code incrementally until you can't get a compile difference.
If this is a build system bug then you may need to trace the nondeterministic codegen back further from gkrust, since generics may be getting monomorphized into gkrust itself.
In the firsts two tests, I always got a non-matching build on the 2nd build. The third time however, there was 7 matching builds with checksum 6ced1d29d0cf7b34a1a7841e560a8a219e3bce103f6b3a1d0069702f41c00ca2, and the 8th one with checksum a88ee40a2c92ca8fcb48b984f13a5e24ced66b9d1fc32edc60fc4e17860dbcdc.
This seems to make the issue appears less frequently, as on the first test I got 20 matching builds. However on the second test I only got 12 matching builds (with checksum 2065ceebe53073eea3114690a581486e03b89259aedb333bad77f1aac08595f2), and a 13th one with checksum 4b2b8fb088b5d30b45127612e84050223a73f4fc6a8a2a001367f1291b54890e. On the third try, I got 20 builds matching 2065ceebe53073eea3114690a581486e03b89259aedb333bad77f1aac08595f2.
Okay, I looked at it closer by examining the intermediate output as done in #32053 (moved) and it seems both tickets are in fact duplicates: the linux builds have proper non-optimized bytecode but the optimization is not done deterministically either. Closing and having #32053 (moved) as the sole one for this issue.
Trac: Status: new to closed Resolution: N/Ato duplicate