LTO status (thin vs fat) pollutes the metadata for dependencies #8343
Labels
A-lto
Area: link-time optimization
A-rebuild-detection
Area: rebuild detection and fingerprinting
C-bug
Category: bug
S-triage
Status: This issue is waiting on initial triage.
Problem
Given a Cargo.toml where the profiles are configured to only differ in LTO, I would expect to be able to share dependencies between different profiles (e.g. via sccache), as I wouldn't typically expect LTO to influence dependencies.
Steps
cargo build --verbose
andcargo build --verbose --release
and compare the metadata for byteorderPossible Solution(s)
After a quick look - metadata is derived from
comparable()
on aProfile
, which looks at the profile lto, rather than the computed lto for that unit. A solution could be to use the computed lto instead.Alternatively, this issue may just be a wontfix given that we now would expect lto to make dependencies look different (once #8337 is fixed).
This said - even if it is a wontfix, it may be worth using the computed lto anyway as it's strictly speaking more reflective of the logic within cargo than using the profile lto (i.e. if you switch the lto option in your profile but it doesn't actually have an effect on the unit, you don't need to recompile).
Notes
Output of
cargo version
:The text was updated successfully, but these errors were encountered: