Skip to content

Commit

Permalink
Merge pull request #302 from baszalmstra/fix/llvm-windows-part2
Browse files Browse the repository at this point in the history
fix: manually extract llvm release to get more output
  • Loading branch information
baszalmstra authored Jan 23, 2021
2 parents b83c2ce + 9f8be24 commit e987aa6
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 8 deletions.
29 changes: 25 additions & 4 deletions .github/actions/install-llvm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1189,20 +1189,41 @@ async function execute(cmd) {
core.addPath(`${llvmPath}/bin`)
} else if(isWindows) {
const downloadUrl = "https://github.com/mun-lang/llvm-package-windows/releases/download/v8.0.1/llvm-8.0.1-windows-x64-msvc16.7z"
core.info(`downloading LLVM from '${downloadUrl}'`)
core.info(`Downloading LLVM from '${downloadUrl}'`)
const downloadLocation = await tc.downloadTool(downloadUrl);

core.info("succesfully downloaded llvm release, extracting...")
core.info("Succesfully downloaded LLVM release, extracting...")
const llvmPath = path.resolve("llvm");
const _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
const llvmPath = await tc.extract7z(downloadLocation, null, _7zPath)
let attempt = 1;
while(true) {
const args = [
"x", // extract
downloadLocation,
`-o${llvmPath}`
]
const exit = await exec.exec(_7zPath, args);
if(exit === 2 && attempt <= 4) {
attempt += 1;
console.error(`Error extracting LLVM release, retrying attempt #${attempt} after 1s..`)
await new Promise(resolve => setTimeout(resolve, 1000));
}
else if (exit !== 0) {
throw new Error("Could not extract LLVM and Clang binaries.");
}
else {
core.info("Succesfully extracted LLVM release")
break;
}
}

core.info("succesfully extracted llvm release")
core.addPath(`${llvmPath}/bin`)
core.exportVariable('LIBCLANG_PATH', `${llvmPath}/bin`)
} else {
core.setFailed(`unsupported platform '${process.platform}'`)
}
} catch(error) {
console.error(error.stack);
core.setFailed(error.message);
}
})();
Expand Down
29 changes: 25 additions & 4 deletions .github/actions/install-llvm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,41 @@ export async function execute(cmd) {
core.addPath(`${llvmPath}/bin`)
} else if(isWindows) {
const downloadUrl = "https://github.com/mun-lang/llvm-package-windows/releases/download/v8.0.1/llvm-8.0.1-windows-x64-msvc16.7z"
core.info(`downloading LLVM from '${downloadUrl}'`)
core.info(`Downloading LLVM from '${downloadUrl}'`)
const downloadLocation = await tc.downloadTool(downloadUrl);

core.info("succesfully downloaded llvm release, extracting...")
core.info("Succesfully downloaded LLVM release, extracting...")
const llvmPath = path.resolve("llvm");
const _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
const llvmPath = await tc.extract7z(downloadLocation, null, _7zPath)
let attempt = 1;
while(true) {
const args = [
"x", // extract
downloadLocation,
`-o${llvmPath}`
]
const exit = await exec.exec(_7zPath, args);
if(exit === 2 && attempt <= 4) {
attempt += 1;
console.error(`Error extracting LLVM release, retrying attempt #${attempt} after 1s..`)
await new Promise(resolve => setTimeout(resolve, 1000));
}
else if (exit !== 0) {
throw new Error("Could not extract LLVM and Clang binaries.");
}
else {
core.info("Succesfully extracted LLVM release")
break;
}
}

core.info("succesfully extracted llvm release")
core.addPath(`${llvmPath}/bin`)
core.exportVariable('LIBCLANG_PATH', `${llvmPath}/bin`)
} else {
core.setFailed(`unsupported platform '${process.platform}'`)
}
} catch(error) {
console.error(error.stack);
core.setFailed(error.message);
}
})();

0 comments on commit e987aa6

Please sign in to comment.