Bug 2343113

Summary: which breakage in Rawhide
Product: [Fedora] Fedora Reporter: Jerry James <loganjerry>
Component: whichAssignee: Than Ngo <than>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: than
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: which-2.22-2.fc42 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-01 23:16:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jerry James 2025-01-30 23:31:17 UTC
Koschei reports that several packages I maintain have started failing to build in the last few days.  Each of these packages invokes which at some point during the build.  The latest version of which behaves oddly.  For example, the 4ti2 package has a subdirectory named doc.  During the build, the current directory is changed to doc, and the command `../src/zsolve/hilbert --help` is invoked to get the help text for the hilbert command.

The hilbert command is a script that starts with:

SCRIPT=`which "$0"`
SCRIPTDIR=`dirname "$SCRIPT"`

With which 2.21, the values were:

SCRIPT=/builddir/build/BUILD/4ti2-1.6.10-build/4ti2-1.6.10/doc/../src/zsolve/hilbert
SCRIPTDIR=/builddir/build/BUILD/4ti2-1.6.10-build/4ti2-1.6.10/doc/../src/zsolve

With which 2.22, they are instead:

SCRIPT=/builddir/build/BUILD/4ti2-1.6.10-build/4ti2-1.6.10/docsrc/zsolve/hilbert
SCRIPTDIR=/builddir/build/BUILD/4ti2-1.6.10-build/4ti2-1.6.10/docsrc/zsolve

That SCRIPTDIR doesn't exist, causing the build to fail.  What happened to the "/../" between "doc" and "src"?

Reproducible: Always

Steps to Reproduce:
1. fedpkg clone 4ti2
2. cd 4ti2
3. fedpkg srpm
4. mock -r fedora-rawhide-x86_64 --rebuild 4ti2-1.6.10-15.fc42.src.rpm
Actual Results:  
The build fails due to the which command returning a bogus value.

Expected Results:  
The which command should continue to return correct values, as it did in prior versions.

Comment 1 Than Ngo 2025-02-01 21:42:05 UTC
I can reproduce your reported issue. Thanks for your report

Comment 2 Fedora Update System 2025-02-01 21:44:32 UTC
FEDORA-2025-6cb996b82c (which-2.22-2.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-6cb996b82c

Comment 3 Fedora Update System 2025-02-01 23:16:52 UTC
FEDORA-2025-6cb996b82c (which-2.22-2.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.