I found that some crates set their own compiler settings in Cargo.toml, like this:
[profile.release] lto = true codegen-units = 1 debug = 0 strip = true
(from zoxide 0.8.2)
Especially the debug = 0 and strip = true settings are problematic for our builds. Packages will build successfully, but fail during debuginfo package generation with very cryptic error messages.
debug = 0
strip = true
It would be great if we could detect this setting if crates set it, and either print a warning, or strip those incompatible settings automatically.
Doing this will likely require us to move to an actual TOML parser for reading Cargo.toml, so I'll punt this change to the v24 milestone.
Metadata Update from @decathorpe: - Issue set to the milestone: 24 (was: 23)
It might be possible to implement this in rust2rpm by using tomllib from Python 3.11+ (since warning about this would only need read-only TOML support), and only provide this functionality when running on Fedora 37 ... 🤔 (or conditionally depend on tomli if Python is too old).
tomllib
tomli
Metadata Update from @decathorpe: - Issue set to the milestone: v24.1 (was: 24)
Metadata Update from @decathorpe: - Issue set to the milestone: v24.2 (was: v24.1)
Metadata Update from @decathorpe: - Issue set to the milestone: v24.4 (was: v24.2)
This was fixed in an easier way in rust-packaging v25, which now also overrides the strip setting in addition to debug / debuginfo (both in a custom cargo profile and in the generic RUSTFLAGS environment variable).
strip
debug
debuginfo
Metadata Update from @decathorpe: - Issue close_status updated to: Fixed - Issue set to the milestone: None (was: v24.4) - Issue status updated to: Closed (was: Open)
Login to comment on this ticket.