zen-browser / desktop

🌀 Experience tranquillity while browsing the web without people tracking you!
https://zen-browser.app
Mozilla Public License 2.0
17.32k stars 407 forks source link

Linux ARM64 Support #385

Closed nanai10a closed 2 months ago

nanai10a commented 2 months ago

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:

  1. [x] Clone the repository
  2. [x] Install dependencies
  3. [x] Download and bootstrap the browser
  4. [ ] Start building the browser
  5. [ ] Start the browser!

tried build on 1.0.0-a.26 (1eaf6e49ef8edd443105b4606a4dc9e5733a9ad5)

environment (uname -a): this is not officially released

Linux alarm 6.6.0-asahi-16-3-ARCH #1 SMP PREEMPT_DYNAMIC Tue, 06 Aug 2024 20:17:13 +0000 aarch64 GNU/Linux

here is log on npm run build ("Start building the browser")

{collapsed}


> zen-core@1.0.0 build
> surfer build

00:00:00 Applying mozconfig...
00:00:00 Dynamic config 'brand not set, defaulting to 'unofficial'
00:00:00 Dynamic config 'buildMode not set, defaulting to 'dev'
00:00:00 Dynamic config 'buildMode not set, defaulting to 'dev'
00:00:00 Building config based on a dev mode
00:00:00 Config for this `linux` build:
00:00:00    --with-app-name=zen
00:00:00    --with-app-basename=Zen
00:00:00    --enable-official-branding
00:00:00    MOZ_USER_DIR="Zen Browser"
00:00:00    MOZ_APP_BASENAME=Zen
00:00:00    MOZ_APP_PROFILE=zen
00:00:00    MOZ_APP_DISPLAYNAME="Zen Browser"
00:00:00    MOZ_BRANDING_DIRECTORY=branding/unofficial
00:00:00    MOZ_OFFICIAL_BRANDING_DIRECTORY=branding/unofficial
00:00:00    MOZ_DISTRIBUTION_ID=com.zen.browser
00:00:00    MOZ_SOURCE_REPO=https://github.com/zen-browser/desktop
00:00:00    MOZ_SOURCE_CHANGESET=1eaf6e49ef8edd443105b4606a4dc9e5733a9ad5
00:00:00    --enable-application=browser
00:00:00    --enable-unverified-updates
00:00:00    --enable-raw
00:00:00    --enable-webrtc
00:00:00    --enable-jxl
00:00:00    --enable-av1
00:00:00    --enable-eme=widevine
00:00:00    --allow-addon-sideload
00:00:00    --with-unsigned-addon-scopes=app,system
00:00:00    MOZ_CRASHREPORTER=0
00:00:00    MOZ_DATA_REPORTING=0
00:00:00    MOZ_SERVICES_HEALTHREPORT=0
00:00:00    MOZ_TELEMETRY_REPORTING=0
00:00:00    MOZ_REQUIRE_SIGNING=
00:00:00    MOZ_REQUIRE_SIGNING=
00:00:00    --target=x86_64-pc-linux
00:00:00    --enable-alsa
00:00:00    --enable-pulseaudio
00:00:00    --disable-debug
00:00:00    --with-branding=browser/branding/unofficial
00:00:00    --enable-unverified-updates
00:00:00    --enable-update-channel=unofficial
00:00:00    MOZ_APPUPDATE_HOST=zen-updates.vercel.app
00:00:00 Starting build...
00:00:00 Building for "linux"...
 WARNING If you get any dependency errors, try running |surfer bootstrap|.
