Alex313031 / Mercury

Firefox fork with compiler optimizations and patches from Librewolf, Waterfox, and GNU IceCat.
https://thorium.rocks/mercury
Mozilla Public License 2.0
1.03k stars 26 forks source link

0:02.68 NameError: name 'have_unwind' is not defined when starting build with either `build.sh` or `./mach build` #73

Open formula-spectre opened 8 months ago

formula-spectre commented 8 months ago

I was trying to build Mercury on my gentoo llvm/musl desktop, but i've encountered an error when launching build.sh; ./bootstrap.sh trunk.sh setup.sh all worked okay, it's the actual build that's anomalous. I selected firefox without artifact if that is relevant.

OS: gentoo Linux Kernel version (if relevant) 5.15.72-xanmod1-1-lts system libc: musl-12.4 python version: 3.12.0 llvm version: llvm-17.0.4 full error:

./build.sh -j4

Building Mercury...

os.nice(10)
 0:00.79 W Clobber not needed.
 Config object not found by mach.
 0:01.78 Using Python 3.10.13 from /home/formula/.mozbuild/srcdirs/mozilla-unified-977a549d8e89/_virtualenvs/build/bin/python
 0:01.79 Adding configure options from /home/formula/mozilla-unified/mozconfig
 0:01.79   --enable-application=browser
 0:01.79   --disable-artifact-builds
 0:01.79   --target=x86_64-pc-linux-gnu
 0:01.79   --enable-bootstrap
 0:01.80   --enable-release
 0:01.80   --disable-debug
 0:01.80   --disable-debug-symbols
 0:01.80   --disable-debug-js-modules
 0:01.80   --disable-tests
 0:01.80   --enable-strip
 0:01.80   --enable-install-strip
 0:01.80   --enable-clang-plugin
 0:01.80   --enable-lto
 0:01.80   --enable-wasm-avx
 0:01.80   --enable-optimize=-O3 -march=x86-64-v3
 0:01.81   --enable-rust-simd
 0:01.81   --enable-hardening
 0:01.81   --enable-sandbox
 0:01.81   --enable-raw
 0:01.81   --enable-webrtc
 0:01.81   --enable-pulseaudio
 0:01.81   --enable-alsa
 0:01.81   --enable-jxl
 0:01.81   --enable-av1
 0:01.81   --enable-eme=widevine
 0:01.82   --allow-addon-sideload
 0:01.82   --with-unsigned-addon-scopes=app,system
 0:01.82   --disable-parental-controls
 0:01.82   --disable-crashreporter
 0:01.82   --disable-updater
 0:01.82   --without-wasm-sandboxed-libraries
 0:01.82   --with-app-name=mercury
 0:01.82   --with-app-basename=Mercury
 0:01.82   --with-branding=browser/branding/mercury
 0:01.83   --with-l10n-base=/home/formula/mozilla-unified/browser/locales/en-US
 0:01.83   --with-distribution-id=com.alex313031.mercury
 0:01.83   OPT_LEVEL=3
 0:01.83   RUSTC_OPT_LEVEL=3
 0:01.83   MOZ_LTO=1
 0:01.83   MOZ_PGO=1
 0:01.83   MOZ_OPTIMIZE=1
 0:01.83   MOZ_CRASHREPORTER=0
 0:01.83   AUTOCLOBBER=1
 0:01.83   RUSTC_OPT_LEVEL=3
 0:01.83   MOZ_LTO=1
 0:01.83   CFLAGS=-O3 -march=x86-64-v3
 0:01.84   MOZ_SOURCE_CHANGESET=
 0:01.84   OPT_LEVEL=3
 0:01.84   MOZ_MAKE_FLAGS=-j16
 0:01.84   MOZ_REQUIRE_SIGNING=
 0:01.84   RUSTFLAGS=-C target-feature=+avx2
 0:01.84   MOZ_INCLUDE_SOURCE_INFO=1
 0:01.84   MOZ_DATA_REPORTING=0
 0:01.84   VERBOSE=1
 0:01.84   CXXFLAGS=-O3 -march=x86-64-v3
 0:01.84   LDFLAGS=-Wl,-O3 -march=x86-64-v3
 0:01.85   CPPFLAGS=-O3 -march=x86-64-v3
 0:01.85   MOZ_PGO=1
 0:01.85   STRIP_FLAGS=--strip-debug --strip-unneeded
 0:01.85 checking for vcs source checkout... hg
 0:01.95 checking for a shell... /usr/bin/sh
 0:02.07 checking for host system type... x86_64-pc-linux-musl
 0:02.08 checking for target system type... x86_64-pc-linux-gnu
 0:02.65 Traceback (most recent call last):
 0:02.65   File "/home/formula/mozilla-unified/configure.py", line 351, in <module>
 0:02.65     sys.exit(main(sys.argv))
 0:02.65   File "/home/formula/mozilla-unified/configure.py", line 138, in main
 0:02.65     sandbox.include_file(os.path.join(os.path.dirname(__file__), "moz.configure"))
 0:02.66   File "/home/formula/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 494, in include_file
 0:02.66     exec_(code, self)
 0:02.66   File "/home/formula/mozilla-unified/python/mozbuild/mozbuild/util.py", line 56, in exec_
 0:02.66     exec(object, globals, locals)
 0:02.66   File "/home/formula/mozilla-unified/moz.configure", line 209, in <module>
 0:02.66     include("build/moz.configure/memory.configure", when="--enable-compile-environment")
 0:02.67   File "/home/formula/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 868, in include_impl
 0:02.67     self.include_file(what)
 0:02.67   File "/home/formula/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 494, in include_file
 0:02.67     exec_(code, self)
 0:02.67   File "/home/formula/mozilla-unified/python/mozbuild/mozbuild/util.py", line 56, in exec_
 0:02.68     exec(object, globals, locals)
 0:02.68   File "/home/formula/mozilla-unified/build/moz.configure/memory.configure", line 95, in <module>
 0:02.68     @depends("--enable-phc", target, have_unwind, when="--enable-jemalloc")
 0:02.68 NameError: name 'have_unwind' is not defined
