Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows arm64 build #1051

Open
1 task done
Pharoh-Ramses opened this issue Aug 29, 2024 · 34 comments
Open
1 task done

Windows arm64 build #1051

Pharoh-Ramses opened this issue Aug 29, 2024 · 34 comments
Labels

Comments

@Pharoh-Ramses
Copy link

What happened?

Not sure if this has been raised, but are there any plans for an arm64 build for windows?

Reproducible?

  • I have checked that this issue cannot be reproduced on Mozilla Firefox.

Version

1.0.0-a.32

Severity impact

High

What platform are you seeing the problem on?

Windows

Relevant log output

No response

@meguroyama
Copy link

+1 on ARM64 build and since FF has a build for it too finger crossed zen version is coming too.

@ectrc
Copy link

ectrc commented Aug 29, 2024

Currently for me, Zen does not even work under emulation
image
image

Firefox does have an arm build
image

Would love to see this

@Okaza03
Copy link

Okaza03 commented Sep 4, 2024

Wold also love to see a working version on my Arm64 laptop as i love to use Zen-Browser on my desktop

@matotubol
Copy link

Also same problem on the snapdragon x Elite, would love to see this working on ARM machines.

@sky0matic
Copy link

I started using Zen on my personnal PC and work laptop.
Wanted to get it on my Snapdragon laptop too, guess I'm gonna have to stick with Brave on my laptop for now 🫤

@rexxDZN
Copy link

rexxDZN commented Sep 7, 2024

SAme i want this so bad on my new arm laptop...

@HarryHeres
Copy link
Member

Since 03/09/2024, GitHub made ARM runners available to open public. I think that should be possible to implement now.
@mauro-balades FYI

@mr-cheff
Copy link
Member

mr-cheff commented Sep 7, 2024

For windows? Where did you see that?

@HarryHeres
Copy link
Member

@HarryHeres
Copy link
Member

Though based on this discussion actions/runner-images#768 they are not much usable...

@mr-cheff
Copy link
Member

mr-cheff commented Sep 8, 2024

Currently for me, Zen does not even work under emulation image image

Firefox does have an arm build image

Would love to see this

use the generic version

@mr-cheff
Copy link
Member

mr-cheff commented Sep 8, 2024

For windows? Where did you see that?

https://github.blog/changelog/2024-09-03-github-actions-arm64-linux-and-windows-runners-are-now-generally-available/

The only way would be to use third party runners, id need to check their pricing

@ectrc
Copy link

ectrc commented Sep 13, 2024

use the generic version
I am using the "generic" version. I am using the Snapdragon X Elite.

@EndCredits
Copy link

The only way would be to use third party runners, id need to check their pricing

According to Supported built host - Firefox . It's impossible to build firefox on Windows ARM64 runner. I guess we should consider cross compile.

@EndCredits
Copy link

EndCredits commented Oct 3, 2024

Detailed description about cross compile can also be found on Firefox source documentations. Official targets configuration for windows arm64 is L4 at mozilla-central/browser/config/mozconfigs/win64-aarch64/common-win64 . So we might be able to cross compile Zen browser by adding win64-aarch64 target like:

ac_add_options --target=aarch64-pc-windows-msvc

Considering we're using surfer. So we might should add win64-aarch64 target to surfer platform map (Reference: https://searchfox.org/mozilla-central/source/python/mozrelease/mozrelease/platforms.py#22)

diff --git a/src/commands/updates/browser.ts b/src/commands/updates/browser.ts
index 8745467..ac08636 100644
--- a/src/commands/updates/browser.ts
+++ b/src/commands/updates/browser.ts
@@ -8,4 +8,5 @@ const ausPlatformsMap = {
   ],
   macosArm: ['Darwin_aarch64-gcc3'],
   win64: ['WINNT_x86_64-msvc', 'WINNT_x86_64-msvc-x64'],
+  win64-aarch64: ["WINNT_aarch64-msvc-aarch64"],
 }

Since I'm not an expert in this field so I can't provide further help. I also can't test this cuz I don't have windows x86 device. Anyway thanks a lot for your great efforts devs.

@ruverav
Copy link

ruverav commented Oct 11, 2024

Arc already has a working build for Windows ARM64 and it seems to run even faster than on my Intel-based computers. With Arc being the most direct competitor to Zen Browser, it would be interesting to see a step forward for Zen in this regard.

@nerdyinu
Copy link

+1 for linux arm64 build also

@locksvur
Copy link

+1 for windows arm64 build, especially now that arc has it. zen technically works under emulation but its super laggy and some sites don't work

@TophC7
Copy link

TophC7 commented Oct 14, 2024

Looking for this as well. The difference in stability and performance is really obvious when using zen on my desktop vs my X Elite laptop.

