./mach ide vscode runs into ModuleNotFoundError: No module named 'mozilla_taskgraph' if clang is not available
Categories
(Firefox Build System :: General, defect)
Tracking
(firefox149 fixed)
| Tracking | Status | |
|---|---|---|
| firefox149 | --- | fixed |
People
(Reporter: yannis, Assigned: ahochheiden)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
On Windows, I wanted to set up an alternate checkout of Mozilla sources where I would be using MOZBUILD_STATE_PATH to have a replacement directory for ~/.mozbuild. I left the directory behind MOZBUILD_STATE_PATH empty at the start of my experiments. Then I ran ./mach ide vscode, and after some progress I ran into the following error:
0:08.83 Your build was successful!
0:00.07 'D:\mozilla-alternate\.mozbuild\srcdirs\firefox-a1b1ebaca98e\_virtualenvs\build\Scripts\python.exe' 'D:/mozilla-alternate/firefox/obj-x86_64-pc-windows-msvc\config.status' --backend Clangd
Reticulating splines...
Finished reading 2688 moz.build files in 3.48s
Read 58 gyp files in parallel contributing 3.19s to total wall time
Processed into 19947 build config descriptors in 4.12s
Clangd backend executed in 1.78s
1337 total backend files; 0 created; 1 updated; 1336 unchanged; 0 deleted
Total wall time: 13.52s; CPU time: 9.59s; Efficiency: 71%; Untracked: 4.13s
0:53.17 E Unable to locate clangd in D:/mozilla-alternate/.mozbuild/clang-tools/clang-tidy/bin.
Error running mach:
mach ide vscode
The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke ``./mach busted`` to check if this issue is already on file. If it
isn't, please use ``./mach busted file ide`` to report it. If ``./mach busted`` is
misbehaving, you can also inspect the dependencies of bug 1543241.
If filing a bug, please include the full output of mach, including this error
message.
The details of the failure are as follows:
Traceback (most recent call last):
File "D:\mozilla-alternate\firefox\python\mach\mach\main.py", line 390, in _run
return Registrar._run_command_handler(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\mozilla-alternate\firefox\python\mach\mach\registrar.py", line 124, in _run_command_handler
result = fn(instance, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "D:\mozilla-alternate\firefox\python\mozbuild\mozbuild\backend\mach_commands.py", line 107, in run
return setup_vscode_or_vscodium(ide, command_context, interactive)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\mozilla-alternate\firefox\python\mozbuild\mozbuild\backend\mach_commands.py", line 149, in setup_vscode_or_vscodium
new_settings = setup_clangd_rust_in_vscode(command_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\mozilla-alternate\firefox\python\mozbuild\mozbuild\backend\mach_commands.py", line 332, in setup_clangd_rust_in_vscode
rc = get_clang_tools(command_context, clang_tools_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\mozilla-alternate\firefox\python\mozbuild\mozbuild\backend\mach_commands.py", line 444, in get_clang_tools
from mozbuild.artifact_commands import artifact_toolchain
File "d:\mozilla-alternate\firefox\python\mozbuild\mozbuild\artifact_commands.py", line 18, in <module>
import gecko_taskgraph.main # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\mozilla-alternate\firefox\taskcluster\gecko_taskgraph\__init__.py", line 8, in <module>
from mozilla_taskgraph import register as register_mozilla_taskgraph
ModuleNotFoundError: No module named 'mozilla_taskgraph'
At first I thought I would need to add dependencies to python/sites/ide.txt (and that worked). But then, thinking about why I'm not running into this in my usual checkout, I realized the proper fix was to run ./mach bootstrap (and that also worked). It was incorrect of me to set a new MOZBUILD_STATE_PATH and not run ./mach bootstrap.
This makes me wonder why this code path thinks it's possible that clang would not be found in a reasonable setup. When clang is missing, I wonder if we should rather ask to run ./mach bootstrap, rather than try to install clang (which runs into the error above).
| Assignee | ||
Comment 1•3 months ago
|
||
Updated•3 months ago
|
Updated•3 months ago
|
Description
•