Closed Bug 1769205 Opened 2 years ago Closed 2 years ago

Mach commands are broken with python-setuptools 60.0 and newer ("AttributeError: module 'packaging' has no attribute 'requirements'")

Categories

(Firefox Build System :: Mach Core, defect)

Desktop
Linux
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: fredbezies, Unassigned)

References

Details

Attachments

(1 file)

Attached file mach-errorlog.txt

Hello.

Yesterday, Archlinux upgraded python-setuptools to version 60.0. When I tried to build a freshly updated copy of Mozilla Firefox Nightly, mach stop right after it is stared.

There is a big error log in Python provided in an attachment of this bug report. The only fix for now is to downgrade to python-setuptools 58.9.0.

Of course, every single mach command is broken.

Are you setting MACH_USE_SYSTEM_PYTHON or MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE?

(In reply to Mike Hommey [:glandium] from comment #1)

Are you setting MACH_USE_SYSTEM_PYTHON or MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE?

None of them. I did not modify anything related to mach. I just run ./mach build and the error log appeared.

I just tried this which seems to have helped; at least the build is running:

diff --git c/build/mach_initialize.py i/build/mach_initialize.py
index 696bc05eee7dc..fec325f876f3f 100644
--- c/build/mach_initialize.py
+++ i/build/mach_initialize.py
@@ -135,13 +135,17 @@ def initialize(topsrcdir):
 
     # We need the "mach" module to access the logic to parse virtualenv
     # requirements. Since that depends on "packaging" (and, transitively,
-    # "pyparsing"), we add those to the path too.
+    # "pyparsing", "setuptools", "ordered_set" and "appdirs"), we add those to
+    # the path too.
     sys.path[0:0] = [
         os.path.join(topsrcdir, module)
         for module in (
             os.path.join("python", "mach"),
             os.path.join("third_party", "python", "packaging"),
             os.path.join("third_party", "python", "pyparsing"),
+            os.path.join("third_party", "python", "setuptools"),
+            os.path.join("third_party", "python", "ordered_set"),
+            os.path.join("third_party", "python", "appdirs"),
         )
     ]

adding the error message to the bug summary and to this comment, for searchability:

AttributeError: module 'packaging' has no attribute 'requirements'
Summary: Mach commands are broken with python-setuptools 60.0 and newer → Mach commands are broken with python-setuptools 60.0 and newer ("AttributeError: module 'packaging' has no attribute 'requirements'")

It seems this resolved itself with further updates. I didn't need the patch with at least setuptools 60.3.1 and 60.4.0.

(In reply to Jan Alexander Steffens [:heftig] from comment #6)

It seems this resolved itself with further updates. I didn't need the patch with at least setuptools 60.3.1 and 60.4.0.

Same here. Looks like this bug is fixed now.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: