[Rpm-maint] [rpm-software-management/rpm] Exit status of find-debuginfo should not be ignored (Issue #3215)
shtiek
notifications at github.com
Thu Jul 25 18:40:36 UTC 2024
**Is your feature request related to a problem? Please describe.**
macros.in currently ignores the exit status of find-debuginfo.sh when it is run:
```
%__debug_install_post \
%{__find_debuginfo} \\\
%{?_smp_build_ncpus:-j%{_smp_build_ncpus}} \\\
%{?_missing_build_ids_terminate_build:--strict-build-id} \\\
%{?_no_recompute_build_ids:-n} \\\
%{?_include_minidebuginfo:-m} \\\
%{?_include_gdb_index:-i} \\\
%{?_unique_build_ids:--build-id-seed "%{VERSION}-%{RELEASE}"} \\\
%{?_unique_debug_names:--unique-debug-suffix "-%{VERSION}-%{RELEASE}.%{_arch}"} \\\
%{?_unique_debug_srcs:--unique-debug-src-base "%{name}-%{VERSION}-%{RELEASE}.%{_arch}"} \\\
%{?_find_debuginfo_dwz_opts} \\\
%{?_find_debuginfo_opts} \\\
%{?_debugsource_packages:-S debugsourcefiles.list} \\\
"%{builddir}/%{?buildsubdir}" || { res=$?; %{?_find_debuginfo_exit_on_error:exit $res;} } \
%{nil}
```
If this script fails -- and it not-as-infrequently-as-I'd-like does -- the build _may_ eventually
fail, but more often than not, it is up to packagers to figure out why their newly built
packages appear to contain no debuginfo.
**Describe the solution you'd like**
I propose to (optionally) stop ignoring the exit status of find-debuginfo.sh so that any
failure immediately causes the build to fail (aka fast fail). [See additional context for
a recently reported issue that was the impetus for this RFE.]
Possible (tested) design/implementation below. This does not change the current
behavior _unless_ `_find_debuginfo_exit_on_error` is defined (for example, in
redhat-rpm-config).
```
--- rpm-4.19.92-orig/macros.in 2024-07-16 12:18:51.791519154 -0700
+++ rpm-4.19.92/macros.in 2024-07-25 10:51:16.087207090 -0700
@@ -165,7 +165,7 @@
%{?_find_debuginfo_dwz_opts} \\\
%{?_find_debuginfo_opts} \\\
%{?_debugsource_packages:-S debugsourcefiles.list} \\\
- "%{builddir}/%{?buildsubdir}"\
+ "%{builddir}/%{?buildsubdir}" || { res=$?; %{?_find_debuginfo_exit_on_error:exit $res;} } \
%{nil}
# Template for debug information sub-package.
```
NOTE: There is currently a bug in find-debuginfo.sh which causes it to never
exit with non-zero exit status with parallel invocation. I will be submitting a
bug/patch for that soon.
**Additional context**
I am a Fedora/Centos Stream/RHEL maintainer for gdb, which is used by
find-debuginfo.sh to do index generation on all binary packages shipped in
our distros. I recently got a bug that a packager was attempting to debug his
newly built RPM but no debuginfo was found.
That packager (fortunately) figured out to look back at the build logs to see that
gdb was asserting during index generation. This must have been an extremely
frustrating and time-wasting endeavor. [For those with issues.redhat.com access,
I can provide an issue#.]
As a result of this bug, I am writing a "mass prebuilder" testing script which
uses a patched redhat-rpm-config to define `_find_debuginfo_exit_on_error`
to cause builds to fail fast. With a sufficiently large number of input packages
to test, I will have some way to verify that any changes made to gdb
will not clandestinely break our buildroots.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/3215
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/issues/3215 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240725/574820bf/attachment.html>
More information about the Rpm-maint
mailing list