@@ -61,14 +61,30 @@ export function getTarget(): string {
61
61
return 'x86_64-apple-darwin' ;
62
62
default :
63
63
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` ,
65
65
) ;
66
66
}
67
67
}
68
68
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
+ }
72
88
}
73
89
74
90
throw new Error (
@@ -81,5 +97,14 @@ export function isCubeStoreSupported(): boolean {
81
97
return [ 'win32' , 'darwin' , 'linux' ] . includes ( process . platform ) ;
82
98
}
83
99
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 ;
85
110
}
0 commit comments