Skip to content

Commit bc4f5bf

Browse files
committed
update: try llvm 18.0
1 parent f2f3ce6 commit bc4f5bf

File tree

4 files changed

+24
-62
lines changed

4 files changed

+24
-62
lines changed

dist/index.js

Lines changed: 11 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.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.

index.js

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,45 +33,26 @@ export async function execute(cmd) {
3333
const installScript = path.join(__dirname, "../scripts/install_llvm.sh");
3434
await exec.exec(`sudo ${installScript}`);
3535
} else if (isMacOS) {
36-
await exec.exec("brew install llvm@16")
37-
let llvmPath = await execute("brew --prefix llvm@16");
3836
let libpath = await execute("brew --prefix zstd");
39-
core.addPath(`${llvmPath}/bin`)
4037
core.exportVariable('LIBRARY_PATH', `${libpath}/lib`)
38+
39+
await exec.exec("sudo port install llvm-18")
40+
let llvmPath = await execute("port contents llvm-18 | grep bin | head -n 1")
41+
core.addPath(llvmPath)
42+
43+
44+
4145
// core.exportVariable('LLVM_SYS_160_PREFIX', `${llvmPath}`)
4246
} else if (isWindows) {
43-
const downloadUrl = "https://github.com/mun-lang/llvm-package-windows/releases/download/v16.0.5/llvm-16.0.5-windows-x64-msvc17-mt.7z"
47+
const downloadUrl = "https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.0/clang+llvm-18.1.0-x86_64-pc-windows-msvc.tar.xz"
4448
core.info(`downloading LLVM from '${downloadUrl}'`)
4549
const downloadLocation = await tc.downloadTool(downloadUrl);
4650

47-
core.info("Succesfully downloaded LLVM release, extracting...")
48-
const llvmPath = "C:\\llvm";
49-
const _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
50-
let attempt = 1;
51-
while (true) {
52-
const args = [
53-
"x", // extract
54-
downloadLocation,
55-
`-o${llvmPath}`
56-
]
57-
const exit = await exec.exec(_7zPath, args);
58-
if (exit === 2 && attempt <= 4) {
59-
attempt += 1;
60-
console.error(`Error extracting LLVM release, retrying attempt #${attempt} after 1s..`)
61-
await new Promise(resolve => setTimeout(resolve, 1000));
62-
}
63-
else if (exit !== 0) {
64-
throw new Error("Could not extract LLVM and Clang binaries.");
65-
}
66-
else {
67-
core.info("Succesfully extracted LLVM release")
68-
break;
69-
}
70-
}
71-
51+
// extract package
52+
const llvmPath = await tc.extractTar(downloadLocation);
7253
core.addPath(`${llvmPath}\\bin`)
7354
core.exportVariable('LIBCLANG_PATH', `${llvmPath}\\bin`)
74-
// core.exportVariable('LLVM_SYS_160_PREFIX', `${llvmPath}`)
55+
// core.exportVariable('LLVM_SYS_180_PREFIX', `${llvmPath}`)
7556
} else {
7657
core.setFailed(`unsupported platform '${process.platform}'`)
7758
}

scripts/install_llvm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
set -eux
66

7-
LLVM_VERSION=16
7+
LLVM_VERSION=18
88
DISTRO=$(lsb_release -is)
99
VERSION=$(lsb_release -sr)
1010
DIST_VERSION="${DISTRO}_${VERSION}"

0 commit comments

Comments
 (0)