Bug 1983645 - firefox: FTBFS with Python 3.10 in rawhide due to collections.abc change
Summary: firefox: FTBFS with Python 3.10 in rawhide due to collections.abc change
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: firefox
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Gecko Maintainer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1976892
TreeView+ depends on / blocked
 
Reported: 2021-07-19 10:49 UTC by Florian Weimer
Modified: 2021-07-23 11:05 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-07-23 11:05:35 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Failed patch attempt (28.22 KB, patch)
2021-07-19 15:01 UTC, Florian Weimer
no flags Details | Diff
collections.abc and dynamic stack sizes patch (29.69 KB, patch)
2021-07-20 07:10 UTC, Florian Weimer
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Mozilla Foundation 1719144 0 -- RESOLVED Various python errors with python 3.10 2021-07-19 11:54:04 UTC

Description Florian Weimer 2021-07-19 10:49:27 UTC
Build firefox results in Python exceptions like this one:

Traceback (most recent call last):
  File "/builddir/build/BUILD/firefox-90.0/./mach", line 153, in <module>
    main(sys.argv[1:])
  File "/builddir/build/BUILD/firefox-90.0/./mach", line 145, in main
    mach = check_and_get_mach(os.path.dirname(os.path.realpath(__file__)))
  File "/builddir/build/BUILD/firefox-90.0/./mach", line 132, in check_and_get_mach
    return load_mach(dir_path, mach_path)
  File "/builddir/build/BUILD/firefox-90.0/./mach", line 120, in load_mach
    return mach_bootstrap.bootstrap(dir_path)
  File "/builddir/build/BUILD/firefox-90.0/build/mach_bootstrap.py", line 228, in bootstrap
    import mach.main
  File "/builddir/build/BUILD/firefox-90.0/python/mach/mach/main.py", line 19, in <module>
    from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections' (/usr/lib64/python3.10/collections/__init__.py)

It is related to to the collections → collections.abc move that was completed in Python 3.10: 
https://docs.python.org/3.10/whatsnew/3.10.html#removed

This blocks the fix of bug 1976892 in rawhide, which in turn blocks further glibc updates in rawhide (including the upgrade to glibc 2.34).

I'm testing a patch.

Comment 1 Antonio T. sagitter 2021-07-19 11:51:38 UTC
I'm using this patch [1] for IceCat (firefox-78.12.0ESR), but the build is still failing:

13:35.16 /builddir/build/BUILD/icecat-78.12.0/security/sandbox/linux/launch/SandboxLaunch.cpp: In function ‘pid_t mozilla::{anonymous}::DoClone(int, __jmp_buf_tag (*)[1])’:
13:35.16 /builddir/build/BUILD/icecat-78.12.0/security/sandbox/linux/launch/SandboxLaunch.cpp:496:28: error: no matching function for call to ‘ArrayEnd(uint8_t [<anonymous>])’

I don't know if it related to the changes for Python-3.10

[1] https://src.fedoraproject.org/rpms/icecat/blob/rawhide/f/icecat-porting_to_python310.patch

Comment 2 Florian Weimer 2021-07-19 12:56:22 UTC
There's a new rawhide-specific build failure due to glibc's dynamic stack sizes:

34:54.59 /builddir/build/BUILD/firefox-90.0/js/xpconnect/src/XPCJSContext.cpp:94:5: error: call to non-‘constexpr’ function ‘long int __sysconf(int)’
34:54.59    94 |     PTHREAD_STACK_MIN < 32 * 1024 ? 32 * 1024 : PTHREAD_STACK_MIN;

Comment 3 Florian Weimer 2021-07-19 15:01:47 UTC
Created attachment 1803365 [details]
Failed patch attempt

I tried my own patch to fix this, but it failed: https://koji.fedoraproject.org/koji/taskinfo?taskID=72187459

I will try the Mozilla patch next (probably tomorrow).

Comment 4 Florian Weimer 2021-07-20 07:01:53 UTC
(In reply to Antonio T. sagitter from comment #1)
> I'm using this patch [1] for IceCat (firefox-78.12.0ESR), but the build is
> still failing:
> 
> 13:35.16
> /builddir/build/BUILD/icecat-78.12.0/security/sandbox/linux/launch/
> SandboxLaunch.cpp: In function ‘pid_t mozilla::{anonymous}::DoClone(int,
> __jmp_buf_tag (*)[1])’:
> 13:35.16
> /builddir/build/BUILD/icecat-78.12.0/security/sandbox/linux/launch/
> SandboxLaunch.cpp:496:28: error: no matching function for call to
> ‘ArrayEnd(uint8_t [<anonymous>])’
> 
> I don't know if it related to the changes for Python-3.10
> 
> [1]
> https://src.fedoraproject.org/rpms/icecat/blob/rawhide/f/icecat-
> porting_to_python310.patch

This is another dynamic stack size problem, like my problem in comment 2. I have filed bug 1983696 to track those.

Comment 5 Florian Weimer 2021-07-20 07:10:47 UTC
Created attachment 1803524 [details]
collections.abc and dynamic stack sizes patch

Comment 6 Florian Weimer 2021-07-20 10:07:48 UTC
(In reply to Florian Weimer from comment #5)
> Created attachment 1803524 [details]
> collections.abc and dynamic stack sizes patch

I'm quite happy to report that this patch results in a firefox build that works with glibc-2.33.9000-45.fc35.x86_64.

Comment 7 Antonio T. sagitter 2021-07-22 16:32:40 UTC
(In reply to Florian Weimer from comment #4)
> (In reply to Antonio T. sagitter from comment #1)
> > I'm using this patch [1] for IceCat (firefox-78.12.0ESR), but the build is
> > still failing:
> > 
> > 13:35.16
> > /builddir/build/BUILD/icecat-78.12.0/security/sandbox/linux/launch/
> > SandboxLaunch.cpp: In function ‘pid_t mozilla::{anonymous}::DoClone(int,
> > __jmp_buf_tag (*)[1])’:
> > 13:35.16
> > /builddir/build/BUILD/icecat-78.12.0/security/sandbox/linux/launch/
> > SandboxLaunch.cpp:496:28: error: no matching function for call to
> > ‘ArrayEnd(uint8_t [<anonymous>])’
> > 
> > I don't know if it related to the changes for Python-3.10
> > 
> > [1]
> > https://src.fedoraproject.org/rpms/icecat/blob/rawhide/f/icecat-
> > porting_to_python310.patch
> 
> This is another dynamic stack size problem, like my problem in comment 2. I
> have filed bug 1983696 to track those.

Is this fixed?

Comment 8 Florian Weimer 2021-07-22 16:34:23 UTC
The patch in attachment 1803524 [details] contains fixes for this bug and bug 1983696. It brings firefox back to a buildable state for me.


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