Bug 2167217 - netavark does not honor standard Fedora compiler flags for Rust
Summary: netavark does not honor standard Fedora compiler flags for Rust
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: netavark
Version: 38
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Lokesh Mandvekar
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-05 20:58 UTC by Fabio Valentini
Modified: 2023-02-17 18:16 UTC (History)
7 users (show)

Fixed In Version: netavark-1.5.0-4.fc37
Clone Of:
Environment:
Last Closed: 2023-02-17 18:16:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Fabio Valentini 2023-02-05 20:58:10 UTC
Currently, netavark is built without default Fedora compiler flags for Rust code (i.e. "-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now --cap-lints=warn" on Fedora 37) - essentially, the code is not fully optimized, and does not contain debuginfo or frame pointers.

RUSTFLAGS are the standard environment variable for setting compiler flags for rustc (similar to CFLAGS / CXXFLAGS / LDFLAGS), but they aren't set by default (and not yet included in %set_build_flags, but I've reported an RFE about this).

It appears that netavark Makefile hard-codes just `--release` flag for cargo, which only implies `-Copt-level=2`. This results in netavark not having valid debug symbols (explains why rpmbuild fails to generate debuginfo packages!), its code not being optimized to the same level as other Rust code in Fedora, and it not respecting other flags for better code quality and / or debuggability.

Two possible solutions might be to export RUSTFLAGS and have the build process honor these settings, or to invoke `%__cargo` instead of `cargo`, as that macro includes RUSTFLAGS (but might have other side effects).

Comment 1 Ben Cotton 2023-02-07 15:12:29 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 2 Fedora Update System 2023-02-09 12:04:18 UTC
FEDORA-2023-9871840a59 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-9871840a59

Comment 3 Fedora Update System 2023-02-10 00:31:00 UTC
FEDORA-2023-9871840a59 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-9871840a59`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-9871840a59

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2023-02-17 18:16:01 UTC
FEDORA-2023-9871840a59 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.