Skip to content

Commit

Permalink
Use the x86_64 build of Rosey on M1 Macs
Browse files Browse the repository at this point in the history
  • Loading branch information
bglw committed Oct 12, 2022
1 parent c9c7cf8 commit c8bb6b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

## Unreleased

* Use the x86_64 build of Rosey on M1 Macs

## v2.0.0 (October 12, 2022)

The first stable Rosey 2.0 release! 🎉
Expand Down
16 changes: 9 additions & 7 deletions wrappers/node/lib/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function isMusl() {
} catch (err) {
stderr = err.stderr;
}
if(stderr.indexOf('musl') > -1) {
if (stderr.indexOf('musl') > -1) {
return true;
}
return false;
Expand All @@ -35,20 +35,22 @@ async function getTarget() {

switch (os.platform()) {
case 'darwin':
return 'x86_64-apple-darwin';
// TODO: Waiting for GitHub actions to build on M1.
return arch === 'arm64' ? 'aarch64-apple-darwin' :
'x86_64-apple-darwin';
case 'win32':
return arch === 'x64' ? 'x86_64-pc-windows-msvc' :
arch === 'arm' ? 'aarch64-pc-windows-msvc' :
'i686-pc-windows-msvc';
'i686-pc-windows-msvc';
case 'linux':
return arch === 'x64' ? 'x86_64-unknown-linux-musl' :
arch === 'arm' ? 'arm-unknown-linux-gnueabihf' :
arch === 'armv7l' ? 'arm-unknown-linux-gnueabihf' :
arch === 'arm64' ? await isMusl() ? 'aarch64-unknown-linux-musl' : 'aarch64-unknown-linux-gnu' :
arch === 'ppc64' ? 'powerpc64le-unknown-linux-gnu' :
arch === 's390x' ? 's390x-unknown-linux-gnu' :
'i686-unknown-linux-musl'
arch === 'armv7l' ? 'arm-unknown-linux-gnueabihf' :
arch === 'arm64' ? await isMusl() ? 'aarch64-unknown-linux-musl' : 'aarch64-unknown-linux-gnu' :
arch === 'ppc64' ? 'powerpc64le-unknown-linux-gnu' :
arch === 's390x' ? 's390x-unknown-linux-gnu' :
'i686-unknown-linux-musl'
default: throw new Error('Unknown platform: ' + os.platform());
}
}
Expand Down

0 comments on commit c8bb6b2

Please sign in to comment.