Skip to content

Commit

Permalink
feat: ARM64 builds (#22298)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mmastrac authored Feb 7, 2024
1 parent 93e8ece commit e5ae142
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 11 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/ci.generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const cacheVersion = 73;

const ubuntuX86Runner = "ubuntu-22.04";
const ubuntuX86XlRunner = "ubuntu-22.04-xl";
const ubuntuARMRunner = "ubicloud-standard-16-arm";
const windowsX86Runner = "windows-2022";
const windowsX86XlRunner = "windows-2022-xl";
const macosX86Runner = "macos-12";
Expand All @@ -26,6 +27,11 @@ const Runners = {
runner:
`\${{ github.repository == 'denoland/deno' && '${ubuntuX86XlRunner}' || '${ubuntuX86Runner}' }}`,
},
linuxArm: {
os: "linux",
arch: "aarch64",
runner: ubuntuARMRunner,
},
macosX86: {
os: "macos",
arch: "x86_64",
Expand Down Expand Up @@ -399,6 +405,14 @@ const ci = {
...Runners.linuxX86,
job: "lint",
profile: "debug",
}, {
...Runners.linuxArm,
job: "test",
profile: "debug",
}, {
...Runners.linuxArm,
job: "test",
profile: "release",
}, {
...Runners.macosX86,
job: "lint",
Expand Down Expand Up @@ -456,7 +470,10 @@ const ci = {
...installDenoStep,
},
...installPythonSteps.map((s) =>
withCondition(s, "matrix.job != 'lint'")
withCondition(
s,
"matrix.job != 'lint' && (matrix.os != 'linux' || matrix.arch != 'aarch64')",
)
),
{
// only necessary for benchmarks
Expand Down Expand Up @@ -732,7 +749,7 @@ const ci = {
{
name: "Autobahn testsuite",
if: [
"matrix.os == 'linux' &&",
"(matrix.os == 'linux' && matrix.arch != 'aarch64') &&",
"matrix.job == 'test' &&",
"matrix.profile == 'release' &&",
"!startsWith(github.ref, 'refs/tags/')",
Expand Down
26 changes: 18 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
git config --global fetch.parallel 32
if: github.event.pull_request.draft == true
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 5
submodules: false
Expand Down Expand Up @@ -111,6 +111,16 @@ jobs:
runner: ubuntu-22.04
job: lint
profile: debug
- os: linux
arch: aarch64
runner: ubicloud-standard-16-arm
job: test
profile: debug
- os: linux
arch: aarch64
runner: ubicloud-standard-16-arm
job: test
profile: release
- os: macos
arch: x86_64
runner: macos-12
Expand All @@ -133,7 +143,7 @@ jobs:
git config --global fetch.parallel 32
if: '!(matrix.skip)'
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 5
submodules: false
Expand Down Expand Up @@ -169,9 +179,9 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.11
if: '!(matrix.skip) && (matrix.job != ''lint'')'
if: '!(matrix.skip) && (matrix.job != ''lint'' && (matrix.os != ''linux'' || matrix.arch != ''aarch64''))'
- name: Remove unused versions of Python
if: '!(matrix.skip) && (matrix.job != ''lint'' && (matrix.os == ''windows''))'
if: '!(matrix.skip) && (matrix.job != ''lint'' && (matrix.os != ''linux'' || matrix.arch != ''aarch64'') && (matrix.os == ''windows''))'
shell: pwsh
run: |-
$env:PATH -split ";" |
Expand All @@ -184,7 +194,7 @@ jobs:
with:
node-version: 18
- name: Install protoc
uses: arduino/setup-protoc@v2
uses: arduino/setup-protoc@v3
with:
version: '21.12'
repo-token: '${{ secrets.GITHUB_TOKEN }}'
Expand Down Expand Up @@ -331,7 +341,7 @@ jobs:
fi
if: '!(matrix.skip)'
- name: Cache Cargo home
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |-
~/.cargo/registry/index
Expand Down Expand Up @@ -441,7 +451,7 @@ jobs:
gsutil -h "Cache-Control: no-cache" cp canary-latest.txt gs://dl.deno.land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt
- name: Autobahn testsuite
if: |-
!(matrix.skip) && (matrix.os == 'linux' &&
!(matrix.skip) && ((matrix.os == 'linux' && matrix.arch != 'aarch64') &&
matrix.job == 'test' &&
matrix.profile == 'release' &&
!startsWith(github.ref, 'refs/tags/'))
Expand Down Expand Up @@ -622,7 +632,7 @@ jobs:
body_path: target/release/release-notes.md
draft: true
- name: Save cache build output (main)
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: '!(matrix.skip) && ((matrix.job == ''test'' || matrix.job == ''lint'') && github.ref == ''refs/heads/main'')'
with:
path: |-
Expand Down
4 changes: 3 additions & 1 deletion test_ffi/tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,9 @@ assertEquals(isNullBufferDeopt(new Uint8Array()), true, "isNullBufferDeopt(new U

// V8 bug: inline Uint8Array creation to fast call sees non-null pointer
// https://bugs.chromium.org/p/v8/issues/detail?id=13489
assertEquals(isNullBuffer(new Uint8Array()), false, "isNullBuffer(new Uint8Array()) !== false");
if (Deno.build.os != "linux" || Deno.build.arch != "aarch64") {
assertEquals(isNullBuffer(new Uint8Array()), false, "isNullBuffer(new Uint8Array()) !== false");
}

// Externally backed ArrayBuffer has a non-null data pointer, even though its length is zero.
const externalZeroBuffer = new Uint8Array(Deno.UnsafePointerView.getArrayBuffer(ptr0, 0));
Expand Down

0 comments on commit e5ae142

Please sign in to comment.