openSUSE-Rust / openSUSE-Rust/cargo-packaging
Add option to easily allow overriding the debug level
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
Some package use a crazy amount of memory when linking with debuginfo=2. So much memory actually that linking them on a 48GB VM OOMs. Building those packages with a debuginfo level of 1 fixes that issue. To make it easier to achieve that in a package I would like to suggest to change the build_rustflags macro like shown below.
%cargo_debug_level 2
%build_rustflags -Clink-arg=-Wl,-z,relro,-z,now -C debuginfo=%{cargo_debug_level} -C strip=none
This would allow the user to just pass in
%global cargo_debug_level 1
debug level 1 still generates debuginfo packages after the build so might be sufficient for a distro package. So we could maybe even consider changing the default to 1.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the build_rustflags macro and read how its current debuginfo setting is defined and tested. Verify that a cargo_debug_level override changes the generated flag while retaining the existing default behavior, then run the relevant packaging tests or build checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100