fix: fix recovering llvm from cache

This commit is contained in:
Amin Yahyaabadi 2022-01-29 16:14:55 -08:00
parent 60472486f4
commit 0db19fa5c2
4 changed files with 15 additions and 3 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

@ -49,6 +49,18 @@ describe("setup-llvm", () => {
expect(process.env.CXX?.includes("clang++")).toBeTruthy()
})
it("should find llvm in the cache", async () => {
const { binDir } = await setupLLVM("11.0.0", directory, "")
await testBin("clang++", ["--version"], binDir)
expect(binDir.includes("ToolCache")).toBeTruthy()
expect(process.env.CC?.includes("clang")).toBeTruthy()
expect(process.env.CXX?.includes("clang++")).toBeTruthy()
expect(process.env.CC?.includes("ToolCache")).toBeTruthy()
expect(process.env.CXX?.includes("ToolCache")).toBeTruthy()
})
it("should setup clang-tidy and clang-format", async () => {
const { binDir } = await setupClangTools("11.0.0", directory, "")
await testBin("clang-tidy", ["--version"], binDir)

View File

@ -242,7 +242,7 @@ export async function setupLLVM(
_arch: string
): Promise<InstallationInfo> {
const installationInfo = await setupBin("llvm", version, getLLVMPackageInfo, setupDir)
await activateLLVM(setupDir, version)
await activateLLVM(installationInfo.installDir ?? setupDir, version)
return installationInfo
}