Skip to content

Commit 69f222b

Browse files
authored
chore(native): Disable python for linux-arm64 (not supported) (#6669)
1 parent 8f7f3f5 commit 69f222b

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

packages/cubejs-backend-native/js/post-install.ts

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import 'source-map-support/register';
33
import {
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+
85102
function 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);

packages/cubejs-backend-native/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"node": "^14.0.0 || ^16.0.0 || >=17.0.0"
3131
},
3232
"files": [
33+
"bin",
3334
"dist/js"
3435
],
3536
"devDependencies": {
@@ -70,14 +71,17 @@
7071
"constraints": {
7172
"platform": [
7273
"linux"
74+
],
75+
"arch": [
76+
"x64"
7377
]
7478
}
7579
}
7680
},
7781
"files": [
7882
{
79-
"host": "https://github.com/",
80-
"path": "/cube-js/cube/releases/download/v${version}/native-${platform}-${arch}-${libc}-${libpython_or_fallback}.tar.gz",
83+
"host": "https://github.com/cube-js/cube/releases/download/v${version}/",
84+
"path": "native-${platform}-${arch}-${libc}-${libpython_or_fallback}.tar.gz",
8185
"not_found": "Your system is not supported by @cubejs-backend/native, some feature will be unavailable."
8286
}
8387
]

packages/cubejs-backend-shared/src/platform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export enum LibraryExistsResult {
8383
export function libraryExists(libraryName: string): LibraryExistsResult {
8484
if (process.platform === 'linux') {
8585
try {
86-
const { status, output } = spawnSync('ldconfig -v', [], {
86+
const { status, output } = spawnSync('ldconfig', ['-v'], {
8787
encoding: 'utf8',
8888
// Using pipe to protect unexpect STDERR output
8989
stdio: 'pipe'

0 commit comments

Comments
 (0)