rust non-determinism

Bernhard M. Wiedemann bernhardout at lsmod.de
Sun Aug 4 14:00:36 UTC 2024


Hello fellow R-B-ings,

In previous months I had seen several rust-builds that were 
non-deterministic in similar ways.

Via https://github.com/pop-os/launcher/issues/230
I finally found one big clue that points to rust's default of
  codegen-units = 16 as the cause.

I'll advocate [1] to add to our (openSUSE) build envs:
export RUSTFLAGS="-C codegen-units=1"
that helps for many of these cases.

In my measurements, it only needs 5-10% longer to compile on a 4-core-VM 
and some builds are even faster on 1-core VMs.
Plus the docs say, it optimizes resulting binaries better, which makes 
it a worthy trade-off.


Ciao
Bernhard M.

[1] https://github.com/openSUSE/post-build-checks/pull/65
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <http://lists.reproducible-builds.org/pipermail/rb-general/attachments/20240804/4f632016/attachment.sig>


More information about the rb-general mailing list