*** Fix above errors and then restart with "./mach build"

note: mercurial was installed via pip in a virtualenv, version 6.5.2.
if any more context is needed I'll provide it pronto!

gz83 commented 8 months ago

Are you using the correct code branch? In addition, delete all compilation configuration files in the source code directory, and then try compilation again.

In addition, have you passed --enable-jemalloc, --enable-phc and other parameters?

Finally, have you tried configuring and compiling in a non-virtual environment?

197788 commented 8 months ago

I had the same problem. I will try it with your suggested "--enable-jemalloc, --enable-phc" parameters, @gz83. I also found an error in the bootstrap.sh script. I edited bootstrap.sh script. There is an error in line 23 and 24. the mkdir -p command should point to $HOME, but I find it is wrong.. Here's the error: mkdir -p /c/mozilla-source/ && cd /c/mozilla-source/ &&

gz83 commented 8 months ago

I had the same problem. I will try it with your suggested "--enable-jemalloc, --enable-phc" parameters, @gz83. I also found an error in the bootstrap.sh script. I edited bootstrap.sh script. There is an error in line 23 and 24. the mkdir -p command should point to $HOME, but I find it is wrong.. Here's the error: mkdir -p /c/mozilla-source/ && cd /c/mozilla-source/ &&

What I mean is don't pass these two parameters

@197788

Alex313031 commented 5 months ago

@gz83 @formula-spectre Another thing is that you are using Gentoo with Musl Libc. This falls under the Tier-3 support list of building Firefox (not good). The supported build host (ironically also for Chromium's build bots), is Ubuntu 22.04 with stock libc.