Bug 1902514

Summary: Conditionals for %{?_enable_debug_packages} and %{with benchtests} seem to be mixed up
Product: [Fedora] Fedora Reporter: Robert Scheck <redhat-bugzilla>
Component: glibcAssignee: DJ Delorie <dj>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: aoliva, arjun, ashankar, codonell, dj, fweimer, law, mfabian, mnewsome, pfrankli, rth, sipoyare
Target Milestone: ---Keywords: Bugfix
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glibc-2.32.9000-23.fc34 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-01-19 12:48:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2020989    

Description Robert Scheck 2020-11-29 21:04:03 UTC
Description of problem:
It seems like the conditionals for %{?_enable_debug_packages} and %{with benchtests} have been mixed up in the spec file. Building with "--define '_enable_debug_packages 0' --without benchtests" leads to build failures.

Version-Release number of selected component (if applicable):
glibc-2.28-127.el8

How reproducible:
Everytime with "--define '_enable_debug_packages 0' --without benchtests" options at build-time.

Actual results:
--- 8< ---
--- glibc.spec
+++ glibc.spec.rsc
@@ -1514,8 +1514,8 @@ cp benchtests/scripts/benchout.schema.json %{glibc_sysroot}%{_prefix}/libexec/gl
 cp benchtests/scripts/compare_bench.py %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/
 cp benchtests/scripts/import_bench.py %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/
 cp benchtests/scripts/validate_benchout.py %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/
+%endif
 
-%if 0%{?_enable_debug_packages}
 # The #line directives gperf generates do not give the proper
 # file name relative to the build directory.
 pushd locale
@@ -1875,6 +1875,7 @@ test $(wc -l < libnsl.filelist) -eq 1
 # glibc-benchtests
 ###############################################################################
 
+%if %{with benchtests}
 # List of benchmarks.
 find build-%{target}/benchtests -type f -executable | while read b; do
        echo "%{_prefix}/libexec/glibc-benchtests/$(basename $b)"
@@ -1899,6 +1900,7 @@ echo "%{_libdir}/libpthread_nonshared.a" >> compat-libpthread-nonshared.filelist
 # glibc-debuginfocommon, and glibc-debuginfo
 ###############################################################################
 
+%if 0%{?_enable_debug_packages}
 find_debuginfo_args='--strict-build-id -g -i'
 %ifarch %{debuginfocommonarches}
 find_debuginfo_args="$find_debuginfo_args \
--- 8< ---

Expected results:
Above patch or better being applied to glibc.spec

Comment 1 Carlos O'Donell 2020-11-30 17:08:13 UTC
Thanks for the report.

We need to resolve this in Fedora first so I'm moving this to Fedora and then we can backport this into RHEL as required.

Comment 5 DJ Delorie 2020-12-16 21:25:44 UTC
I applied a slightly different, but fully tested, patch to Fedora's spec file.

Comment 7 Carlos O'Donell 2021-01-19 12:48:22 UTC
DJ fixed this with committ 2410c90637aa98f6ce116cfed5dd6ed742b6341d.