feat: auto install libtinfo5
This commit is contained in:
28
dist/index.js
generated
vendored
28
dist/index.js
generated
vendored
@@ -28287,6 +28287,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.download = download;
|
||||
exports.downloadRequirements = downloadRequirements;
|
||||
exports.getLatestVersion = getLatestVersion;
|
||||
const tc = __importStar(__nccwpck_require__(3472));
|
||||
const core = __importStar(__nccwpck_require__(7484));
|
||||
@@ -28336,6 +28337,29 @@ async function download(version) {
|
||||
const cachedPath = await tc.cacheDir(`/tmp/clang-${version}`, 'clang', version);
|
||||
return cachedPath;
|
||||
}
|
||||
async function downloadRequirements() {
|
||||
if (process.platform == 'linux') {
|
||||
const url = 'http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.2-0ubuntu2.1_amd64.deb';
|
||||
core.info(`Downloading libtinfo5 (${process.platform}, ${process.arch}) from ${url} ...`);
|
||||
const archivePath = await tc.downloadTool(url);
|
||||
core.info(`Extracting libtinfo5 archive...`);
|
||||
let exit = await exec.exec('mkdir', ['-p', `/tmp/libtinfo5_6.2`]);
|
||||
if (exit !== 0) {
|
||||
throw new Error(`Failed to create directory /tmp/libtinfo5_6.2`);
|
||||
}
|
||||
exit = await exec.exec('dpkg-deb', [
|
||||
'-xv',
|
||||
archivePath,
|
||||
'/tmp/libtinfo5_6.2'
|
||||
]);
|
||||
if (exit !== 0) {
|
||||
throw new Error(`Failed to extract libtinfo5`);
|
||||
}
|
||||
const cachedPath = await tc.cacheDir(`/tmp/libtinfo5_6.2`, 'libtinfo5', '6.2');
|
||||
return cachedPath;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
async function getLatestVersion() {
|
||||
const http = new httpm.HttpClient('siteorg/setup-clang');
|
||||
const url = 'https://api.github.com/repos/llvm/llvm-project/releases';
|
||||
@@ -28403,12 +28427,14 @@ async function run() {
|
||||
clangVersion = await (0, download_1.getLatestVersion)();
|
||||
}
|
||||
const downloadPath = await (0, download_1.download)(clangVersion);
|
||||
const downloadRequirementsPath = await (0, download_1.downloadRequirements)();
|
||||
const bin = path.join(downloadPath, 'bin');
|
||||
const lib = path.join(downloadPath, 'lib');
|
||||
const requirementsLib = path.join(downloadRequirementsPath, 'lib');
|
||||
core.addPath(bin);
|
||||
core.exportVariable('LLVM_PATH', downloadPath);
|
||||
const ld = process.env.LD_LIBRARY_PATH ?? '';
|
||||
core.exportVariable('LD_LIBRARY_PATH', `${lib}${path.delimiter}${ld}`);
|
||||
core.exportVariable('LD_LIBRARY_PATH', `${requirementsLib}${path.delimiter}${lib}${path.delimiter}${ld}`);
|
||||
// Ensure system libraries are first on ARM64 macOS to avoid issues with Apple's libc++ being weird.
|
||||
// https://discourse.llvm.org/t/apples-libc-now-provides-std-type-descriptor-t-functionality-not-found-in-upstream-libc/73881/5
|
||||
const dyld = process.env.DYLD_LIBRARY_PATH;
|
||||
|
||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user