Bug 1981729

Summary: util-linux-2.37-2.fc35 FTBFS: configure: error: raw selected, but required raw.h header file not available
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jonathan, kzak, ppisar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://koschei.fedoraproject.org/package/util-linux
Whiteboard:
Fixed In Version: util-linux-2.37-5.fc35 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-14 16:32:09 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: 1890881, 1927309, 1965025    
Attachments:
Description Flags
disabling raw none

Description Tomáš Hrnčiar 2021-07-13 08:26:52 UTC
Description of problem:
Package util-linux fails to build from source in Fedora rawhide.

Version-Release number of selected component (if applicable):
2.37-2.fc35

Steps to Reproduce:
koji build --scratch f35 util-linux-2.37-2.fc35.src.rpm

Additional info:
This package is tracked by Koschei. See:
https://koschei.fedoraproject.org/package/util-linux

Comment 1 Petr Pisar 2021-07-14 09:43:48 UTC
From the build.log:

checking for syscall pivot_root... SYS_pivot_root
configure: error: raw selected, but required raw.h header file not available
error: Bad exit status from /var/tmp/rpm-tmp.GltSyY (%build)

A difference between passing and failing build root is at <https://koschei.fedoraproject.org/build/10647191>. Probably triggered by a new kernel-headers or glibc-devel.

We are rebuilding util-linux in f35-build-side-43569 side-tag for an incompatible pcre2. I would appreciate a quick fix.

Comment 2 Petr Pisar 2021-07-14 14:21:37 UTC
This is triggered by upgrading kernel-headers from 5.13.0-1.fc35 to 5.14.0-0.rc1.git0.1... <linux/raw.h> (built from include/uapi/linux/raw.h) was removed.

Comment 3 Petr Pisar 2021-07-14 14:35:37 UTC
The deprecated raw driver was removed from Linux
<https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.14-rc1&id=603e4922f1c81fc2ed3a87b4f91a8d3aafc7e093>:

The raw driver used to provide direct unbuffered access to block devices
before O_DIRECT was invented.  It has been obsolete for more than a
decade.

Acked-by: Greg Kroah-Hartman <gregkh>
Acked-by: Arnd Bergmann <arnd>
Link: https://lore.kernel.org/lkml/Pine.LNX.4.64.0703180754060.6605@CPE00045a9c397f-CM001225dbafb6/
Signed-off-by: Christoph Hellwig <hch>
Link: https://lore.kernel.org/r/20210531072526.97052-1-hch@lst.de
Signed-off-by: Greg Kroah-Hartman <gregkh>

It's time to --disable-raw. If you don't object, I will do it in F35 together with all the raw hacks in a spec file.

Comment 4 Petr Pisar 2021-07-14 14:52:43 UTC
There is another build failure:

gcc -DHAVE_CONFIG_H -I.  -include config.h -I./include -DLOCALEDIR=\"/usr/share/locale\" -D_PATH_RUNSTATEDIR=\"/run\" -D_PATH_SYSCONFSTATICDIR=\"/usr/lib\"    -fsigned-char -fno-common -Wall -Wextra -Waddress-of-packed-member -Wdiscarded-qualifiers -Wimplicit-function-declaration -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wno-missing-field-initializers -Wpointer-arith -Wredundant-decls -Wsign-compare -Wstrict-prototypes -Wtype-limits -Wuninitialized -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-parameter -Wunused-result -Wunused-variable -Werror=sequence-point -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -c -o login-utils/login.o login-utils/login.c
login-utils/login.c: In function 'initialize':
login-utils/login.c:1361:9: error: too few arguments to function 'close_range'
 1361 |         close_range(STDERR_FILENO + 1, ~0U);
      |         ^~~~~~~~~~~
In file included from /usr/include/unistd.h:1205,
                 from /usr/include/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /usr/include/sys/param.h:28,
                 from login-utils/login.c:29:
/usr/include/bits/unistd_ext.h:56:12: note: declared here
   56 | extern int close_range (unsigned int __fd, unsigned int __max_fd,
      |            ^~~~~~~~~~~

close_range() delivered with glibc-headers-x86-2.33.9000-42.fc35.noarch has three arguments,
the last one is flags (CLOSE_RANGE_CLOEXEC or CLOSE_RANGE_UNSHARE). Since login-utils/login.c
is not multi-threaded a 0 flag is good enough.

Comment 5 Karel Zak 2021-07-14 14:58:08 UTC
I'll fix it. (Sorry, for the delay. I had a vacation yesterday)

Comment 6 Petr Pisar 2021-07-14 15:06:55 UTC
Created attachment 1801538 [details]
disabling raw

For you convenience, this dist-git patch should disable the raw support.

Comment 7 Petr Pisar 2021-07-14 15:12:43 UTC
(In reply to Karel Zak from comment #5)
> I'll fix it. (Sorry, for the delay. I had a vacation yesterday)

Thanks. Reassigning to you.

It seems glibc added the wrapper for close_range(2). The syscall has 3 arguments even
in Linux 5.13. So I believe it's only a clash with the prototype and a definition in
include/fileutils.h should be corrected.

Comment 8 Karel Zak 2021-07-14 16:32:09 UTC
Changes in util-linux-2.37-5.fc35 (https://koji.fedoraproject.org/koji/taskinfo?taskID=71887404):

* removed dependence on PCRE2 - hardlink is able to use libc regex.h (which is good enough for now)
  upstream: https://github.com/karelzak/util-linux/commit/be199d34f2698119ea03b4d583421cabcd565980

* fixed the close_range() issue
  upstream: https://github.com/karelzak/util-linux/commit/b8d99a618baffb4fc03cda4c40e29778b6d77ad4

* removed raw(8)

Thanks guys!