@HarryHeres
Copy link
Member

Okay, let me check this out hopefully during this week. I only have a M-based Mac, but running a VM should suffice for testing purposes.

@HarryHeres HarryHeres added the Feature label Oct 14, 2024 — with Linear
@Molier
Copy link

Molier commented Oct 16, 2024

Okay, let me check this out hopefully during this week. I only have a M-based Mac, but running a VM should suffice for testing purposes.

If you need any testers, would be happy to oblige, or I can build it as well, if you run into issues with vm or something. I`m on the aarch64 snapdragon laptop.

@locksvur
Copy link

locksvur commented Oct 16, 2024

I'd also be happy to be a tester if needed :) I have a snapdragon x plus-based surface pro 11

@BenjaminJacober
Copy link

Running the generic version through the standard windows emulation layer works on my Surface Laptop 7, but a lot of pages are so slow that they're unusable (e.g. youtube).

@hardelone
Copy link

Any news? :-) I have Snapdragon x plus in my Lenovo ThinkBook, so I´ll be happy for amr release.

@KiefBC
Copy link

KiefBC commented Oct 30, 2024

Still waiting... :)

Asus Vivobook S15 OLED Copilot Laptop. Snapdragon Elite X

@ruverav
Copy link

ruverav commented Oct 30, 2024

Also willing to be a beta tester. I have a Lenovo Yoga Slim 7X laptop.

@NOCanoa NOCanoa moved this from ToDo to Verification in Zen Browser - public roadmap Nov 1, 2024
@omove
Copy link
Contributor

omove commented Nov 5, 2024

I don't think an ARM64 runner is needed for this, changing the build target to aarch64-pc-windows-msvc and using Firefox's --enable-bootstrap build option to cross-compile worked on my x86 Fedora machine to build the ARM64 Windows version. Running the native version does immediately feel significantly faster. On BrowserBench Speedometer 3.0 the x86 version on my Yoga Slim 7x gets 5.58 vs 14.5 with the ARM64 one.

I also changed the WIN32_REDIST_DIR path from x64 to arm64 and removed the SURFER_COMPAT if-else block that has the x86 CPU optimizations.
I was going to change WIN_UCRT_REDIST_DIR from x64 to arm64 but that Windows SDK version seems to have a bug and it's missing the arm64 folder, but since the DLL is apparently part of the OS as of Windows 10 and overrides any application bundled ones anyway I just removed it instead and it didn't have any issues.

@yanai-klugman
Copy link

Reluctantly using Arc until a native arm build is up. Patiently waiting =)

@omove can you ELI5?

@omove
Copy link
Contributor

omove commented Nov 8, 2024

I made this script to do it all in a fresh VM of Fedora 40.

#Install 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 \
     libstdc++-devel npm libwbclient libwbclient-devel ca-certificates msitools rustup \
     p7zip p7zip-plugins upx ccache

#Initialize rust and add rust aarch64 toolchain
rustup-init -y
. "$HOME/.cargo/env"
rustup target add aarch64-pc-windows-msvc

#Setup Zen repo
git clone https://github.com/zen-browser/desktop.git --recurse-submodules
cd desktop
npm i
npm run init
sh ./scripts/update-en-US-packs.sh

#Make changes to the windows mozconfig
sed -i '/WIN_UCRT_REDIST_DIR/ s/^/# /' ./configs/windows/mozconfig
sed -i 's/x64\/Microsoft.VC143.CRT/arm64\/Microsoft.VC143.CRT/g' ./configs/windows/mozconfig
sed -i 's/x86_64-pc-windows-msvc/aarch64-pc-windows-msvc\nac_add_options --enable-bootstrap/g' ./configs/windows/mozconfig
sed -i '/SURFER_COMPAT/,/fi/ s/^/# /' ./configs/windows/mozconfig

#Build for Windows
export SURFER_PLATFORM="win32"
npm run build
./engine/mach package

#The portable zip browser is in desktop/engine/obj-aarch64-pc-windows-msvc/dist/
#EXE Installer is located at desktop/engine/obj-aarch64-pc-windows-msvc/dist/install/sea/

@rexxDZN
Copy link

rexxDZN commented Nov 8, 2024

I made this script to do it all in a fresh VM of Fedora 40.

@omove
I don't think I fully understand how this work. Why create a script to be run on another OS in order to have the windows arm version of Zen Browser? Can't we just have the script to immediately run on windows, which sounds simpler than setting up a vm, then knowing how fedora works then transferring the compiled browser package to Windows. (p.s. i am not that tech savvy yet)

If that CAN be the case then could u share that version of the script :)

@sky0matic
Copy link

I made this script to do it all in a fresh VM of Fedora 40.

@omove I don't think I fully understand how this work. Why create a script to be run on another OS in order to have the windows arm version of Zen Browser? Can't we just have the script to immediately run on windows, which sounds simpler than setting up a vm, then knowing how fedora works then transferring the compiled browser package to Windows. (p.s. i am not that tech savvy yet)

If that CAN be the case then could u share that version of the script :)

What he mentioned would be to have something the Zen team can put in a pipeline that can automatically create releases for Windows ARM64.

Usually pipelines are simpler to do in Linux and they allow to cross-compile for Windows.

If you're not that tech savvy like you said, I would wait for official builds, else you would have to build it yourself for every new update they release, because staying on one version, you won't get new security updates that they do.

@omove
Copy link
Contributor

omove commented Nov 10, 2024

I tried replacing those x86 optimizations with some ARM options instead of just commenting the whole if-else block out and I got the speedometer score from 14.5 to 16.4.

if test "$SURFER_COMPAT" = "true"; then
  ac_add_options --enable-optimize="-O3 -w -ftree-vectorize"

  export CFLAGS="-mtune=cortex-a55 -march=armv8.2-a+crypto -O2 -Qvec -w"
  export CPPFLAGS="-mtune=cortex-a55 -march=armv8.2-a+crypto -O2 -Qvec -w"
  export CXXFLAGS="-flto=thin -mtune=cortex-a55 -march=armv8.2-a+crypto -O2 -Qvec -w"
  export LDFLAGS="-Wl,-O2"
  export RUSTFLAGS="-Clink-args=--icf=safe -C codegen-units=1 -Ctarget-cpu=cortex-a55"
else
  ac_add_options --enable-optimize="-O2 -ftree-vectorize -Xclang -w"
  ac_add_options --enable-wasm-simd

  export CFLAGS="-O2 -march=armv8.2-a+crypto"   
  export CPPFLAGS="-O2 -march=armv8.2-a+crypto"
  export CXXFLAGS="-O2 -flto=thin -march=armv8.2-a+crypto"
  export LDFLAGS="-Wl,-O3 -march=armv8.2-a+crypto"
  export RUSTFLAGS="-Clink-args=--icf=safe -C codegen-units=1 -Ctarget-cpu=cortex-a55"    
fi

@Molier
Copy link

Molier commented Nov 18, 2024

I tried replacing those x86 optimizations with some ARM options instead of just commenting the whole if-else block out and I got the speedometer score from 14.5 to 16.4.

if test "$SURFER_COMPAT" = "true"; then
  ac_add_options --enable-optimize="-O3 -w -ftree-vectorize"

  export CFLAGS="-mtune=cortex-a55 -march=armv8.2-a+crypto -O2 -Qvec -w"
  export CPPFLAGS="-mtune=cortex-a55 -march=armv8.2-a+crypto -O2 -Qvec -w"
  export CXXFLAGS="-flto=thin -mtune=cortex-a55 -march=armv8.2-a+crypto -O2 -Qvec -w"
  export LDFLAGS="-Wl,-O2"
  export RUSTFLAGS="-Clink-args=--icf=safe -C codegen-units=1 -Ctarget-cpu=cortex-a55"
else
  ac_add_options --enable-optimize="-O2 -ftree-vectorize -Xclang -w"
  ac_add_options --enable-wasm-simd

  export CFLAGS="-O2 -march=armv8.2-a+crypto"   
  export CPPFLAGS="-O2 -march=armv8.2-a+crypto"
  export CXXFLAGS="-O2 -flto=thin -march=armv8.2-a+crypto"
  export LDFLAGS="-Wl,-O3 -march=armv8.2-a+crypto"
  export RUSTFLAGS="-Clink-args=--icf=safe -C codegen-units=1 -Ctarget-cpu=cortex-a55"    
fi

I have tried getting it to work on fedora WSL but couldnt get your instructions to build. But probably since it was not a whole vm...

Will try again if it isnt supported by the end of this week. with the recent Arc news I'm more than ever looking to replace it on WOA arm64 pc. So heres hoping for support 🤞
Or if you could perhaps for now share your compiled versions @omove , think many would appreciate.

@omove
Copy link
Contributor

omove commented Nov 18, 2024

Will try again if it isnt supported by the end of this week. with the recent Arc news I'm more than ever looking to replace it on WOA arm64 pc. So heres hoping for support 🤞 Or if you could perhaps for now share your compiled versions @omove , think many would appreciate.

I put together a PR(#3093) over the weekend so it could be merged, here's the latest arm64 build from my Github Actions test runs if you want to try it now: https://github.com/omove/desktop/actions/runs/11893761202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Verification
Development

No branches or pull requests