Skip to content

Commit 3b385e5

Browse files
committed
feat(cubestore): Mark linux GNU as supported on ARM64 (post installer)
1 parent 5351c41 commit 3b385e5

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

rust/cubestore/js-wrapper/src/utils.ts

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,30 @@ export function getTarget(): string {
6161
return 'x86_64-apple-darwin';
6262
default:
6363
throw new Error(
64-
`You are using ${process.env} platform which is not supported by Cube Store`,
64+
`You are using ${process.env} platform on x86 which is not supported by Cube Store`,
6565
);
6666
}
6767
}
6868

69-
if (process.arch === 'arm64' && process.platform === 'darwin') {
70-
// Rosetta 2 is required
71-
return 'x86_64-apple-darwin';
69+
if (process.arch === 'arm64') {
70+
switch (process.platform) {
71+
case 'linux':
72+
switch (detectLibc()) {
73+
case 'gnu':
74+
return 'aarch64-unknown-linux-gnu';
75+
default:
76+
throw new Error(
77+
`You are using ${process.env} platform on arm64 with MUSL as standard library which is not supported by Cube Store, please use libc (GNU)`,
78+
);
79+
}
80+
case 'darwin':
81+
// Rosetta 2 is required
82+
return 'x86_64-apple-darwin';
83+
default:
84+
throw new Error(
85+
`You are using ${process.env} platform on arm64 which is not supported by Cube Store`,
86+
);
87+
}
7288
}
7389

7490
throw new Error(
@@ -81,5 +97,14 @@ export function isCubeStoreSupported(): boolean {
8197
return ['win32', 'darwin', 'linux'].includes(process.platform);
8298
}
8399

84-
return process.arch === 'arm64' && process.platform === 'darwin';
100+
if (process.arch === 'arm64') {
101+
// We mark darwin as supported, but it uses Rosetta 2
102+
if (process.platform === 'darwin') {
103+
return true;
104+
}
105+
106+
return process.platform === 'linux' && detectLibc() === 'gnu';
107+
}
108+
109+
return false;
85110
}

0 commit comments

Comments
 (0)