Bug 2121153 - uname -i/-p broken in mock chroots
Summary: uname -i/-p broken in mock chroots
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: fltk
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Richard Shaw
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-24 15:55 UTC by Jerry James
Modified: 2022-08-30 03:09 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-30 03:09:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jerry James 2022-08-24 15:55:02 UTC
Description of problem:
Koschei tells me that the pari package has started failing to build.  The problem is that it is no longer including -lfltk on the link line, leading to unresolved symbols.  Pari finds the link command to use by running "fltk-config --post".  In Rawhide mock, this is what happens:

$ fltk-config --post
/usr/bin/fltk-config: line 3: exec: fltk-config-unknown: not found
$ cat /usr/bin/fltk-config
#!/usr/bin/bash

exec fltk-config-$(uname -i) "$@"
$ ls /usr/bin/fltk-config*
/usr/bin/fltk-config  /usr/bin/fltk-config-x86_64
$ uname -i
unknown
$ uname -p
unknown

I see that there was a new coreutils build yesterday with this changelog entry:
* Tue Aug 23 2022 Kamil Dudka <kdudka> - 9.1-7
- remove non-upstream patch for uname -i/-p (#548834)

It appears that that non-upstream patch is needed for sane handling of uname -i/-p in mock. 

Version-Release number of selected component (if applicable):
coreutils-9.1-7.fc38

How reproducible:
Always

Steps to Reproduce:
1. mock -r fedora-rawhide-x86_64 --init
2. mock -r fedora-rawhide-x86_64 --shell
3. uname -i

Actual results:
"unknown"

Expected results:
"x86_64"

Additional info:

Comment 1 Kamil Dudka 2022-08-24 16:18:20 UTC
Thank you for pointing it out!  This seems to be a bug in the Fedora packaging of fltk.  It should use `uname -m` rather than `uname -i`, which has been documented as non-portable since 2015: http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.24-7-g6d67649

This could be trivially fixed in the packaging of fltk:

diff --git a/fltk-config.sh b/fltk-config.sh
index c70522d..499c34b 100644
--- a/fltk-config.sh
+++ b/fltk-config.sh
@@ -1,3 +1,3 @@
 #!/bin/bash

-exec fltk-config-$(uname -i) "$@"
+exec fltk-config-$(uname -m) "$@"
diff --git a/fltk.spec b/fltk.spec
index bd2053a..48a4e68 100644
--- a/fltk.spec
+++ b/fltk.spec
@@ -101,7 +101,7 @@ make docs -C %{_vpath_builddir}

 # we only apply this hack to multilib arch's
 %ifarch x86_64 %{ix86} ppc64 ppc s390x s390 sparc64 sparc
-%global arch %(uname -i 2>/dev/null || echo undefined)
+%global arch %(uname -m 2>/dev/null || echo undefined)
 mv $RPM_BUILD_ROOT%{_bindir}/fltk-config \
    $RPM_BUILD_ROOT%{_bindir}/fltk-config-%{arch}
 install -p -m755 -D %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/fltk-config

Comment 2 Fedora Admin user for bugzilla script actions 2022-08-30 00:30:26 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 3 Richard Shaw 2022-08-30 03:09:12 UTC
I wasn't aware of this bug but I noticed it separately and have already fixed and rebuilt the package for rawhide/f38.


Note You need to log in before you can comment on or make changes to this bug.