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

Honor _enable_debug_packages when processing files #3061

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ffesti
Copy link
Contributor

@ffesti ffesti commented Apr 24, 2024

If the automatic creation of debuginfo packages is switched off via the _enable_debug_packages macro don't touch debuginfo packages that are declared in the spec file. If the packager created those on their own we should not mess with them.

Resolves: #3057

If the automatic creation of debuginfo packages is switched off via the
_enable_debug_packages macro don't touch debuginfo packages that are
declared in the spec file. If the packager created those on their own we
should not mess with them.

Resolves: rpm-software-management#3057
@ffesti
Copy link
Contributor Author

ffesti commented Apr 24, 2024

This is currently missing a test case and is just based on reading the code.

@simo5: Can you provide a spec file for testing this?

@simo5
Copy link

simo5 commented Apr 24, 2024

@ffesti the one I worked on is a bit contrived, let me see if I can create a synthetic one form one of my Fedora packages

@simo5
Copy link

simo5 commented Apr 24, 2024

Ok here is an example, apply this diff to https://src.fedoraproject.org/rpms/pkcs11-provider

$ git diff
diff --git a/pkcs11-provider.spec b/pkcs11-provider.spec
index b254afa..993d353 100644
--- a/pkcs11-provider.spec
+++ b/pkcs11-provider.spec
@@ -1,4 +1,5 @@
 #Enable gpg signature verification
+%global debug_package %{nil}
 %bcond_with gpgcheck
 
 Name:          pkcs11-provider
@@ -61,6 +62,8 @@ autoreconf -fi
 
 %install
 %make_install
+mkdir -p %{buildroot}/usr/lib/debug
+touch %{buildroot}/usr/lib/debug/test.txt
 
 
 %check
@@ -74,6 +77,15 @@ make check || if [ $? -ne 0 ]; then cat tests/*.log; exit 1; fi;
 %doc README.md
 %{_libdir}/ossl-modules/pkcs11.so
 
+%package debuginfo
+Summary: debuginfo
+
+%description debuginfo
+description
+
+%files debuginfo
+/usr/lib/debug/test.txt
+
 
 %changelog
 %autochangelog

If you try to build you will get this error instead of test.txt package in debuginfo:

Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/simo5/rpmbuild/BUILDROOT/pkcs11-provider-0.3-3.fc41.x86_64
error: Installed (but unpackaged) file(s) found:
   /usr/lib/debug/test.txt

RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/lib/debug/test.txt

@simo5
Copy link

simo5 commented Apr 24, 2024

At the same time if you remove the two lines I added to %install (but lave everything else in place including the %files debuginfo section) instead of getting an error that the file was not found you get simply no debuginfo package created at all .. and no error.

@ffesti ffesti marked this pull request as draft May 2, 2024 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It is currently not possible to completely disable rpm own debuginfo generation code
2 participants