@@ -3,7 +3,8 @@ import 'source-map-support/register';
33import {
44 detectLibc ,
55 displayCLIError ,
6- displayCLIWarning , downloadAndExtractFile ,
6+ displayCLIWarning ,
7+ downloadAndExtractFile ,
78 libraryExists ,
89 LibraryExistsResult ,
910} from '@cubejs-backend/shared' ;
@@ -20,6 +21,10 @@ function resolveConstraint(name: string, constraintDetails: any): boolean {
2021 return constraintDetails . includes ( process . platform ) ;
2122 }
2223
24+ if ( name === 'arch' ) {
25+ return constraintDetails . includes ( process . arch ) ;
26+ }
27+
2328 displayCLIWarning ( `Unknown constraint name: ${ name } , pass: false` ) ;
2429
2530 return false ;
@@ -39,6 +44,10 @@ function resolveVariableValue(value: any): string | false {
3944 }
4045 }
4146
47+ if ( value === 'libc' ) {
48+ return resolveLibc ( ) ;
49+ }
50+
4251 displayCLIWarning ( `Unable to resolve value, unknown value ${ value } ` ) ;
4352
4453 return false ;
@@ -82,16 +91,19 @@ function resolveVars(variables: Record<string, any>): UrlVariable[] {
8291 return res ;
8392}
8493
94+ function resolveLibc ( ) : string {
95+ if ( process . platform === 'linux' ) {
96+ return detectLibc ( ) === 'gnu' ? 'glibc' : 'musl' ;
97+ }
98+
99+ return 'unknown' ;
100+ }
101+
85102function resolvePath ( path : string , variables : UrlVariable [ ] ) : string {
86103 path = path . replace ( '${version}' , pkg . version ) ;
87104 path = path . replace ( '${platform}' , process . platform ) ;
88105 path = path . replace ( '${arch}' , process . arch ) ;
89-
90- if ( process . platform === 'linux' ) {
91- path = path . replace ( '${libc}' , detectLibc ( ) ) ;
92- } else {
93- path = path . replace ( '${libc}' , 'unknown' ) ;
94- }
106+ path = path . replace ( '${libc}' , resolveLibc ( ) ) ;
95107
96108 for ( const variable of variables ) {
97109 path = variable . resolve ( path ) ;
0 commit comments