]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
rust: restore parallel builds, disable lto only for rustdoc
authorAlexander Kanavin <alex@linutronix.de>
Tue, 4 Feb 2025 10:42:05 +0000 (11:42 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 5 Feb 2025 12:48:25 +0000 (12:48 +0000)
commita1977407a88a2004c3a6d2dba1d5bfe1aa1664b2
tree89c62ae86282657e015aaee0c3995e1882fe4d55
parent62bade83dd6e021f11e9599a2699a1b202324f0f
rust: restore parallel builds, disable lto only for rustdoc

The original reproducibility fix was problematic for a couple reasons:

- disabling both lto and parallel builds had an unfortunate effect of nearly
doubling rust-native and rust build times (which are slow to begin with).
Disabling lto hurts runtime performance too.

- both of these things were done for the *entire build*, while the only
problematic item is the librustdoc crate.

- lto=off option in config.toml has an effect only on building rustc
(the compiler itself), and doesn't help with rustdoc reproducibility.
Actual fix is the codegen-units setting, which indirectly disables
lto via giving llvm only one unit to work with at a time.

After some digging, here's a more targeted fix for the problem.

Why librustdoc is non-reproducible, but not anything else
remains a mystery, hidden deep in rust-llvm's lto optimization code.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/rust/files/0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch [new file with mode: 0644]
meta/recipes-devtools/rust/files/rustdoc-repro-issue-fix-cargo-config-for-codegenunits.patch [deleted file]
meta/recipes-devtools/rust/rust-source.inc
meta/recipes-devtools/rust/rust_1.81.0.bb