Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream debuginfo enablement #3040

Closed
wants to merge 3 commits into from

Conversation

ffesti
Copy link
Contributor

@ffesti ffesti commented Apr 16, 2024

! This removes the %ifnarch noarch check. We need to find a solution for this before merging (or decise it is just an optimization we don't really need)

All these years, enabling debuginfo has required distros to hijack the spec %install section with a macro like this:

%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
%%install\
%{nil}

This for a widely used, longtime upstream supported feature is just gross, and also very non-obvious, feeble and whatnot. And totally prevents the new append/prepend options from being used with %install.

Turn this isto a proper macro that drops the package definition into a .SPECPART file. This way debuginfo can be part of the %install script without messing up the parsing.

Fixes: #2204
Fixes: #1878

@ffesti ffesti marked this pull request as draft April 16, 2024 09:22
@ffesti
Copy link
Contributor Author

ffesti commented Apr 16, 2024

An alternative implementation to #3036

@pmatilai
Copy link
Member

Like #3040, this would need to pass with %_enable_debug_packages 1 in the main macros file (currently it fails a bunch).

It's an interesting solution, but I don't see making it any less magic, perhaps to the contrary.

@DaanDeMeyer
Copy link
Contributor

Would be great if #3042 could also be fixed at the same time as it touches the same logic.

ffesti added 3 commits April 22, 2024 15:53
This keep the right value for the rest of the build
All these years, enabling debuginfo has required distros to hijack the
spec %install section with a macro like this:

    %install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
    %%install\
    %{nil}

This for a widely used, longtime upstream supported feature is just
gross, and also very non-obvious, feeble and whatnot. And totally
prevents the new append/prepend options from being used with %install.

Turn this isto a proper macro in __spec_install_template that drops the
package definition into a .SPECPART file. This way debuginfo can be part
of the %install script without messing up the parsing.

Fixes: rpm-software-management#2204
Fixes: rpm-software-management#1878
@ffesti
Copy link
Contributor Author

ffesti commented Apr 22, 2024

OK, the _target_cpu issue is now papered over and debuginfo is enabled through the whole test suite. This should ow all works as expected (with the exception of the --build-in_place stuff I dd not look at)

%global __debug_package 1\
%(cat > "%{specpartsdir}/rpm-debuginfo.specpart" << EOL\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like it a whole lot more if the cat was in the template part. This is an ugly side-effect for a macro to have, eg somebody doing rpm --eval "%{debug_package}" to see what it's made of.

@@ -145,6 +145,9 @@
#%__systemd_sysusers @__SYSTEMD_SYSUSERS@
%__systemd_sysusers %{_rpmconfigdir}/sysusers.sh

# enable debug package generation
%_enable_debug_packages 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized this doesn't belong to the main macros.in, really - it should probably be in platform.in instead. For one, this is a Linux-only feature due to the ties elfutils, but also: we don't want debug packages for noarch packages, that is the place to express it. Sadly we'll still need the other noarch checks because the platform files aren't reread on spec parse recursion, but it's the right direction anyhow.

@ffesti
Copy link
Contributor Author

ffesti commented May 13, 2024

This is superseded by #3085 which solves is similarly but even a bit cleaner.

@ffesti ffesti closed this May 13, 2024
@ffesti ffesti deleted the debugenable branch June 17, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Properly upstream debuginfo enablement rpmspec does not expect debuginfo rpm for a subpackage
3 participants