./mach -<tab> autocomplete triggers error in uniffi-bindgen-gecko-js/mach_commands.py: ModuleNotFoundError: No module named 'distutils'
Categories
(Toolkit :: UniFFI Bindings, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr128 | --- | unaffected |
| firefox132 | --- | wontfix |
| firefox133 | --- | wontfix |
| firefox134 | --- | fixed |
People
(Reporter: robwu, Assigned: bdk)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
When I press ./mach -<TAB> to trigger autocompletion, the following error is reported after a few seconds:
ModuleNotFoundError: No module named 'distutils'
This is because of import distutils.ccompiler in https://searchfox.org/mozilla-central/rev/fcf53e1685bfb990b5abc7312ac1daf617f0991f/toolkit/components/uniffi-bindgen-gecko-js/mach_commands.py#5 which was added in bug 1910404.
distutils is deprecated and should not be used (bug 1743785). It was removed from Python 3.12.
According to https://peps.python.org/pep-0632/#migration-advice, the replacement for distutils.ccompiler is setuptools.
The full log is below.
$ ./mach -Traceback (most recent call last):
File "/path/to/gecko/./mach", line 155, in main
mach = check_and_get_mach(os.path.dirname(os.path.realpath(__file__)), args)
File "/path/to/gecko/./mach", line 39, in check_and_get_mach
return load_mach(dir_path, mach_path, args)
File "/path/to/gecko/./mach", line 25, in load_mach
return mach_initialize.initialize(dir_path, args)
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "/path/to/gecko/build/mach_initialize.py", line 399, in initialize
load_commands_from_spec(command_modules_to_load, topsrcdir, missing_ok=missing_ok)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/gecko/python/mach/mach/command_util.py", line 486, in load_commands_from_spec
load_commands_from_file(Path(topsrcdir) / path)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/gecko/python/mach/mach/command_util.py", line 467, in load_commands_from_file
load_source(module_name, str(path))
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/gecko/testing/mozbase/mozfile/mozfile/mozfile.py", line 649, in load_source
loader.exec_module(module)
~~~~~~~~~~~~~~~~~~^^^^^^^^
File "<frozen importlib._bootstrap_external>", line 1022, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/path/to/gecko/toolkit/components/uniffi-bindgen-gecko-js/mach_commands.py", line 5, in <module>
import distutils.ccompiler
ModuleNotFoundError: No module named 'distutils'
Comment 1•1 year ago
|
||
Set release status flags based on info from the regressing bug 1910404
:bdk, since you are the author of the regressor, bug 1910404, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 2•1 year ago
|
||
This is deprecated and causing issues for users on Python 3.12. Changed
the code to manually find the library file rather than depending on any
library.
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 4•1 year ago
|
||
| bugherder | ||
Description
•