#214 detect and warn (or fix automatically) if upstream sets incompatible compiler flags
Closed: Fixed 7 months ago by decathorpe. Opened 2 years ago by decathorpe.

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.

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)

a year ago

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).

Metadata Update from @decathorpe:
- Issue set to the milestone: v24.1 (was: 24)

a year ago

Metadata Update from @decathorpe:
- Issue set to the milestone: v24.2 (was: v24.1)

a year ago

Metadata Update from @decathorpe:
- Issue set to the milestone: v24.4 (was: v24.2)

a year ago

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).

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)

7 months ago

Login to comment on this ticket.

Metadata