Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#74725 - Last python-setuptools update breaks Firefox builds

Attached to Project: Arch Linux
Opened by Emilio Cobos Álvarez (ecobos) - Friday, 13 May 2022, 11:31 GMT
Last edited by Antonio Rojas (arojas) - Sunday, 19 June 2022, 09:38 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Description: After updating python-setuptools to 1:60.0.0-1, I can't build Firefox anymore, with an exception that looks like:

Traceback (most recent call last):
File "/home/emilio/src/moz/gecko-2/mach", line 96, in <module>
File "/home/emilio/src/moz/gecko-2/mach", line 88, in main
mach = check_and_get_mach(os.path.dirname(os.path.realpath(__file__)))
File "/home/emilio/src/moz/gecko-2/mach", line 35, in check_and_get_mach
return load_mach(dir_path, mach_path)
File "/home/emilio/src/moz/gecko-2/mach", line 21, in load_mach
return mach_initialize.initialize(dir_path)
File "/home/emilio/src/moz/gecko-2/build/", line 153, in initialize
File "/home/emilio/src/moz/gecko-2/build/", line 93, in _activate_python_environment
from import MachSiteManager
File "/home/emilio/src/moz/gecko-2/python/mach/mach/", line 26, in <module>
from mach.requirements import (
File "/home/emilio/src/moz/gecko-2/python/mach/mach/", line 7, in <module>
from packaging.requirements import Requirement
File "/home/emilio/src/moz/gecko-2/third_party/python/packaging/packaging/", line 24, in <module>
from .markers import MARKER_EXPR, Marker
File "/home/emilio/src/moz/gecko-2/third_party/python/packaging/packaging/", line 25, in <module>
from .specifiers import InvalidSpecifier, Specifier
File "/home/emilio/src/moz/gecko-2/third_party/python/packaging/packaging/", line 14, in <module>
from .utils import canonicalize_version
File "/home/emilio/src/moz/gecko-2/third_party/python/packaging/packaging/", line 9, in <module>
from .tags import Tag, parse_tag
File "/home/emilio/src/moz/gecko-2/third_party/python/packaging/packaging/", line 7, in <module>
import distutils.util
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 674, in _load_unlocked
File "<frozen importlib._bootstrap>", line 571, in module_from_spec
File "/usr/lib/python3.10/site-packages/_distutils_hack/", line 92, in create_module
return importlib.import_module('setuptools._distutils')
File "/usr/lib/python3.10/importlib/", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/lib/python3.10/site-packages/setuptools/", line 16, in <module>
import setuptools.version
File "/usr/lib/python3.10/site-packages/setuptools/", line 1, in <module>
import pkg_resources
File "/usr/lib/python3.10/site-packages/pkg_resources/", line 3102, in <module>
class RequirementParseError(packaging.requirements.InvalidRequirement):
AttributeError: module 'packaging' has no attribute 'requirements'

Additional info:

Downgrading to 1:59.8.0-1 "fixes" it. From the stack, I suspect this has something to do with Firefox importing a third-party "packaging" module and that getting imported instead of the built-in one from `pkg_resources`. Can dig a bit more.

Steps to reproduce:

* Have a firefox checkout as described in
* ./mach build
This task depends upon

Closed by  Antonio Rojas (arojas)
Sunday, 19 June 2022, 09:38 GMT
Reason for closing:  Fixed
Comment by Andrew Crerar (andrewSC) - Friday, 13 May 2022, 14:50 GMT
FWIW someone's opened an upstream bug as well:
Comment by Imran Iqbal (myii) - Friday, 13 May 2022, 16:47 GMT
Had a related problem with -- up to `1:59.8.0-1` has been working fine. However, with `1:60.0.0-1`, hit this traceback:

Traceback (most recent call last):
File "<string>", line 4, in <module>
File "/usr/lib/python3.10/site-packages/salt/", line 138, in <module>
import salt._logging # isort:skip
File "/usr/lib/python3.10/site-packages/salt/_logging/", line 12, in <module>
from salt._logging.impl import (
File "/usr/lib/python3.10/site-packages/salt/_logging/", line 505, in <module>
import pip._internal.utils._log as pip_log_module # pylint: disable=no-name-in-module,import-error
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1002, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 945, in _find_spec
File "/usr/lib/python3.10/site-packages/_distutils_hack/", line 83, in find_spec
return method()
File "/usr/lib/python3.10/site-packages/_distutils_hack/", line 104, in spec_for_pip
if self.pip_imported_during_build():
File "/usr/lib/python3.10/site-packages/_distutils_hack/", line 115, in pip_imported_during_build
return any(
File "/usr/lib/python3.10/site-packages/_distutils_hack/", line 116, in <genexpr>
KeyError: '__file__'

Tracked it down to this issue, where the comment I've linked suggested that `60.0.3` could fix the problem:


In the meantime, `1:60.0.1-1` was released, which still wasn't working. But there's just been an update to `1:60.0.3-1`, which sure enough, has fixed the problem at my end.

Perhaps this will resolve the broken Firefox builds as well.