Subject: Re: bug#69812: Python fails to build on Alpine linux

From: Ludovic Courtès <[email-masked]>
Date: Fri, 15 Mar 2024 22:38:13 +0100

Hi!

Tomas Volf <[email-masked]> skribis:

> 0:02:13 load avg: 9.09 Re-running test_fcntl in verbose mode (matching: test_fcntl_64_bit)
> struct.pack:  b'\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
> test_fcntl_64_bit (test.test_fcntl.TestFcntl) ... ERROR
>
> ======================================================================
> ERROR: test_fcntl_64_bit (test.test_fcntl.TestFcntl)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/tmp/guix-build-python-3.10.7.drv-0/Python-3.10.7/Lib/test/test_fcntl.py", line 140, in test_fcntl_64_bit
>     fcntl.fcntl(fd, cmd, flags)
> OSError: [Errno 22] Invalid argument

This test looks like this:

--8<---------------cut here---------------start------------->8---
    def test_fcntl_64_bit(self):
        # Issue #1309352: fcntl shouldn't fail when the third arg fits in a
        # C 'long' but not in a C 'int'.
        try:
            cmd = fcntl.F_NOTIFY
            # This flag is larger than 2**31 in 64-bit builds
            flags = fcntl.DN_MULTISHOT
        except AttributeError:
            self.skipTest("F_NOTIFY or DN_MULTISHOT unavailable")
        fd = os.open(os.path.dirname(os.path.abspath(TESTFN)), os.O_RDONLY)
        try:
            fcntl.fcntl(fd, cmd, flags)
        finally:
            os.close(fd)
--8<---------------cut here---------------end--------------->8---

I suspect this is due to:

  # CONFIG_DNOTIFY is not set

On Guix System, I have:

--8<---------------cut here---------------start------------->8---
$ zgrep CONFIG_DNOTIFY /proc/config.gz
CONFIG_DNOTIFY=y
$ uname -r
6.6.18-gnu
--8<---------------cut here---------------end--------------->8---

:-/

Ludo’.