Skip to content
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
16 changes: 13 additions & 3 deletions lib/download-neko-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@ DownloadNekoTask.prototype.run = function(executeNextStep) {
console.log("Getting NekoVM " + this.nekoVersion );
var version = this.nekoVersion.split('.').join('-');
var osPlatform = os.platform()
var plateform="";
var plateform= "";
var arch = os.arch();

switch ( osPlatform ) {
case 'linux':
plateform = 'linux.tar.gz';
if( os.arch() == 'x64' ) {

if (arch === 'x64') {
plateform = 'linux64.tar.gz';
} else if (arch === 'arm64') {
plateform = 'arm64';
}

break;
case 'darwin':
plateform = 'osx64.tar.gz';
Expand All @@ -31,8 +37,12 @@ DownloadNekoTask.prototype.run = function(executeNextStep) {
console.error('Haxe is not compatible with your platform');
throw 'error';
}
var url = "https://github.com/HaxeFoundation/neko/releases/download/v"+version+"/neko-"+this.nekoVersion+"-"+plateform;

var url = plateform === 'arm64'
? "https://build.haxe.org/builds/neko/linux-arm64/neko_latest.tar.gz"
: "https://github.com/HaxeFoundation/neko/releases/download/v"+version+"/neko-"+this.nekoVersion+"-"+plateform;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neko versions 2.4.0 and above have an linux arm build provided: linux-arm64.tar.gz, so that should be used instead of hard coding the nightly build.

Mac is still hardcoded to install the x86 version, it should also use osx-arm64.tar.gz for arm.

Ideally we would have version checks to give an error if neko is too old to support arm64, but we don't seem to have a semver dependency yet. For now maybe we can add an alternative error message if the download fails on an arm machine to suggest that the user might have to update the neko version.

var cache = new Cache();

cache.download( url , vars.neko.dir, executeNextStep, (err) => {
if (osPlatform == 'win64'){
// fallback to win32
Expand Down
11 changes: 10 additions & 1 deletion lib/haxe-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ module.exports = function ( platform, arch, majorVersion, nightly ) {
var isNightly = !!nightly;

var url;

if (platform === 'linux' && arch === 'arm64') {
isNightly = true;
nightly = nightly || 'latest';
}

switch ( isNightly ) {
case true:
case true:
url = 'https://build.haxe.org/builds/haxe/';
switch( platform ) {
case 'linux':
Expand All @@ -18,6 +24,9 @@ module.exports = function ( platform, arch, majorVersion, nightly ) {
case 'ia32':
url += '32';
break;
case 'arm64':
url += '-arm64';
break;
}
break;
case 'darwin':
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
],
"cpu": [
"x64",
"ia32"
"ia32",
"arm64"
],
"engines" : { "node" : ">=8.0.0" },
"dependencies": {
Expand Down