mirror of https://github.com/aminya/setup-cpp
fix: avoid old LLVM release HTTP redirects
This commit is contained in:
parent
fb2a9a2418
commit
f0dd57ea4d
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -82,6 +82,23 @@ describe("setup-llvm", () => {
|
|||
execaSync(main_exe, { cwd: dirname, stdio: "inherit" })
|
||||
})
|
||||
|
||||
it("should setup LLVM from llvm.org", async () => {
|
||||
const { binDir } = await setupLLVM("5", directory, process.arch)
|
||||
await testBin("clang++", ["--version"], binDir)
|
||||
|
||||
expect(process.env.CC?.includes("clang")).toBeTruthy()
|
||||
expect(process.env.CXX?.includes("clang++")).toBeTruthy()
|
||||
|
||||
// test compilation
|
||||
const file = join(dirname, "main.cpp")
|
||||
const main_exe = join(dirname, addExeExt("main"))
|
||||
execaSync("clang++", [file, "-o", main_exe], { cwd: dirname })
|
||||
if (process.platform !== "win32") {
|
||||
await chmod(main_exe, "755")
|
||||
}
|
||||
execaSync(main_exe, { cwd: dirname, stdio: "inherit" })
|
||||
})
|
||||
|
||||
it("should setup clang-format", async () => {
|
||||
const osVersion = await ubuntuVersion()
|
||||
const { binDir } = await setupClangFormat(getVersion("llvm", "true", osVersion), directory, process.arch)
|
||||
|
|
|
@ -21,7 +21,9 @@ async function main() {
|
|||
for (let major = 1; major <= 9; major++) {
|
||||
for (let minor = 0; minor <= 9; minor++) {
|
||||
for (let patch = 0; patch <= 9; patch++) {
|
||||
const version = `${major}.${minor}.${patch}`
|
||||
const version = (major >= 3 && minor >= 4 && patch >= 1)
|
||||
? `${major}.${minor}`
|
||||
: `${major}.${minor}.${patch}`
|
||||
yield [version, `https://releases.llvm.org/${version}`] as [string, string]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ export async function getLLVMAssetURL(platform: string, arch: string, version: s
|
|||
)
|
||||
|
||||
if (websiteAsset !== undefined) {
|
||||
return `https://llvm.org/releases/${websiteAsset.tag}/${websiteAsset.name}`
|
||||
return `https://releases.llvm.org/${websiteAsset.tag}/${websiteAsset.name}`
|
||||
}
|
||||
|
||||
throw new Error(`No asset found for version ${version} matching ${keywords} and ${optionalKeywords}`)
|
||||
|
|
Loading…
Reference in New Issue