Bug 1760268 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I try to build Firefox on macOS Monterey (Intel), `./mach build` fails with this error:
```
 0:20.13 Installing bootstrapped toolchain in /Users/<username>/.mozbuild/sysroot-wasm32-wasi
 0:21.64 Setting up artifact sysroot-wasm32-wasi.tar.zst
 0:21.64 Using artifact from local cache: /Users/<username>/.mozbuild/toolchains/12a5ca2d8228737a-sysroot-wasm32-wasi.tar.zst
 0:21.66 untarring "/Users/<username>/.mozbuild/sysroot-wasm32-wasi.tar.zst"
 0:22.12 Error running mach:
 0:22.12     ['--log-no-times', 'artifact', 'toolchain', '--from-task', 'PHFcy2oVRimUXEYgLJIhZg:public/build/sysroot-wasm32-wasi.tar.zst']
 0:22.12 The error occurred in code that was called by the mach command. This is either
 0:22.12 a bug in the called code itself or in the way that mach is calling it.
 0:22.12 You can invoke |./mach busted| to check if this issue is already on file. If it
 0:22.12 isn't, please use |./mach busted file artifact| to report it. If |./mach busted| is
 0:22.12 misbehaving, you can also inspect the dependencies of bug 1543241.
 0:22.12 If filing a bug, please include the full output of mach, including this error
 0:22.12 message.
 0:22.12 The details of the failure are as follows:
 0:22.12 AttributeError: module 'zstandard' has no attribute 'ZstdDecompressor'
 0:22.12   File "/Volumes/dev/src/python/mozbuild/mozbuild/artifact_commands.py", line 576, in artifact_toolchain
 0:22.12     unpack_file(local)
 0:22.12   File "/Volumes/dev/src/python/mozbuild/mozbuild/action/tooltool.py", line 998, in unpack_file
 0:22.12     dctx = zstandard.ZstdDecompressor()
 0:22.12 Sentry event ID: ecb90732bc8a469ba03c9e7474512316
 0:22.22 Sentry is attempting to send 1 pending error messages
 0:22.22 Waiting up to 2 seconds
 0:22.22 Press Ctrl-C to quit
 0:22.42 ERROR: Command '['/Volumes/dev/fx-dbg/_virtualenvs/build/bin/python', '/Volumes/dev/src/mach', '--log-no-times', 'artifact', 'toolchain', '--from-task', 'PHFcy2oVRimUXEYgLJIhZg:public/build/sysroot-wasm32-wasi.tar.zst']' returned non-zero exit status 1.
 0:22.43 ERROR: If you can't fix the above, retry with --disable-bootstrap.
``` 

I try to recreate my environment with updating brew, deleting `~/mozbuild`, recreating it from `bootstrap.py` as [explained in the document](https://firefox-source-docs.mozilla.org/setup/macos_build.html), but anything fixes this issue.
I try to build Firefox on macOS Monterey (Intel), `./mach build` fails with this error:
```
 0:20.13 Installing bootstrapped toolchain in /Users/<username>/.mozbuild/sysroot-wasm32-wasi
 0:21.64 Setting up artifact sysroot-wasm32-wasi.tar.zst
 0:21.64 Using artifact from local cache: /Users/<username>/.mozbuild/toolchains/12a5ca2d8228737a-sysroot-wasm32-wasi.tar.zst
 0:21.66 untarring "/Users/<username>/.mozbuild/sysroot-wasm32-wasi.tar.zst"
 0:22.12 Error running mach:
 0:22.12     ['--log-no-times', 'artifact', 'toolchain', '--from-task', 'PHFcy2oVRimUXEYgLJIhZg:public/build/sysroot-wasm32-wasi.tar.zst']
 0:22.12 The error occurred in code that was called by the mach command. This is either
 0:22.12 a bug in the called code itself or in the way that mach is calling it.
 0:22.12 You can invoke |./mach busted| to check if this issue is already on file. If it
 0:22.12 isn't, please use |./mach busted file artifact| to report it. If |./mach busted| is
 0:22.12 misbehaving, you can also inspect the dependencies of bug 1543241.
 0:22.12 If filing a bug, please include the full output of mach, including this error
 0:22.12 message.
 0:22.12 The details of the failure are as follows:
 0:22.12 AttributeError: module 'zstandard' has no attribute 'ZstdDecompressor'
 0:22.12   File "/Volumes/dev/src/python/mozbuild/mozbuild/artifact_commands.py", line 576, in artifact_toolchain
 0:22.12     unpack_file(local)
 0:22.12   File "/Volumes/dev/src/python/mozbuild/mozbuild/action/tooltool.py", line 998, in unpack_file
 0:22.12     dctx = zstandard.ZstdDecompressor()
 0:22.12 Sentry event ID: ecb90732bc8a469ba03c9e7474512316
 0:22.22 Sentry is attempting to send 1 pending error messages
 0:22.22 Waiting up to 2 seconds
 0:22.22 Press Ctrl-C to quit
 0:22.42 ERROR: Command '['/Volumes/dev/fx-dbg/_virtualenvs/build/bin/python', '/Volumes/dev/src/mach', '--log-no-times', 'artifact', 'toolchain', '--from-task', 'PHFcy2oVRimUXEYgLJIhZg:public/build/sysroot-wasm32-wasi.tar.zst']' returned non-zero exit status 1.
 0:22.43 ERROR: If you can't fix the above, retry with --disable-bootstrap.
``` 

I try to recreate my environment with updating brew, deleting `~/.mozbuild`, recreating it from `bootstrap.py` as [explained in the document](https://firefox-source-docs.mozilla.org/setup/macos_build.html), but anything couldn't fix this issue.

Back to Bug 1760268 Comment 0