Issue 1:
Expected behavior

Is there any plan to release a Deno binary for linux-arm64?

I have successfully created the binary for Deno by running following:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

export PATH=$PATH:$HOME/.cargo/bin

apt install libglib2.0-dev

git clone https://github.com/denoland/deno/

cd deno

cargo build -vv

It will be very helpful if arm64 binaries are released. If any help is required in releasing them, I am happy to contribute.

Actual behavior

Deno binary is available for amd64 only.

Issue 2:
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 the aarch64-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:

root@rpi3:~/deno-build# ./deno https://deno.land/welcome.ts
#
# Fatal error in , line 0
# unreachable code
#
#
#
#FailureMessage Object: 0xfffff58d4d10
==== C stack trace ===============================

./deno(+0x8ad5fc) [0xaaaaafc445fc]
./deno(+0x9dd72c) [0xaaaaafd7472c]
./deno(+0x8a9f10) [0xaaaaafc40f10]
./deno(+0x83aa08) [0xaaaaafbd1a08]
./deno(+0x69c070) [0xaaaaafa33070]
./deno(+0x7bdbb4) [0xaaaaafb54bb4]
./deno(+0x7bdb00) [0xaaaaafb54b00]
./deno(+0x7bc6bc) [0xaaaaafb536bc]
./deno(+0x7bd9f8) [0xaaaaafb549f8]
./deno(+0x7bbbb8) [0xaaaaafb52bb8]
./deno(+0x2165dc) [0xaaaaaf5ad5dc]
./deno(+0x7c0be4) [0xaaaaafb57be4]
./deno(+0x663f68) [0xaaaaaf9faf68]
./deno(+0x7c0124) [0xaaaaafb57124]
./deno(+0x1c8e80) [0xaaaaaf55fe80]
./deno(+0x1c8f68) [0xaaaaaf55ff68]
./deno(+0x1b3dec) [0xaaaaaf54adec]
./deno(+0xce2f0) [0xaaaaaf4652f0]
./deno(+0x112b78) [0xaaaaaf4a9b78]
./deno(+0x11ef74) [0xaaaaaf4b5f74]
./deno(+0xb80c38) [0xaaaaaff17c38]
./deno(+0xb8fcf4) [0xaaaaaff26cf4]
./deno(+0xb814ec) [0xaaaaaff184ec]
./deno(+0x112d50) [0xaaaaaf4a9d50]
/lib/aarch64-linux-gnu/libc.so.6(__libc_start_main+0xe4) [0xffff8644ed24]
./deno(+0xbae4c) [0xaaaaaf451e4c]

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 here

deno/libdeno/api.cc

Line 54
in
b8a537d

v8::Isolate* isolate = v8::Isolate::New(params);

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:

Add the following options to .gn

target_cpu = "arm64"
v8_target_cpu = "arm64"

Add the following to Dockerfile in your deno repo root

FROM ubuntu:bionic

RUN apt update && apt install -y curl

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y

RUN /root/.cargo/bin/rustup target add aarch64-unknown-linux-gnu

RUN echo "[target.aarch64-unknown-linux-gnu]\nlinker = \"aarch64-linux-gnu-gcc\"" > /root/.cargo/config

RUN apt install -y nodejs yarn python build-essential cmake make

RUN apt -yq --no-install-suggests --no-install-recommends install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-7-multilib libc6-arm64-cross

WORKDIR /deno

RUN echo "source $HOME/.cargo/env" > /root/.bash

CMD ["/bin/bash", "--init-file", "/root/.bash"]

Run docker 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.

From this point you simply need to run cargo build --target=aarch64-unknown-linux-gnu --release

Once the build completes the executable should be located at target/aarch64-unknown-linux-gnu/release/deno

I wasn't able to get a build working with tools/build.py, since I couldn't find a way to specify a target for rust it 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