Closed Bug 1760268 Opened 4 years ago Closed 4 years ago

Cannot build on macOS due to AttributeError: module 'zstandard' has no attribute 'ZstdDecompressor'

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(firefox100 fixed)

RESOLVED FIXED
Tracking Status
firefox100 --- fixed

People

(Reporter: masayuki, Unassigned)

References

(Blocks 1 open bug)

Details

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, but anything couldn't fix this issue.

(FYI: I don't usually use macOS for building Firefox so that I'm not sure whether it's a recent regression or not.)

There's several resolved bugs with this error message, perhaps one of them has a solution?

Also, try killing your Mach virtualenv (rm -r ~/.mozbuild/srcdirs/<your-srcdir>/_virtualenvs) and try again, that may resolve it if zstandard failed to fully install.

(In reply to Timothy Nikkel (:tnikkel) from comment #2)

There's several resolved bugs with this error message, perhaps one of them has a solution?

Yeah, but I reproduced this yesterday. The similar bug was fixed 3 days ago (from yesterday).

(In reply to Mitchell Hentges [:mhentges] 🦀 from comment #3)

Also, try killing your Mach virtualenv (rm -r ~/.mozbuild/srcdirs/<your-srcdir>/_virtualenvs) and try again, that may resolve it if zstandard failed to fully install.

I tried to solve this with deleting entire ~/.mozbuild, but it didn't fix this...

I tried to solve this with deleting entire ~/.mozbuild, but it didn't fix this...

Shoot, thanks for giving it a shot :)


This might actually be related to an issue Chris Peterson was having last week, and could be solved by this patch.
Can you try importing that patch locally (moz-phab patch D141508), then try?

If that doesn't work, then this is an unrelated issue, and more information is needed.
Accordingly, can you edit the line right before File "/Volumes/dev/src/python/mozbuild/mozbuild/action/tooltool.py", line 998, in unpack_file, and add print(zstandard)? Then, run the failing command again, and share the output here.

Flags: needinfo?(masayuki)

(In reply to Mitchell Hentges [:mhentges] 🦀 from comment #5)

This might actually be related to an issue Chris Peterson was having last week, and could be solved by this patch.
Can you try importing that patch locally (moz-phab patch D141508), then try?

Oh, that's fixed this bug too (applied to the changeset which I've met this bug). Thank you!

Status: NEW → RESOLVED
Closed: 4 years ago
Depends on: 1759329
Flags: needinfo?(masayuki)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.