00:00:01 W Clobber not needed.
00:00:01 Using Python 3.12.4 from /home/nanai/.mozbuild/srcdirs/engine-bb5fd4225c2c/_virtualenvs/build/bin/python
00:00:01 Adding configure options from /home/nanai/Downloads/zen-browser/desktop/engine/mozconfig
00:00:01   --with-app-name=zen
00:00:01   --with-app-basename=Zen
00:00:01   --enable-official-branding
00:00:01   --enable-application=browser
00:00:01   --enable-unverified-updates
00:00:01   --enable-raw
00:00:01   --enable-webrtc
00:00:01   --enable-jxl
00:00:01   --enable-av1
00:00:01   --enable-eme=widevine
00:00:01   --allow-addon-sideload
00:00:01   --with-unsigned-addon-scopes=app,system
00:00:01   --target=x86_64-pc-linux
00:00:01   --enable-alsa
00:00:01   --enable-pulseaudio
00:00:01   --disable-debug
00:00:01   --with-branding=browser/branding/unofficial
00:00:01   --enable-unverified-updates
00:00:01   --enable-update-channel=unofficial
00:00:01   MOZ_APP_PROFILE=zen
00:00:01   MOZ_APP_DISPLAYNAME=Zen Browser
00:00:01   MOZ_OFFICIAL_BRANDING_DIRECTORY=branding/unofficial
00:00:01   MOZ_DISTRIBUTION_ID=com.zen.browser
00:00:01   MOZ_BRANDING_DIRECTORY=branding/unofficial
00:00:01   CC=clang
00:00:01   MOZ_USER_DIR=Zen Browser
00:00:01   MOZ_SOURCE_CHANGESET=1eaf6e49ef8edd443105b4606a4dc9e5733a9ad5
00:00:01   MOZ_APP_BASENAME=Zen
00:00:01   CXX=clang++
00:00:01   MOZ_APPUPDATE_HOST=zen-updates.vercel.app
00:00:01   MOZ_REQUIRE_SIGNING=
00:00:01   MOZ_SOURCE_REPO=https://github.com/zen-browser/desktop
00:00:01 checking for vcs source checkout... git
00:00:01 checking for a shell... /usr/bin/sh
00:00:01 checking for host system type... aarch64-unknown-linux-gnu
00:00:01 checking for target system type... x86_64-pc-linux-gnu
00:00:01 checking whether cross compiling... yes
00:00:01 checking for the target C compiler... /usr/bin/clang
00:00:01 checking for ccache... not found
00:00:01 checking whether the target C compiler can be used... yes
00:00:01 checking for the target C++ compiler... /usr/bin/clang++
00:00:01 checking whether the target C++ compiler can be used... yes
00:00:01 checking for unwind.h... yes
00:00:01 checking for target linker...
00:00:01 DEBUG: Executing: `/usr/bin/clang -std=gnu99 --target=x86_64-linux-gnu -fuse-ld=lld -Wl,--version`
00:00:01 DEBUG: Executing: `/usr/bin/clang -std=gnu99 --target=x86_64-linux-gnu -Wl,--version`
00:00:01 ERROR: Failed to find an adequate linker
00:00:01 W Exception when writing resource usage file: [Errno 2] No such file or directory: '/home/nanai/Downloads/zen-browser/desktop/engine/obj-x86_64-pc-linux-gnu/.mozbuild/profile_build_resources.json'
00:00:01  Config object not found by mach.
00:00:01 *** Fix above errors and then restart with "./mach build"
mauro-balades commented 2 months ago

Duplicate of https://github.com/zen-browser/desktop/issues/206

trignomtry commented 2 months ago

@nanai10a Did you fix the profile_build_resources.json issue? I am experiencing the same thing.

nanai10a commented 2 months ago

@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:

{outdated} Hmm, I miss any knowledges... What's `./engine` ? Here's my patcher, can get outputs *as if issue had progressed*. ```sh # at root of repo sed -i 's/\(x86_64\|x86-64\)/aarch64/g' ./configs/linux/mozconfig sed -i '/--enable-eme/s/^/# /' ./configs/common/mozconfig sed -i '/--without-wasm-sandboxed-libraries/s/^# //' ./configs/common/mozconfig ``` at last, this (`npm run build`) fails at following: ``` 00:00:09 thread 'main' panicked at src/bindgen/config.rs:1125:34: 00:00:09 called `Result::unwrap()` on an `Err` value: "Couldn't parse config file: TOML parse error at line 363, column 1\n |\n363 | \"Keyframe\" = \"Keyframe\"\n | ^\nduplicate key `Keyframe` in table `export.rename`\n." 00:00:09 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace 00:00:09 make[3]: *** [backend.mk:612: layout/style/.deps/ServoStyleConsts.h.stub] Error 101 00:00:09 make[3]: *** Waiting for unfinished jobs.... 00:00:09 make[2]: *** [/home/nanai/desktop/engine/config/recurse.mk:34: export] Error 2 00:00:09 make[1]: *** [/home/nanai/desktop/engine/config/rules.mk:359: default] Error 2 00:00:09 make: *** [client.mk:60: build] Error 2 00:00:09 W 0 compiler warnings present. 00:00:09 /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:00:09 Configure complete! 00:00:09 Be sure to run |mach build| to pick up any changes 00:00:09 Parallelism determined by memory: using 10 jobs for 10 cores based on 15.0 GiB RAM and estimated job size of 1.0 GiB ``` ~~I wonder why fails parsing toml.~~

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:

PKGBUILD of ALARM's extra/firefox

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!

ArchitektApx commented 1 month ago

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

Screenshot from 2024-09-08 21-51-51

youwen5 commented 1 month ago

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.

ArchitektApx commented 1 month ago

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.

nerdyinu commented 3 weeks ago

+1 for linux arm64 build.

nerdyinu commented 3 weeks ago

@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.

youwen5 commented 3 weeks ago

@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.

see: https://github.com/NixOS/nixpkgs/pull/347222

nerdyinu commented 3 weeks ago

@youwen5 i am not really into nix, can i use nix pkg manager in fedora? sorry for noob question.

chookity-pokk commented 3 weeks ago

@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 commented 2 weeks ago

@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

Heinrich-XIAO commented 1 week ago
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.