Closed nanai10a closed 2 months ago
Duplicate of https://github.com/zen-browser/desktop/issues/206
@nanai10a Did you fix the profile_build_resources.json issue? I am experiencing the same thing.
@nanai10a Did you fix the profile_build_resources.json issue? I am experiencing the same thing.
@trignomtry I'm not sure this issue, so I can't. If provides (related) clue, may progress this.
Edit 1:
Edit 2:
If this issue related Firefox buildings, may PKGBUILD of ALARM's extra/firefox
helps.
Edit 3: "Edit 2" maybe really useful! I'm working on with...
Edit 4:
This includes patches for known bugs, so I applied in ./engine
(e.g. cat example.patch | git apply
).
This may works, but having problem:
00:09:07 error: could not compile `gkrust` (lib)
00:09:07 Caused by:
00:09:07 process didn't exit successfully: `/home/nanai/.local/share/rustup/toolchains/nightly-aarch64-unknown-linux-gnu/bin/rustc --crate-name gkrust --edition=2015 toolkit/library/rust/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type staticlib --emit=dep-info,link -C opt-level=2 -C panic=abort -C embed-bitcode=no -Clto --cfg 'feature="mozilla-central-workspace-hack"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("mozilla-central-workspace-hack"))' -C metadata=5b0f6c7911e445c0 -C extra-filename=-5b0f6c7911e445c0 --out-dir /home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/aarch64-unknown-linux-gnu/release/deps --target aarch64-unknown-linux-gnu -C linker=/home/nanai/desktop/engine/build/cargo-linker -C strip=debuginfo -L dependency=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/aarch64-unknown-linux-gnu/release/deps -L dependency=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/release/deps --extern gkrust_shared=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/aarch64-unknown-linux-gnu/release/deps/libgkrust_shared-86cae304fc015502.rlib --extern lmdb_sys=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/aarch64-unknown-linux-gnu/release/deps/liblmdb_sys-0e43048524e5e30e.rlib --extern mozglue_static=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/aarch64-unknown-linux-gnu/release/deps/libmozglue_static-e86a96d2131bfa6b.rlib --extern mozilla_central_workspace_hack=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/aarch64-unknown-linux-gnu/release/deps/libmozilla_central_workspace_hack-0b3dd4292950a550.rlib --extern swgl=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/aarch64-unknown-linux-gnu/release/deps/libswgl-006cd48c0324daa5.rlib -C debuginfo=2 --cap-lints warn -Cembed-bitcode=yes -C codegen-units=1 -L native=/usr/lib -L native=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/aarch64-unknown-linux-gnu/release/build/audioipc2-86340a0174874663/out -L native=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/dist/bin -L native=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/security/nss/lib/nss/nss_nss3 -L native=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/security/nss/lib/ssl/ssl_ssl3 -L native=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/config/external/nspr/pr -L native=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/aarch64-unknown-linux-gnu/release/build/lmdb-rkv-sys-63243efec1993204/out -L native=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/dist/bin -L native=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/security/nss/lib/nss/nss_nss3 -L native=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/security/nss/lib/ssl/ssl_ssl3 -L native=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/config/external/nspr/pr -L native=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/aarch64-unknown-linux-gnu/release/build/mozglue-static-a74f9327d763cd82/out -L native=/usr/lib -L native=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/dist/bin -L native=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/security/nss/lib/nss/nss_nss3 -L native=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/security/nss/lib/ssl/ssl_ssl3 -L native=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/config/external/nspr/pr -L native=/home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/aarch64-unknown-linux-gnu/release/build/swgl-26b108c0e166518c/out` (signal: 9, SIGKILL: kill)
00:09:07 make[4]: *** [/home/nanai/desktop/engine/config/makefiles/rust.mk:498: force-cargo-library-build] Error 101
00:09:07 make[3]: *** [/home/nanai/desktop/engine/config/recurse.mk:72: toolkit/library/rust/target-objects] Error 2
00:09:07 make[2]: *** [/home/nanai/desktop/engine/config/recurse.mk:34: compile] Error 2
00:09:07 make[1]: *** [/home/nanai/desktop/engine/config/rules.mk:359: default] Error 2
00:09:07 make: *** [client.mk:60: build] Error 2
00:09:07 W 221 compiler warnings present.
00:09:08 /usr/bin/notify-send '--app-name=Mozilla Build System' 'Mozilla Build System' 'Build failed'
00:09:08 /home/nanai/desktop/engine/obj-aarch64-pc-linux-gnu/config.status is out of date with respect to /home/nanai/desktop/engine/browser/config/version.txt
00:09:08 Configure complete!
00:09:08 Be sure to run |mach build| to pick up any changes
00:09:08 Parallelism determined by memory: using 10 jobs for 10 cores based on 15.0 GiB RAM and estimated job size of 1.0 GiB
Building (npm run build
) is unstable in my environment, also caused by OOM Killers, may fix with change parameters of jobs, but by running many times (3..5 times?), I encountered unreasonable problem:
00:09:07 process didn't exit successfully: `.../rustc --crate-name gkrust ...` (signal: 9, SIGKILL: kill)
This caused by OOM, and it doesn't seems related CPU usage at killed point, only memory usage is very-very highter. I use with Zram, but cannot complete job.
I think ./engine/build/cargo-linker
leaks memory, but not certain.
Please give any helps!
The following steps allow to successfully build native arm64/aarch64 on (asahi) fedora. Build time is around 9 minutes on a m2 pro.
# dependencies
sudo dnf group install -y "C Development Tools and Libraries"
sudo dnf install -y dos2unix yasm nasm gtk2-devel python3-devel m4 libuuid-devel \
alsa-lib-devel libcurl-devel dbus-devel libdrm-devel dbus-glib-devel gtk3-devel pulseaudio-libs-devel \
libX11-devel libXt-devel lld llvm clang-devel cbindgen rust-bindgen-devel rustfmt libstdc++-devel \
widevine-installer npm
# wasi-sdk provides clang with necessary wasm32_wasi target
WASI_VERSION=24
WASI_VERSION_FULL=${WASI_VERSION}.0
WASI_SDK_PATH=`pwd`/wasi-sdk-${WASI_VERSION_FULL}-arm64-linux
export WASI_SYSROOT=$WASI_SDK_PATH/share/wasi-sysroot
export WASM_CC=$WASI_SDK_PATH/bin/clang
export WASM_CXX=$WASI_SDK_PATH/bin/clang++
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-arm64-linux.tar.gz
tar xzvf wasi-sdk-${WASI_VERSION_FULL}-arm64-linux.tar.gz
# fix build error from missing bits/c++config.h include
LIBSTDC_VERSION=$(rpm -q --qf '%{VERSION}' libstdc++-devel | cut -d. -f1)
CPP_CONFIG_H_INCLUDE=/usr/include/c++/${LIBSTDC_VERSION}/aarch64-redhat-linux
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$CPP_CONFIG_H_INCLUDE
# fetch zen/ff source
git clone https://github.com/zen-browser/desktop.git --recurse-submodules
cd desktop
npm i
npm run init
# linux mozconfig
sed -i 's/x86-\(64\|64-v3\)/native/g' ./configs/linux/mozconfig
sed -i 's/x86_64-pc-linux/aarch64-linux-gnu/g' ./configs/linux/mozconfig
echo "ac_add_options --with-libclang-path=/usr/lib64" >> ./configs/linux/mozconfig
# eme/widevine must be disabled on arm64 (thx google)
sed -i '/--enable-eme/s/^/# /' ./configs/common/mozconfig
# add locales (https://github.com/zen-browser/desktop/issues/960)
sh scripts/update-en-US-packs.sh
# build and enjoy :)
npm run build
npm run start
# fix missing widevine/eme
echo -ne '\n' | sudo widevine-installer
I think GitHub actions don't have aarch64 runners for free right now. I think we can make something like the signal-desktop ARM64 builder docker container so people can easily compile it themselves.
I personally use external (paid) runners for arm builds in other projects but free github hosted ones seem to be on the horizon https://github.com/orgs/community/discussions/19197#discussioncomment-10550689.
+1 for linux arm64 build.
@ArchitektApx hello, thanks for your instructions. i followed your step but build fails with this linker error. i am also using asahi-fedora on m1 pro machine.
00:00:10 DEBUG: | clang: error: linker command failed with exit code 1 (use -v to see invocation)
00:00:10 DEBUG: Executing: `/usr/lib64/ccache/clang --sysroot /home/inu/.mozbuild/sysroot-aarch64-linux-gnu -std=gnu99 -fuse-ld=lld -Wl,-rpath-link,/home/inu/.mozbuild/sysroot-aarch64-linux-gnu/lib/aarch64-linux-gnu -Wl,-rpath-link,/home/inu/.mozbuild/sysroot-aarch64-linux-gnu/usr/lib/aarch64-linux-gnu -o /tmp/conftestt5_u_lq0.out @/tmp/conftestco6koedx.list`
00:00:10 DEBUG: The command returned non-zero exit status 1.
00:00:10 DEBUG: Its error output was:
00:00:10 DEBUG: | ld.lld: error: undefined reference due to --no-allow-shlib-undefined: pthread_getspecific@GLIBC_2.34
00:00:10 DEBUG: | >>> referenced by /lib64/libgcc_s.so.1
00:00:10 DEBUG: |
00:00:10 DEBUG: | ld.lld: error: undefined reference due to --no-allow-shlib-undefined: pthread_key_create@GLIBC_2.34
00:00:10 DEBUG: | >>> referenced by /lib64/libgcc_s.so.1
00:00:10 DEBUG: |
00:00:10 DEBUG: | ld.lld: error: undefined reference due to --no-allow-shlib-undefined: _dl_find_object@GLIBC_2.35
00:00:10 DEBUG: | >>> referenced by /lib64/libgcc_s.so.1
00:00:10 DEBUG: |
00:00:10 DEBUG: | ld.lld: error: undefined reference due to --no-allow-shlib-undefined: pthread_once@GLIBC_2.34
00:00:10 DEBUG: | >>> referenced by /lib64/libgcc_s.so.1
00:00:10 DEBUG: |
00:00:10 DEBUG: | ld.lld: error: undefined reference due to --no-allow-shlib-undefined: pthread_setspecific@GLIBC_2.34
00:00:10 DEBUG: | >>> referenced by /lib64/libgcc_s.so.1
00:00:10 DEBUG: | clang: error: linker command failed with exit code 1 (use -v to see invocation)
00:00:10 ERROR: Couldn't find one that works
00:00:10 Config object not found by mach.
00:00:10 *** Fix above errors and then restart with "./mach build"
installed the dependencies in your step, do you think i miss any? would appreciate any help.
@ArchitektApx
hello, thanks for your instructions. i followed your step but build fails with this linker error. i am also using asahi-fedora on m1 pro machine.
00:00:10 DEBUG: | clang: error: linker command failed with exit code 1 (use -v to see invocation) 00:00:10 DEBUG: Executing: `/usr/lib64/ccache/clang --sysroot /home/inu/.mozbuild/sysroot-aarch64-linux-gnu -std=gnu99 -fuse-ld=lld -Wl,-rpath-link,/home/inu/.mozbuild/sysroot-aarch64-linux-gnu/lib/aarch64-linux-gnu -Wl,-rpath-link,/home/inu/.mozbuild/sysroot-aarch64-linux-gnu/usr/lib/aarch64-linux-gnu -o /tmp/conftestt5_u_lq0.out @/tmp/conftestco6koedx.list` 00:00:10 DEBUG: The command returned non-zero exit status 1. 00:00:10 DEBUG: Its error output was: 00:00:10 DEBUG: | ld.lld: error: undefined reference due to --no-allow-shlib-undefined: pthread_getspecific@GLIBC_2.34 00:00:10 DEBUG: | >>> referenced by /lib64/libgcc_s.so.1 00:00:10 DEBUG: | 00:00:10 DEBUG: | ld.lld: error: undefined reference due to --no-allow-shlib-undefined: pthread_key_create@GLIBC_2.34 00:00:10 DEBUG: | >>> referenced by /lib64/libgcc_s.so.1 00:00:10 DEBUG: | 00:00:10 DEBUG: | ld.lld: error: undefined reference due to --no-allow-shlib-undefined: _dl_find_object@GLIBC_2.35 00:00:10 DEBUG: | >>> referenced by /lib64/libgcc_s.so.1 00:00:10 DEBUG: | 00:00:10 DEBUG: | ld.lld: error: undefined reference due to --no-allow-shlib-undefined: pthread_once@GLIBC_2.34 00:00:10 DEBUG: | >>> referenced by /lib64/libgcc_s.so.1 00:00:10 DEBUG: | 00:00:10 DEBUG: | ld.lld: error: undefined reference due to --no-allow-shlib-undefined: pthread_setspecific@GLIBC_2.34 00:00:10 DEBUG: | >>> referenced by /lib64/libgcc_s.so.1 00:00:10 DEBUG: | clang: error: linker command failed with exit code 1 (use -v to see invocation) 00:00:10 ERROR: Couldn't find one that works 00:00:10 Config object not found by mach. 00:00:10 *** Fix above errors and then restart with "./mach build"
installed the dependencies in your step, do you think i miss any?
would appreciate any help.
We're gonna try to get this building for aarch64-linux in nixpkgs. After the PR is merged the NixOS hydra build server will begin providing binary builds for aarch64-linux through the Nix package manager, so if you want to wait for that to be completed, you won't have to build it yourself.
@youwen5 i am not really into nix, can i use nix pkg manager in fedora? sorry for noob question.
@youwen5 i am not really into nix, can i use nix pkg manager in fedora? sorry for noob question.
The Nix package manager should be able to be used on any Linux OS (to my knowledge).
@ArchitektApx hello, thanks for your instructions. i followed your step but build fails with this linker error. i am also using asahi-fedora on m1 pro machine.
rm -rf
-ing the $HOME/.mozbuild
directory (which was left over from previous builds) before running npm run build
fixed the issue for me
00:00:24 checking the wasm C compiler version... 18.1.8
00:00:24 checking the wasm C compiler works... yes
00:00:24 checking the wasm C compiler can find wasi headers...
00:00:24 DEBUG: Creating `/tmp/conftest1h6796me.c` with content:
00:00:24 DEBUG: | #include <string.h>
00:00:24 DEBUG: | int
00:00:24 DEBUG: | main(void)
00:00:24 DEBUG: | {
00:00:24 DEBUG: |
00:00:24 DEBUG: | ;
00:00:24 DEBUG: | return 0;
00:00:24 DEBUG: | }
00:00:24 DEBUG: Executing: `/usr/lib64/ccache/clang -std=gnu99 --target=wasm32-wasi /tmp/conftest1h6796me.c -c`
00:00:24 DEBUG: The command returned non-zero exit status 1.
00:00:24 DEBUG: Its error output was:
00:00:24 DEBUG: | /tmp/conftest1h6796me.c:1:10: fatal error: 'string.h' file not found
00:00:24 DEBUG: | 1 | #include <string.h>
00:00:24 DEBUG: | | ^~~~~~~~~~
00:00:24 DEBUG: | 1 error generated.
00:00:24 ERROR: Cannot find wasi headers or problem with the wasm compiler. Please fix the problem. Or build with --without-wasm-sandboxed-libraries.
00:00:25 Config object not found by mach.
00:00:25 *** Fix above errors and then restart with "./mach build"
I'm getting this when I run the script.
What feature would you like to see?
aarch64 Linux support
(this is mainly stub for indicating missing feature, not rushing maintainers)What platform are you seeing the problem on?
Linux
Additional context
related. #351
reference Building Zen Browser, memo currently finished building steps:
tried build on
1.0.0-a.26
(1eaf6e49ef8edd443105b4606a4dc9e5733a9ad5)environment (
uname -a
):this is not officially releasedhere is log on
npm run build
("Start building the browser"){collapsed}