Open Bug 1736246 Opened 3 years ago Updated 3 years ago

Unable to build NSS with Python 3.10

Categories

(NSS :: Build, defect, P3)

Desktop
All

Tracking

(Not tracked)

People

(Reporter: u673061, Assigned: jschanck)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:95.0) Gecko/20100101 Firefox/95.0

Steps to reproduce:

Run ./build.sh with Python version 3.10.0 and latest gyp (gyp-0.1) from master

Actual results:

Build failed with error below:

Traceback (most recent call last):
  File "/opt/homebrew/bin/gyp", line 5, in <module>
    from gyp import script_main
  File "/opt/homebrew/lib/python3.10/site-packages/gyp/__init__.py", line 10, in <module>
    import gyp.input
  File "/opt/homebrew/lib/python3.10/site-packages/gyp/input.py", line 8, in <module>
    import gyp.common
  File "/opt/homebrew/lib/python3.10/site-packages/gyp/common.py", line 497, in <module>
    class OrderedSet(collections.MutableSet):
AttributeError: module 'collections' has no attribute 'MutableSet'

Expected results:

Should build normally

OS: Unspecified → All
Hardware: Unspecified → Desktop

Looks like gyp relies on a python feature that was deprecated in python 3.3 and removed in python 3.10:

$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import collections
>>> collections.MutableSet
<stdin>:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
<class 'collections.abc.MutableSet'>

Technically this is a gyp bug, but since gyp is unmaintained we'll need to find a workaround.

For right now, I recommend building with python 3.9.

If that's not an option, it is possible to build nss with python 3.10 and gyp-next by running GYP=/path/to/gyp-next ./build.sh.

Assignee: nobody → jschanck
Severity: -- → S4
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.