-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Building for arm64 #1846
Comments
@ry My guess at this point is that v8 snapshots are not independent of the binaries used to generate them. That would make since considering that the snapshots are generated by the compiler host using a native binary. Can you confirm this is the case with v8? |
@afinch7 I'll have to dig into this later when I have some time - but one random guess - try |
@ry Turns out I was right chromium has had a similar issue with cross compiled builds using snapshots. My plan at this point remove inclusion of compile time generated snapshots on cross compiled builds, and setup some logic to allow them to generate the snapshots during the first runtime(and store them on disk for next time). I would build on aarch64, but depot_tools doesn't seem to have a gn binary for aarch64. #1852 |
basic arm support added in 8c7a12d |
I have a project where deno would fit perfectly, I made some tests on x86_64 and it works well, but I will need arm support in the future, so does this have a place in the roadmap? What is the current status? What does it mean "basic support"? |
ARM64 support was reverted some time ago... re-opening. |
FYI, not sure if deno is using Travis CI in conjunction with github but Travis CI now supports multi arch including arm64, see https://docs.travis-ci.com/user/multi-cpu-architectures/ and you don't need to use qemu for that (as far as I understood, I didn't test it by myself) |
I've also had zero issues building an aarch64 build for the last couple of versions that I've tested. I'd be happy to donate a few Raspberry Pi 4 (8GB) to this project in order to make a stable release happen. Now that the Mac has released their ARM hardware, I can also build the same on there for that. |
We use GitHub Actions exclusively. We are working with GitHub on the potential of their ARM64 support.
That isn't necessary, and likely wouldn't solve the problem of integrating it reliably into a repeatable and supportable APIs. |
For those that may not know Deno builds easily on a Pi 4 without any modifications necessary. Takes about an hour on a non-overclocked Pi 4 with just a microSD card. Have fun! |
Echoing what frankhale mentioned, the Raspberry Pi OS 64bit-beta updated on the RPi4 8GB installs in about 1 hour with standard install and |
I have had some success building for ARM64 on GitHub Actions. It takes about 2 hours, compared with 20 minutes for AMD64. https://github.com/LukeChannings/docker-deno/actions/runs/482795009 The process for this repo is:
That last step is failing and I haven't had the time to finish it, but everything else works, and there's a published 1.6.3 image under I built this for another project I'm working on, and people seem to be running the ARM64 image on a Raspberry Pi 4 without problems. |
@jimmont I made it almost the entire way through the building process on the RPi3B+ but I came to a point where it would lock up consistently. I'm guessing it's running out of memory? I was building it on Ubuntu Server 20.10 so the Pi would not be using much memory. I also made a 4 gb swap file which didn't seem to help. |
I'm willing to bet that you are running out of memory. Even on a Raspberry Pi 4 4GB, you need to use swap space (around 2GB) in order to compile correctly. I think one compile thread uses more than the 4GB boundary of a single application thread in the 32bit OS. So we are gonna have a hard time here. I've been using an 8GB Pi 4 and that just squeaks by. I'll try later tonight if an 8GB Pi can compile on the 32bit OS or and confirm if it's a memory boundary problem. |
Has anyone attempted a compile of 1.7.0 on a Pi 4? I did but I'm running into problems:
|
There are no rusty_v8 aarch64 builds yet. See denoland/rusty_v8#589 |
You can try to build fully from scratch by setting the |
Another method: If we just run |
Cross-compilation can be done via QEMU aarch64 emulation. It is not as performant as the Apple Silicon but hey it should be around 30min |
Hi I need to use deno in termux! "Deno for ARM64" project work fine in proot-distro but not in native termux and compile didn't work in either of them. Please add support to aarch64 in compile and in install. |
@zero-js-dev You can try this: https://github.com/fm-elpac/v8-src/tree/deno-1.36 deno 1.36.2 for |
With a modified cargo, we can cross build deno for The modified cargo will only run We only need a little patch: diff '--color=auto' -ru -x Cargo.lock workdir-1/deno-1.36.2/build.rs workdir/deno-1.36.2/build.rs
--- workdir-1/deno-1.36.2/build.rs 2023-08-24 19:38:40.831557143 +0800
+++ workdir/deno-1.36.2/build.rs 2023-08-24 19:39:43.532680484 +0800
@@ -400,9 +400,6 @@
// Host snapshots won't work when cross compiling.
let target = env::var("TARGET").unwrap();
let host = env::var("HOST").unwrap();
- if target != host {
- panic!("Cross compiling with snapshot is not supported.");
- }
let symbols_path = std::path::Path::new("napi").join(
format!("generated_symbol_exports_list_{}.def", env::consts::OS).as_str(), all other is just work. |
@secext2022 Thanks a lot ❤️ this build of yours "aarch64-linux-android" works(run and compile) on my termux without to need use additional proot-distro. If you had time please make it installable and upgradable like below project(for everyone to easy using it) curl -s https://gist.githubusercontent.com/LukeChannings/09d53f5c364391042186518c8598b85e/raw/ac8cd8c675b985edd4b3e16df63ffef14d1f0e24/deno_install.sh | sh |
If the core team is looking for a powerful machine for development, please have a look at https://www.adlinktech.com/en/News/com-hpc-ampere-altra-developer-platform-arm-sr |
When the feature in this changelog entry goes into GA I think this issue is ready to be addressed with a PR :) Hope this helps!! |
Do you have tried this: |
Friendly reminder (as it's been about 2 years since I last brought it up) nixpkgs has been building deno for:
Pre-built releases are available via the cache or you can build again from source if you'd like too. |
FYI we've applied for Linux ARM runners at GitHub. As soon as we get access to them we will work on providing first-class Linux ARM builds for releases. |
Also available on docker hub: |
We are now actively working towards adding support for the official Linux ARM builds. No promises on the dates, but stay tuned 🤞 |
👀 #22298 |
This implements officially blessed and tested deno binaries for ARM64. Thanks to @LukeChannings for his tireless work in maintaining the deno-arm64 [1] repo, without which this project would have been far more complicated. For those of you requiring support for older GLIBC versions, that repo may still be required for the near future. Limitations: - This initial build is built on Ubuntu 22 using the stock GLIBC, which will limit the utility of these binaries in certain use-cases (eg: early versions of Ubuntu). We will attempt to support earlier versions of ARM64 GLIBC in a later revision. - Like the stock Linux x64 build, this is not a static build and requires GLIBC. Running on Alpine will require installation of GLIBC. Fixes #1846, #4862 [1] https://github.com/LukeChannings/deno-arm64
This implements officially blessed and tested deno binaries for ARM64. Thanks to @LukeChannings for his tireless work in maintaining the deno-arm64 [1] repo, without which this project would have been far more complicated. For those of you requiring support for older GLIBC versions, that repo may still be required for the near future. Limitations: - This initial build is built on Ubuntu 22 using the stock GLIBC, which will limit the utility of these binaries in certain use-cases (eg: early versions of Ubuntu). We will attempt to support earlier versions of ARM64 GLIBC in a later revision. - Like the stock Linux x64 build, this is not a static build and requires GLIBC. Running on Alpine will require installation of GLIBC. Fixes #1846, #4862 [1] https://github.com/LukeChannings/deno-arm64
I ran
https://deno.land/install.sh should be updated. |
Updated. |
Deno didn't care about its community at all. 1 year ago I requested this simple build but still didn't work(install but don't work). Thanks to @secext2022 who responded me immediately that time and give me a build that work |
This build is old but works. |
Builds for arm64 are now in CI, but are not ready for release. We still need to make some changes to make the tests work with this build.
I managed to get deno to build for arm64 using theaarch64-unknown-linux-gnu
target. Currently It doesn't execute successfully on a raspberry pi 3b+ running a preview image of debian buster arm64/aarch64. It gives me the following print out:I opened up the executable with a arm compatible disassembler, and located the last call from within deno before failure,0x1b3dec
. It looks like this call occurs heredeno/libdeno/api.cc
Line 54 in b8a537d
This leads me to suspect an issue with loading the snapshot.I managed to get this working successfully with the changes in [my forked branch](https://github.com/afinch7/deno/tree/arm-builds).To replicate my arm64 build you will need docker installed.
Then it should be as simple as:
Dockerfile
in your deno repo rootdocker build -f Dockerfile -t deno-arm64-build . && docker run -it -v "$PWD/:/deno" -u $(id -u root):$(id -g ${USER}) deno-arm64-build
in your deno repo root. This should build a docker image with the required tools and drop you into a bash shell on said image with your deno repo mounted at/deno
.cargo build --target=aarch64-unknown-linux-gnu --release
target/aarch64-unknown-linux-gnu/release/deno
I wasn't able to get a build working withtools/build.py
, since I couldn't find a way to specify a target for rustit might be possible to use env vars like CC, AR, CFLAGS, etc. I might try that at some point, but I'm putting my efforts into figuring out if the snapshots are even being included in the build correctly right now.I not sure what changed, but I can't get the build to work anymore with docker. I can still get this to work outside of docker though. I'm working on getting this into CI see #1887. The main problem with getting this into CI is how long it takes to build.
Edit: fixed some issues with the
Dockerfile
Edit: added the current user group to the docker run command so this doesn't break your repo as much
Edit: my forked branch has modifications to make this work now
The text was updated successfully, but these errors were encountered: