Skip to content

Commit 0db19fa

Browse files
committed
fix: fix recovering llvm from cache
1 parent 6047248 commit 0db19fa

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

dist/setup_cpp.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/llvm/__tests__/llvm.test.ts

+12
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ describe("setup-llvm", () => {
4949
expect(process.env.CXX?.includes("clang++")).toBeTruthy()
5050
})
5151

52+
it("should find llvm in the cache", async () => {
53+
const { binDir } = await setupLLVM("11.0.0", directory, "")
54+
await testBin("clang++", ["--version"], binDir)
55+
56+
expect(binDir.includes("ToolCache")).toBeTruthy()
57+
58+
expect(process.env.CC?.includes("clang")).toBeTruthy()
59+
expect(process.env.CXX?.includes("clang++")).toBeTruthy()
60+
expect(process.env.CC?.includes("ToolCache")).toBeTruthy()
61+
expect(process.env.CXX?.includes("ToolCache")).toBeTruthy()
62+
})
63+
5264
it("should setup clang-tidy and clang-format", async () => {
5365
const { binDir } = await setupClangTools("11.0.0", directory, "")
5466
await testBin("clang-tidy", ["--version"], binDir)

src/llvm/llvm.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ export async function setupLLVM(
242242
_arch: string
243243
): Promise<InstallationInfo> {
244244
const installationInfo = await setupBin("llvm", version, getLLVMPackageInfo, setupDir)
245-
await activateLLVM(setupDir, version)
245+
await activateLLVM(installationInfo.installDir ?? setupDir, version)
246246
return installationInfo
247247
}
248248

0 commit comments

Comments
 (0)