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

(feat): Added aarch64 support for graaljs linux and macos #131

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ To update the installed JavaScript engines later on, just run `jsvu` again.

## Supported engines per OS

| JavaScript engine | Binary name | `mac64` | `mac64arm` | `win32` | `win64` | `linux32` | `linux64` |
| ------------------------- | ------------------------- | ------------------ | ----------- | ------- | ------------------ | --------- | --------- |
| [**Chakra**][ch] | `chakra` or `ch` | ✅ | ❌ | ✅ | ✅ | ❌ | ✅ |
| [**GraalJS**][graaljs] | `graaljs` | ✅ | | ❌ | ✅ | ❌ | ✅ |
| [**Hermes**][hermes] | `hermes` & `hermes-repl` | ✅ | ❌ | ❌ | ✅ | ❌ | ✅ |
| [**JavaScriptCore**][jsc] | `javascriptcore` or `jsc` | ✅ | ✅ | ❌ | ✅ <sup>\*</sup> | ❌ | ✅ |
| [**QuickJS**][quickjs] | `quickjs` | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
| [**SpiderMonkey**][sm] | `spidermonkey` or `sm` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [**V8**][v8] | `v8` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [**V8 debug**][v8] | `v8-debug` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [**XS**][xs] | `xs` | ✅ <sup>(32)</sup> | ❌ | ✅ | ✅ <sup>(32)</sup> | ✅ | ✅ |
| JavaScript engine | Binary name | `mac64` | `mac64arm` | `win32` | `win64` | `linux32` | `linux64` | `linux64arm` |
| ------------------------- | ------------------------- | ------------------ | ----------- | ------- | ------------------ | --------- | --------- | --------- |
| [**Chakra**][ch] | `chakra` or `ch` | ✅ | ❌ | ✅ | ✅ | ❌ | ✅ | ❌ |
| [**GraalJS**][graaljs] | `graaljs` | ✅ | | ❌ | ✅ | ❌ | ✅ | ✅ |
| [**Hermes**][hermes] | `hermes` & `hermes-repl` | ✅ | ❌ | ❌ | ✅ | ❌ | ✅ | ❌ |
| [**JavaScriptCore**][jsc] | `javascriptcore` or `jsc` | ✅ | ✅ | ❌ | ✅ <sup>\*</sup> | ❌ | ✅ | ❌ |
| [**QuickJS**][quickjs] | `quickjs` | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
| [**SpiderMonkey**][sm] | `spidermonkey` or `sm` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| [**V8**][v8] | `v8` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| [**V8 debug**][v8] | `v8-debug` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| [**XS**][xs] | `xs` | ✅ <sup>(32)</sup> | ❌ | ✅ | ✅ <sup>(32)</sup> | ✅ | ✅ | ❌ |

<sup>\*</sup> JavaScriptCore requires external dependencies to run on Windows:
- On 32-bit Windows, install [iTunes](https://www.apple.com/itunes/download/).
Expand Down
14 changes: 10 additions & 4 deletions engines/graaljs/predict-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,20 @@

const predictFileName = (os) => {
switch (os) {
case 'mac64arm': {
return 'macos-aarch64'
}
case 'mac64': {
return 'macos';
return 'macos-amd64';
}
case 'linux64': {
return 'linux';
return 'linux-amd64';
}
case 'linux64arm': {
return 'linux-aarch64';
frank-dspeed marked this conversation as resolved.
Show resolved Hide resolved
}
case 'win64': {
return 'windows';
return 'windows-amd64';
}
default: {
throw new Error(
Expand All @@ -35,7 +41,7 @@ const predictFileName = (os) => {
const predictUrl = (version, os) => {
const fileName = predictFileName(os);
const ext = os.startsWith('win') ? 'zip' : 'tar.gz';
const url = `https://github.com/oracle/graaljs/releases/download/vm-${version}/graaljs-${version}-${fileName}-amd64.${ext}`;
const url = `https://github.com/oracle/graaljs/releases/download/vm-${version}/graaljs-${version}-${fileName}.${ext}`;
return url;
};

Expand Down