Skip to content

Commit d8d2cae

Browse files
committed
fix: fix llvm installation on alpine
1 parent 477dd40 commit d8d2cae

File tree

5 files changed

+7
-16
lines changed

5 files changed

+7
-16
lines changed

dist/legacy/setup-cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/modern/setup-cpp.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/llvm/llvm_apk_installer.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
import path, { join } from "path"
2-
import { fileURLToPath } from "url"
3-
import { execRootSync } from "admina"
41
import { info } from "ci-log"
52
import { type InstallationInfo, hasApk, installApkPack } from "setup-alpine"
63
import { majorLLVMVersion } from "./utils.ts"
74

8-
const dirname = typeof __dirname === "string" ? __dirname : path.dirname(fileURLToPath(import.meta.url))
9-
105
/**
116
* Try to setup LLVM via the apk package manager
127
*
@@ -25,16 +20,12 @@ export async function trySetupLLVMApk(
2520
try {
2621
return await setupLLVMApk(version)
2722
} catch (err) {
28-
info(`Failed to install llvm via system package manager ${err}. Trying to remove the repository`)
29-
try {
30-
execRootSync(join(dirname, "llvm_repo_remove.bash"), [`${majorLLVMVersion(version)}`])
31-
} catch (removeErr) {
32-
info(`Failed to remove llvm repository ${removeErr}`)
33-
}
23+
info(`Failed to install llvm via system package manager ${err}.`)
3424
}
3525
return undefined
3626
}
3727

3828
export function setupLLVMApk(version: string): Promise<InstallationInfo> {
39-
return installApkPack([{ name: "llvm", version }])
29+
const majorVersion = majorLLVMVersion(version)
30+
return installApkPack([{ name: `llvm${majorVersion}` }])
4031
}

0 commit comments

Comments
 (0)