fix: install libtinfo-dev for llvm on linux

This commit is contained in:
Amin Yahyaabadi 2022-02-13 20:01:10 -08:00
parent 8bb24cdcdc
commit 4c2c9d3660
3 changed files with 18 additions and 8 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -244,17 +244,27 @@ async function getLLVMPackageInfo(version: string, platform: NodeJS.Platform, _a
} }
export async function setupLLVM(version: string, setupDir: string, arch: string): Promise<InstallationInfo> { export async function setupLLVM(version: string, setupDir: string, arch: string): Promise<InstallationInfo> {
const installationInfo = await setupBin("llvm", version, getLLVMPackageInfo, setupDir, arch) const installationInfo = await _setupLLVM(version, setupDir, arch)
await activateLLVM(installationInfo.installDir ?? setupDir, version) await activateLLVM(installationInfo.installDir ?? setupDir, version)
return installationInfo return installationInfo
} }
export async function activateLLVM(directory: string, versionGiven: string) { let didInit = false
async function _setupLLVM(version: string, setupDir: string, arch: string) {
const installationInfo = await setupBin("llvm", version, getLLVMPackageInfo, setupDir, arch)
if (!didInit) {
if (process.platform === "linux") { if (process.platform === "linux") {
// install llvm build dependencies // install llvm build dependencies
await setupAptPack("build-essential") // TODO(question) llvm needs ld. But does it need all the build-essential? await setupAptPack("build-essential") // TODO(question) llvm needs ld. But does it need all the build-essential?
await setupAptPack("libtinfo-dev")
} }
// eslint-disable-next-line require-atomic-updates
didInit = true
}
return installationInfo
}
export async function activateLLVM(directory: string, versionGiven: string) {
const version = semverCoerceIfInvalid(versionGiven) const version = semverCoerceIfInvalid(versionGiven)
const lib = path.join(directory, "lib") const lib = path.join(directory, "lib")
@ -295,7 +305,7 @@ export function setupClangTools(version: string, setupDir: string, arch: string)
if (isGitHubCI()) { if (isGitHubCI()) {
addLLVMLoggingMatcher() addLLVMLoggingMatcher()
} }
return setupBin("llvm", version, getLLVMPackageInfo, setupDir, arch) return _setupLLVM(version, setupDir, arch)
} }
function addLLVMLoggingMatcher() { function addLLVMLoggingMatcher() {