Merge pull request #285 from aminya/llvm [skip ci]

This commit is contained in:
Amin Yahyaabadi 2024-09-08 05:35:12 -07:00 committed by GitHub
commit 7b3520d222
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
37 changed files with 1637 additions and 549 deletions

View File

@ -87,7 +87,7 @@ jobs:
- windows-2022 - windows-2022
- ubuntu-24.04 - ubuntu-24.04
- macos-13 - macos-13
# - macos-12 - macos-14 # arm64
node: node:
- 22 - 22
pnpm: pnpm:
@ -152,6 +152,7 @@ jobs:
- ubuntu-24.04 - ubuntu-24.04
- ubuntu-22.04 - ubuntu-22.04
- ubuntu-20.04 - ubuntu-20.04
- macos-14
- macos-13 - macos-13
- macos-12 - macos-12
node: node:
@ -216,6 +217,7 @@ jobs:
RUNNER_OS_NAME: ${{ matrix.os }} RUNNER_OS_NAME: ${{ matrix.os }}
- name: Setup Node 12 - name: Setup Node 12
if: ${{ !contains(matrix.os, 'macos-14') }}
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 12 node-version: 12

2
.gitignore vendored
View File

@ -20,3 +20,5 @@ exe/
coverage coverage
.turbo .turbo
/src/llvm/assets/

View File

@ -8,7 +8,7 @@ Setting up a **cross-platform** environment for building and testing C++/C proje
`setup-cpp` can be used locally from terminal, from CI services like GitHub Actions and GitLab Pipelines, and inside containers like Docker. `setup-cpp` can be used locally from terminal, from CI services like GitHub Actions and GitLab Pipelines, and inside containers like Docker.
`setup-cpp` is supported on many platforms. It is continuously tested on several configurations including Windows (11, 10, 2022, 2019), Linux (Ubuntu 24.0, 22.04, 20.04, 18.04, Fedora, ArchLinux), and macOS (13, 12, 11, 10.15). `setup-cpp` is backed by unit tests for each tool and integration tests for compiling cpp projects. `setup-cpp` is supported on many platforms. It is continuously tested on several configurations including Windows (11, 10, 2022, 2019) x64/ARM/x86, Linux (Ubuntu 24.0, 22.04, 20.04, 18.04, Fedora, ArchLinux) x64/ARM, and macOS (14, 13, 12, 11, 10.15) x64/ARM. `setup-cpp` is backed by unit tests for each tool and integration tests for compiling cpp projects.
## Features ## Features

View File

@ -11,11 +11,13 @@ ignorePaths:
- "**/node_modules/" - "**/node_modules/"
- .vscode/extensions.json - .vscode/extensions.json
- patches/*.patch - patches/*.patch
- "**/github_brechtsanders_winlibs_mingw.json" - "**/github_*.json"
- "**/llvm_org_releases.json"
words: words:
- aarch - aarch
- aminya - aminya
- applellvm - applellvm
- armv
- bazel - bazel
- bazelisk - bazelisk
- biome - biome
@ -73,6 +75,7 @@ words:
- nala - nala
- noconfirm - noconfirm
- nodistro - nodistro
- NOPASSWD
- noprogressbar - noprogressbar
- nothrow - nothrow
- npmrc - npmrc

View File

@ -34,7 +34,7 @@ function main() {
`./exe/setup-cpp-${process.arch}-${getPlatformName()}${exe}`, `./exe/setup-cpp-${process.arch}-${getPlatformName()}${exe}`,
"--", "--",
`{{caxa}}/node_modules/.bin/node${exe}`, `{{caxa}}/node_modules/.bin/node${exe}`,
"{{caxa}}/setup-cpp.js", "{{caxa}}/setup-cpp.mjs",
]) ])
), ),
) )

File diff suppressed because one or more lines are too long

1
dist/legacy/llvm_org_releases.json vendored Normal file

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

1
dist/modern/llvm_org_releases.json vendored Normal file

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

View File

@ -1,5 +1,5 @@
import { tmpdir } from "os" import { tmpdir } from "os"
import { dirname } from "path" import { dirname, join } from "path"
import { type AddPathOptions, addPath } from "envosman" import { type AddPathOptions, addPath } from "envosman"
import { execaSync } from "execa" import { execaSync } from "execa"
import { DownloaderHelper } from "node-downloader-helper" import { DownloaderHelper } from "node-downloader-helper"
@ -64,23 +64,33 @@ export async function setupBrew(options: SetupBrewOptions = {}): Promise<Install
return { binDir } return { binDir }
} }
/**
* Get the path to the bin directory of brew
* @returns {string} The path where brew binary is installed
*
* Based on the installation script from https://brew.sh
*/
export function getBrewBinDir() {
return join(getBrewDir(), "bin")
}
/** /**
* Get the path where brew is installed * Get the path where brew is installed
* @returns {string} The path where brew is installed * @returns {string} The path where brew is installed
* *
* Based on the installation script from https://brew.sh * Based on the installation script from https://brew.sh
*/ */
export function getBrewBinDir() { export function getBrewDir() {
if (process.platform === "darwin") { if (process.platform === "darwin") {
if (process.arch === "arm64") { if (process.arch === "arm64") {
return "/opt/homebrew/bin/" return "/opt/homebrew"
} else { } else {
return "/usr/local/bin/" return "/usr/local"
} }
} }
if (process.platform === "linux") { if (process.platform === "linux") {
return "/home/linuxbrew/.linuxbrew/bin/" return "/home/linuxbrew/.linuxbrew"
} }
throw new Error("Unsupported platform for brew") throw new Error("Unsupported platform for brew")

View File

@ -1,7 +1,7 @@
import { parseArgs } from "../cli-options.js" import { parseArgs } from "../cli-options.js"
import { getCompilerInfo } from "../compilers.js" import { getCompilerInfo } from "../compilers.js"
import type { Inputs } from "../tool.js" import type { Inputs } from "../tool.js"
import { DefaultLinuxVersion } from "../versions/default_versions.js" import { DefaultUbuntuVersion, DefaultVersions } from "../versions/default_versions.js"
import { getVersion, syncVersions } from "../versions/versions.js" import { getVersion, syncVersions } from "../versions/versions.js"
jest.setTimeout(300000) jest.setTimeout(300000)
@ -55,18 +55,18 @@ describe("getVersion", () => {
it("gcovr", () => { it("gcovr", () => {
expect(getVersion("gcovr", "5.0")).toBe("5.0") expect(getVersion("gcovr", "5.0")).toBe("5.0")
if (process.platform === "linux") { if (process.platform === "linux") {
expect(getVersion("gcovr", "true", [22, 4])).toBe(DefaultLinuxVersion.gcovr![22]) expect(getVersion("gcovr", "true", [22, 4])).toBe(DefaultUbuntuVersion.gcovr![22])
expect(getVersion("gcovr", "true", [20, 4])).toBe(DefaultLinuxVersion.gcovr![20]) expect(getVersion("gcovr", "true", [20, 4])).toBe(DefaultUbuntuVersion.gcovr![20])
expect(getVersion("gcovr", "true", [18, 4])).toBe(DefaultLinuxVersion.gcovr![18]) expect(getVersion("gcovr", "true", [18, 4])).toBe(DefaultUbuntuVersion.gcovr![18])
} }
}) })
it("llvm", () => { it("llvm", () => {
expect(getVersion("llvm", "13.0.0")).toBe("13.0.0") expect(getVersion("llvm", "13.0.0")).toBe("13.0.0")
if (process.platform === "linux") { if (process.platform === "linux") {
expect(getVersion("llvm", "true", [20, 4])).toBe(DefaultLinuxVersion.llvm![20]) expect(getVersion("llvm", "true", [20, 4])).toBe(DefaultVersions.llvm)
expect(getVersion("llvm", "true", [18, 4])).toBe(DefaultLinuxVersion.llvm![18]) expect(getVersion("llvm", "true", [18, 4])).toBe(DefaultVersions.llvm)
expect(getVersion("llvm", "true", [16, 4])).toBe(DefaultLinuxVersion.llvm![16]) expect(getVersion("llvm", "true", [16, 4])).toBe(DefaultVersions.llvm)
} }
}) })
}) })

View File

@ -1,6 +1,8 @@
import { info } from "ci-log"
import { addExeExt } from "patha" import { addExeExt } from "patha"
import semverCoerce from "semver/functions/coerce" import semverCoerce from "semver/functions/coerce"
import semverLte from "semver/functions/lte" import semverLte from "semver/functions/lte"
import { arm64, x86, x86_64 } from "../utils/env/arch.js"
import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin.js" import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin.js"
/** Get the platform data for cmake */ /** Get the platform data for cmake */
@ -10,10 +12,15 @@ function getCmakePackageInfo(version: string, platform: NodeJS.Platform, arch: s
case "win32": { case "win32": {
const isOld = semverLte(semVersion, "v3.19.6") const isOld = semverLte(semVersion, "v3.19.6")
let osArchStr: string let osArchStr: string
if (["ia32", "x86", "i386", "x32"].includes(arch)) { if (x86_64.includes(arch)) {
osArchStr = isOld ? "win32-x86" : "windows-i386"
} else {
osArchStr = isOld ? "win64-x64" : "windows-x86_64" osArchStr = isOld ? "win64-x64" : "windows-x86_64"
} else if (x86.includes(arch)) {
osArchStr = isOld ? "win32-x86" : "windows-i386"
} else if (arm64.includes(arch)) {
osArchStr = "windows-arm64"
} else {
info(`Trying unsupported arch '${arch}' for cmake on Windows`)
osArchStr = `windows-${arch}`
} }
const folderName = `cmake-${version}-${osArchStr}` const folderName = `cmake-${version}-${osArchStr}`
return { return {
@ -37,10 +44,13 @@ function getCmakePackageInfo(version: string, platform: NodeJS.Platform, arch: s
case "linux": { case "linux": {
const isOld = semverLte(semVersion, "v3.19.8") const isOld = semverLte(semVersion, "v3.19.8")
let osArchStr: string let osArchStr: string
if (["aarch64"].includes(arch)) { if (arm64.includes(arch)) {
osArchStr = isOld ? "Linux-aarch64" : "linux-aarch64" osArchStr = isOld ? "Linux-aarch64" : "linux-aarch64"
} else { } else if (x86_64.includes(arch)) {
osArchStr = isOld ? "Linux-x86_64" : "linux-x86_64" osArchStr = isOld ? "Linux-x86_64" : "linux-x86_64"
} else {
info(`Trying unsupported arch '${arch}' for cmake on Linux`)
osArchStr = `linux-${arch}`
} }
const folderName = `cmake-${version}-${osArchStr}` const folderName = `cmake-${version}-${osArchStr}`
return { return {

View File

@ -1,4 +1,4 @@
import { saveGitHubAssetList } from "../utils/github/fetch-assets.ts" import { saveGitHubAssetList } from "../utils/asset/fetch-github-assets.ts"
/** /**
* Generate the list of all releases of a GitHub repository and save it to a json file * Generate the list of all releases of a GitHub repository and save it to a json file

View File

@ -13,10 +13,10 @@ import { addUpdateAlternativesToRc, installAptPack } from "setup-apt"
import { installBrewPack } from "setup-brew" import { installBrewPack } from "setup-brew"
import { rcOptions } from "../cli-options.js" import { rcOptions } from "../cli-options.js"
import { setupMacOSSDK } from "../macos-sdk/macos-sdk.js" import { setupMacOSSDK } from "../macos-sdk/macos-sdk.js"
import { loadAssetList, matchAsset } from "../utils/asset/load-assets.js"
import { hasDnf } from "../utils/env/hasDnf.js" import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js" import { isArch } from "../utils/env/isArch.js"
import { isUbuntu } from "../utils/env/isUbuntu.js" import { isUbuntu } from "../utils/env/isUbuntu.js"
import { loadGitHubAssetList, matchAsset } from "../utils/github/load-assets.js"
import { extract7Zip } from "../utils/setup/extract.js" import { extract7Zip } from "../utils/setup/extract.js"
import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin.js" import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js" import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
@ -29,21 +29,29 @@ const dirname = typeof __dirname === "string" ? __dirname : path.dirname(fileURL
async function getGccPackageInfo(version: string, platform: NodeJS.Platform, arch: string): Promise<PackageInfo> { async function getGccPackageInfo(version: string, platform: NodeJS.Platform, arch: string): Promise<PackageInfo> {
switch (platform) { switch (platform) {
case "win32": { case "win32": {
const mingwAssets = await loadGitHubAssetList( const mingwAssets = await loadAssetList(
join(dirname, "github_brechtsanders_winlibs_mingw.json"), join(dirname, "github_brechtsanders_winlibs_mingw.json"),
) )
const mingwArchMap = {
x64: "x86_64",
ia32: "i386",
} as Record<string, string | undefined>
const asset = matchAsset( const asset = matchAsset(
mingwAssets, mingwAssets,
{ {
version, version,
arch: arch === "x64" keywords: [
? "x86_64" mingwArchMap[arch] ?? arch,
: arch === "ia32" ],
? "i386"
: arch,
}, },
) )
if (asset === undefined) {
throw new Error(`No asset found for version ${version} and arch ${arch}`)
}
return { return {
binRelativeDir: "bin/", binRelativeDir: "bin/",
binFileName: addExeExt("g++"), binFileName: addExeExt("g++"),

View File

@ -3,25 +3,16 @@ import { fileURLToPath } from "url"
import * as io from "@actions/io" import * as io from "@actions/io"
import { execaSync } from "execa" import { execaSync } from "execa"
import { chmod } from "fs/promises" import { chmod } from "fs/promises"
import { isUrlOnline } from "is-url-online"
import { addExeExt } from "patha" import { addExeExt } from "patha"
import { ubuntuVersion } from "../../utils/env/ubuntu_version.js" import { ubuntuVersion } from "../../utils/env/ubuntu_version.js"
import { getSpecificVersionAndUrl } from "../../utils/setup/version.js"
import { setupTmpDir, testBin } from "../../utils/tests/test-helpers.js" import { setupTmpDir, testBin } from "../../utils/tests/test-helpers.js"
import { getVersion } from "../../versions/versions.js" import { getVersion } from "../../versions/versions.js"
import { setupClangFormat, setupClangTools, setupLLVM } from "../llvm.js" import { setupClangFormat, setupClangTools, setupLLVM } from "../llvm.js"
import { VERSIONS, getLinuxUrl, getUrl } from "../llvm_url.js" import { getLLVMAssetURL } from "../llvm_url.js"
const dirname = typeof __dirname === "string" ? __dirname : path.dirname(fileURLToPath(import.meta.url)) const dirname = typeof __dirname === "string" ? __dirname : path.dirname(fileURLToPath(import.meta.url))
jest.setTimeout(400000) jest.setTimeout(400000)
async function testUrl(version: string) {
const [specificVersion, url] = await getSpecificVersionAndUrl(VERSIONS, process.platform, version, getUrl)
if (!(await isUrlOnline(url))) {
throw new Error(`Failed to install Version: ${version} => ${specificVersion} \n URL: ${url}`)
}
}
describe("setup-llvm", () => { describe("setup-llvm", () => {
let directory: string let directory: string
@ -31,44 +22,24 @@ describe("setup-llvm", () => {
it("Finds URL for ubuntu version", async () => { it("Finds URL for ubuntu version", async () => {
expect( expect(
await getSpecificVersionAndUrl( await getLLVMAssetURL("linux", "x86_64", "13.0.0"),
VERSIONS, ).toStrictEqual(
"linux",
"13.0.0-ubuntu-16.04",
(_plantform, version) => getLinuxUrl(version),
),
).toStrictEqual([
"13.0.0-ubuntu-16.04",
"https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
])
expect(
await getSpecificVersionAndUrl(
VERSIONS,
"linux",
"13.0.1-ubuntu-18.04",
(_plantform, version) => getLinuxUrl(version),
),
).toStrictEqual([
"13.0.1-ubuntu-18.04",
"https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.1/clang+llvm-13.0.1-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
])
expect(
await getSpecificVersionAndUrl(
VERSIONS,
"linux",
"13.0.0-ubuntu-20.04",
(_plantform, version) => getLinuxUrl(version),
),
).toStrictEqual([
"13.0.0-ubuntu-20.04",
"https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz", "https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz",
]) )
expect(
await getLLVMAssetURL("linux", "x86_64", "13.0.1"),
).toStrictEqual(
"https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.1/clang+llvm-13.0.1-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
)
}) })
it("Finds valid LLVM URLs", async () => { it("Finds valid LLVM URLs", async () => {
await Promise.all( await Promise.all(
[ [
...(process.platform === "darwin" ? [] : ["16.0.2", "16.0.0"]), "18",
"17",
"16",
"15",
"15.0.2", "15.0.2",
// "14.0.1", // "14.0.1",
"14.0.0", "14.0.0",
@ -89,7 +60,7 @@ describe("setup-llvm", () => {
"5", "5",
"5.0.0", "5.0.0",
"4", "4",
].map((version) => testUrl(version)), ].map((version) => getLLVMAssetURL("win32", "x64", version)),
) )
}) })

49
src/llvm/assets-list.ts Normal file
View File

@ -0,0 +1,49 @@
import { saveGitHubAssetList } from "../utils/asset/fetch-github-assets.ts"
import { saveHTMLAssets } from "../utils/asset/fetch-html-assets.ts"
/**
* Generate the list of all releases of a GitHub repository and save it to a json file
*/
async function main() {
// https://github.com/llvm/llvm-project/releases
await saveGitHubAssetList(
"llvm",
"llvm-project",
"./src/llvm/github_llvm_llvm-project.json",
isAssetArchive,
)
// go through https://releases.llvm.org/x.y.z and get all the assets
await saveHTMLAssets({
htmlDownloadDir: "./src/llvm/assets/",
path: "./src/llvm/llvm_org_releases.json",
*getAssetVersionAndURL() {
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}`
yield [version, `https://releases.llvm.org/${version}`] as [string, string]
}
}
}
},
filterAssets: isAssetArchive,
})
}
function isAssetArchive(asset: string): boolean {
// only download the LLVM and clang+llvm archives
return (asset.startsWith("LLVM-")
|| asset.startsWith("clang+llvm-")
|| asset.startsWith("clang%2Bllvm-")) // cspell: disable-line
// only download the archives
&& (asset.endsWith("tar.xz")
|| asset.endsWith("zip")
|| asset.endsWith("exe")
|| asset.endsWith("tar.gz"))
}
main().catch((err) => {
console.error(err)
process.exit(1)
})

View File

@ -0,0 +1,605 @@
{
"llvmorg-18.1.8": [
"clang+llvm-18.1.8-x86_64-pc-windows-msvc.tar.xz",
"clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
"clang+llvm-18.1.8-powerpc64le-linux-rhel-8.8.tar.xz",
"clang+llvm-18.1.8-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-18.1.8-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-18.1.8-arm64-apple-macos11.tar.xz",
"clang+llvm-18.1.8-aarch64-linux-gnu.tar.xz",
"LLVM-18.1.8-woa64.exe",
"LLVM-18.1.8-win64.exe",
"LLVM-18.1.8-win32.exe"
],
"llvmorg-18.1.7": [
"clang+llvm-18.1.7-x86_64-pc-windows-msvc.tar.xz",
"clang+llvm-18.1.7-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
"clang+llvm-18.1.7-powerpc64le-linux-rhel-8.8.tar.xz",
"clang+llvm-18.1.7-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-18.1.7-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-18.1.7-aarch64-linux-gnu.tar.xz",
"LLVM-18.1.7-woa64.exe",
"LLVM-18.1.7-win64.exe",
"LLVM-18.1.7-win32.exe"
],
"llvmorg-18.1.6": [
"clang+llvm-18.1.6-x86_64-pc-windows-msvc.tar.xz",
"clang+llvm-18.1.6-sparcv9-sun-solaris2.11.tar.xz",
"clang+llvm-18.1.6-powerpc64le-linux-rhel-8.8.tar.xz",
"clang+llvm-18.1.6-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-18.1.6-amd64-pc-solaris2.11.tar.xz",
"clang+llvm-18.1.6-aarch64-linux-gnu.tar.xz",
"LLVM-18.1.6-woa64.exe",
"LLVM-18.1.6-win64.exe",
"LLVM-18.1.6-win32.exe"
],
"llvmorg-18.1.5": [
"clang+llvm-18.1.5-x86_64-pc-windows-msvc.tar.xz",
"clang+llvm-18.1.5-powerpc64le-linux-rhel-8.8.tar.xz",
"clang+llvm-18.1.5-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-18.1.5-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-18.1.5-aarch64-linux-gnu.tar.xz",
"LLVM-18.1.5-woa64.exe",
"LLVM-18.1.5-win64.exe",
"LLVM-18.1.5-win32.exe"
],
"llvmorg-18.1.4": [
"clang+llvm-18.1.4-x86_64-pc-windows-msvc.tar.xz",
"clang+llvm-18.1.4-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
"clang+llvm-18.1.4-powerpc64le-linux-rhel-8.8.tar.xz",
"clang+llvm-18.1.4-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-18.1.4-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-18.1.4-aarch64-linux-gnu.tar.xz",
"LLVM-18.1.4-woa64.exe",
"LLVM-18.1.4-win64.exe",
"LLVM-18.1.4-win32.exe"
],
"llvmorg-18.1.3": [
"clang+llvm-18.1.3-powerpc64le-linux-rhel-8.8.tar.xz",
"clang+llvm-18.1.3-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-18.1.3-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-18.1.3-aarch64-linux-gnu.tar.xz",
"LLVM-18.1.3-woa64.exe",
"LLVM-18.1.3-win64.exe",
"LLVM-18.1.3-win32.exe"
],
"llvmorg-18.1.2": [
"clang+llvm-18.1.2-x86_64-pc-windows-msvc.tar.xz",
"clang+llvm-18.1.2-sparcv9-sun-solaris2.11.tar.xz",
"clang+llvm-18.1.2-powerpc64le-linux-rhel-8.8.tar.xz",
"clang+llvm-18.1.2-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-18.1.2-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-18.1.2-amd64-pc-solaris2.11.tar.xz",
"clang+llvm-18.1.2-aarch64-linux-gnu.tar.xz",
"LLVM-18.1.2-woa64.exe",
"LLVM-18.1.2-win64.exe",
"LLVM-18.1.2-win32.exe"
],
"llvmorg-18.1.1": [
"clang+llvm-18.1.1-x86_64-pc-windows-msvc.tar.xz",
"clang+llvm-18.1.1-powerpc64le-linux-rhel-8.8.tar.xz",
"clang+llvm-18.1.1-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-18.1.1-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-18.1.1-aarch64-linux-gnu.tar.xz",
"LLVM-18.1.1-woa64.exe",
"LLVM-18.1.1-win64.exe",
"LLVM-18.1.1-win32.exe"
],
"llvmorg-18.1.0": [
"clang+llvm-18.1.0-x86_64-pc-windows-msvc.tar.xz",
"clang+llvm-18.1.0-sparcv9-unknown-linux-gnu.tar.xz",
"clang+llvm-18.1.0-sparcv9-sun-solaris2.11.tar.xz",
"clang+llvm-18.1.0-powerpc64le-linux-rhel-8.8.tar.xz",
"clang+llvm-18.1.0-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-18.1.0-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-18.1.0-amd64-pc-solaris2.11.tar.xz",
"clang+llvm-18.1.0-aarch64-linux-gnu.tar.xz",
"LLVM-18.1.0-woa64.exe",
"LLVM-18.1.0-win64.exe",
"LLVM-18.1.0-win32.exe"
],
"llvmorg-17.0.6": [
"clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04.tar.xz",
"clang+llvm-17.0.6-sparcv9-sun-solaris2.11.tar.xz",
"clang+llvm-17.0.6-powerpc64le-linux-rhel-8.8.tar.xz",
"clang+llvm-17.0.6-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-17.0.6-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-17.0.6-arm64-apple-darwin22.0.tar.xz",
"clang+llvm-17.0.6-amd64-pc-solaris2.11.tar.xz",
"clang+llvm-17.0.6-aarch64-linux-gnu.tar.xz",
"LLVM-17.0.6-woa64.exe",
"LLVM-17.0.6-win64.exe",
"LLVM-17.0.6-win32.exe"
],
"llvmorg-17.0.5": [
"clang+llvm-17.0.5-x86_64-linux-gnu-ubuntu-22.04.tar.xz",
"clang+llvm-17.0.5-powerpc64le-linux-rhel-8.8.tar.xz",
"clang+llvm-17.0.5-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-17.0.5-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-17.0.5-arm64-apple-darwin22.0.tar.xz",
"clang+llvm-17.0.5-aarch64-linux-gnu.tar.xz",
"LLVM-17.0.5-woa64.exe",
"LLVM-17.0.5-win64.exe",
"LLVM-17.0.5-win32.exe"
],
"llvmorg-17.0.4": [
"clang+llvm-17.0.4-x86_64-linux-gnu-ubuntu-22.04.tar.xz",
"clang+llvm-17.0.4-powerpc64le-linux-rhel-8.8.tar.xz",
"clang+llvm-17.0.4-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-17.0.4-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-17.0.4-arm64-apple-darwin22.0.tar.xz",
"clang+llvm-17.0.4-aarch64-linux-gnu.tar.xz",
"LLVM-17.0.4-woa64.exe",
"LLVM-17.0.4-win64.exe",
"LLVM-17.0.4-win32.exe"
],
"llvmorg-17.0.3": [
"clang+llvm-17.0.3-powerpc64le-linux-rhel-8.8.tar.xz",
"clang+llvm-17.0.3-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-17.0.3-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-17.0.3-arm64-apple-darwin22.0.tar.xz",
"clang+llvm-17.0.3-aarch64-linux-gnu.tar.xz",
"LLVM-17.0.3-woa64.exe",
"LLVM-17.0.3-win64.exe",
"LLVM-17.0.3-win32.exe"
],
"llvmorg-17.0.2": [
"clang+llvm-17.0.2-x86_64-linux-gnu-ubuntu-22.04.tar.xz",
"clang+llvm-17.0.2-sparcv9-sun-solaris2.11.tar.xz",
"clang+llvm-17.0.2-sparc64-unknown-linux-gnu.tar.xz",
"clang+llvm-17.0.2-powerpc64le-linux-rhel-8.8.tar.xz",
"clang+llvm-17.0.2-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-17.0.2-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-17.0.2-arm64-apple-darwin22.0.tar.xz",
"clang+llvm-17.0.2-amd64-pc-solaris2.11.tar.xz",
"clang+llvm-17.0.2-aarch64-linux-gnu.tar.xz",
"LLVM-17.0.2-woa64.exe",
"LLVM-17.0.2-win64.exe",
"LLVM-17.0.2-win32.exe"
],
"llvmorg-17.0.1": [
"clang+llvm-17.0.1-sparcv9-sun-solaris2.11.tar.xz",
"clang+llvm-17.0.1-sparc64-unknown-linux-gnu.tar.xz",
"clang+llvm-17.0.1-powerpc64le-linux-rhel-8.8.tar.xz",
"clang+llvm-17.0.1-final_powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-17.0.1-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-17.0.1-arm64-apple-darwin22.0.tar.xz",
"clang+llvm-17.0.1-amd64-pc-solaris2.11.tar.xz",
"clang+llvm-17.0.1-aarch64-linux-gnu.tar.xz",
"LLVM-17.0.1-woa64.exe",
"LLVM-17.0.1-win64.exe",
"LLVM-17.0.1-win32.exe"
],
"llvmorg-16.0.6": [
"clang+llvm-16.0.6-powerpc64le-linux-rhel-8.7.tar.xz",
"clang+llvm-16.0.6-aarch64-linux-gnu.tar.xz",
"LLVM-16.0.6-woa64.exe",
"LLVM-16.0.6-win64.exe",
"LLVM-16.0.6-win32.exe"
],
"llvmorg-16.0.5": [
"clang+llvm-16.0.5-powerpc64le-linux-rhel-8.7.tar.xz",
"clang+llvm-16.0.5-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-16.0.5-arm64-apple-darwin22.0.tar.xz",
"clang+llvm-16.0.5-amd64-unknown-freebsd13.tar.xz",
"clang+llvm-16.0.5-aarch64-linux-gnu.tar.xz",
"LLVM-16.0.5-woa64.exe",
"LLVM-16.0.5-win64.exe",
"LLVM-16.0.5-win32.exe"
],
"llvmorg-16.0.4": [
"clang+llvm-16.0.4-x86_64-linux-gnu-ubuntu-22.04.tar.xz",
"clang+llvm-16.0.4-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-16.0.4-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-16.0.4-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-16.0.4-arm64-apple-darwin22.0.tar.xz",
"clang+llvm-16.0.4-amd64-unknown-freebsd13.tar.xz",
"clang+llvm-16.0.4-aarch64-linux-gnu.tar.xz",
"LLVM-16.0.4-woa64.exe",
"LLVM-16.0.4-win64.exe",
"LLVM-16.0.4-win32.exe"
],
"llvmorg-16.0.3": [
"clang+llvm-16.0.3-x86_64-linux-gnu-ubuntu-22.04.tar.xz",
"clang+llvm-16.0.3-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-16.0.3-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-16.0.3-arm64-apple-darwin22.0.tar.xz",
"clang+llvm-16.0.3-aarch64-linux-gnu.tar.xz",
"LLVM-16.0.3-woa64.exe",
"LLVM-16.0.3-win64.exe",
"LLVM-16.0.3-win32.exe"
],
"llvmorg-16.0.2": [
"clang+llvm-16.0.2-x86_64-linux-gnu-ubuntu-22.04.tar.xz",
"clang+llvm-16.0.2-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-16.0.2-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-16.0.2-arm64-apple-darwin22.0.tar.xz",
"clang+llvm-16.0.2-amd64-unknown-freebsd13.tar.xz",
"clang+llvm-16.0.2-aarch64-linux-gnu.tar.xz",
"LLVM-16.0.2-woa64.exe",
"LLVM-16.0.2-win64.exe",
"LLVM-16.0.2-win32.exe"
],
"llvmorg-16.0.1": [
"clang+llvm-16.0.1-powerpc64le-linux-ubuntu-20.04.tar.xz",
"clang+llvm-16.0.1-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-16.0.1-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-16.0.1-arm64-apple-darwin22.0.tar.xz",
"clang+llvm-16.0.1-amd64-unknown-freebsd13.tar.xz",
"clang+llvm-16.0.1-aarch64-linux-gnu.tar.xz",
"LLVM-16.0.1-woa64.exe",
"LLVM-16.0.1-win64.exe",
"LLVM-16.0.1-win32.exe"
],
"llvmorg-16.0.0": [
"clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
"clang+llvm-16.0.0-sparcv9-sun-solaris2.11.tar.xz",
"clang+llvm-16.0.0-sparc64-unknown-linux-gnu.tar.xz",
"clang+llvm-16.0.0-powerpc64le-linux-ubuntu-18.04.tar.xz",
"clang+llvm-16.0.0-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-16.0.0-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-16.0.0-arm64-apple-darwin22.0.tar.xz",
"clang+llvm-16.0.0-amd64-unknown-freebsd13.tar.xz",
"clang+llvm-16.0.0-amd64-pc-solaris2.11.tar.xz",
"clang+llvm-16.0.0-aarch64-linux-gnu.tar.xz",
"LLVM-16.0.0-woa64.exe",
"LLVM-16.0.0-win64.exe",
"LLVM-16.0.0-win32.exe"
],
"llvmorg-15.0.7": [
"clang+llvm-15.0.7-x86_64-apple-darwin21.0.tar.xz",
"clang+llvm-15.0.7-powerpc64le-linux-ubuntu-18.04.tar.xz",
"clang+llvm-15.0.7-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-15.0.7-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-15.0.7-arm64-apple-darwin22.0.tar.xz",
"LLVM-15.0.7-win64.exe",
"LLVM-15.0.7-win32.exe"
],
"llvmorg-15.0.6": [
"clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
"clang+llvm-15.0.6-powerpc64le-linux-ubuntu-18.04.tar.xz",
"clang+llvm-15.0.6-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-15.0.6-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-15.0.6-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-15.0.6-arm64-apple-darwin21.0.tar.xz",
"clang+llvm-15.0.6-aarch64-linux-gnu.tar.xz",
"LLVM-15.0.6-woa64.exe",
"LLVM-15.0.6-win64.exe",
"LLVM-15.0.6-win32.exe"
],
"llvmorg-15.0.5": [
"clang+llvm-15.0.5-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
"clang+llvm-15.0.5-powerpc64le-linux-ubuntu-18.04.5.tar.xz",
"clang+llvm-15.0.5-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-15.0.5-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-15.0.5-arm64-apple-darwin21.0.tar.xz",
"LLVM-15.0.5-win64.exe",
"LLVM-15.0.5-win32.exe"
],
"llvmorg-15.0.4": [
"clang+llvm-15.0.4-x86_64-linux-gnu-rhel-8.4.tar.xz",
"clang+llvm-15.0.4-x86_64-apple-darwin.tar.xz",
"clang+llvm-15.0.4-powerpc64le-linux-ubuntu-18.04.5.tar.xz",
"clang+llvm-15.0.4-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-15.0.4-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-15.0.4-arm64-apple-darwin21.0.tar.xz",
"LLVM-15.0.4-win64.exe",
"LLVM-15.0.4-win32.exe"
],
"llvmorg-15.0.3": [
"clang+llvm-15.0.3-x86_64-apple-darwin.tar.xz",
"clang+llvm-15.0.3-powerpc64le-linux-ubuntu-18.04.5.tar.xz",
"clang+llvm-15.0.3-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-15.0.3-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-15.0.3-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-15.0.3-arm64-apple-darwin21.0.tar.xz",
"clang+llvm-15.0.3-aarch64-linux-gnu.tar.xz",
"LLVM-15.0.3-woa64.exe",
"LLVM-15.0.3-win64.exe",
"LLVM-15.0.3-win32.exe"
],
"llvmorg-15.0.2": [
"clang+llvm-15.0.2-x86_64-unknown-linux-gnu-sles15.tar.xz",
"clang+llvm-15.0.2-x86_64-unknown-linux-gnu-rhel86.tar.xz",
"clang+llvm-15.0.2-x86_64-apple-darwin.tar.xz",
"clang+llvm-15.0.2-powerpc64le-linux-ubuntu-18.04.5.tar.xz",
"clang+llvm-15.0.2-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-15.0.2-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-15.0.2-arm64-apple-darwin21.0.tar.xz",
"clang+llvm-15.0.2-aarch64-linux-gnu.tar.xz",
"LLVM-15.0.2-woa64.exe",
"LLVM-15.0.2-win64.exe",
"LLVM-15.0.2-win32.exe"
],
"llvmorg-15.0.1": [
"clang+llvm-15.0.1-x86_64-apple-darwin.tar.xz",
"clang+llvm-15.0.1-powerpc64le-linux-ubuntu-18.04.5.tar.xz",
"clang+llvm-15.0.1-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-15.0.1-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-15.0.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-15.0.1-arm64-apple-darwin21.0.tar.xz",
"clang+llvm-15.0.1-aarch64-linux-gnu.tar.xz",
"LLVM-15.0.1-woa64.exe",
"LLVM-15.0.1-win64.exe",
"LLVM-15.0.1-win32.exe"
],
"llvmorg-15.0.0": [
"clang+llvm-15.0.0-x86_64-linux-gnu-rhel-8.4.tar.xz",
"clang+llvm-15.0.0-x86_64-apple-darwin.tar.xz",
"clang+llvm-15.0.0-sparcv9-sun-solaris2.11.tar.xz",
"clang+llvm-15.0.0-sparc64-unknown-linux-gnu.tar.xz",
"clang+llvm-15.0.0-powerpc64le-linux-ubuntu-18.04.6.tar.xz",
"clang+llvm-15.0.0-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-15.0.0-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-15.0.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-15.0.0-arm64-apple-darwin21.0.tar.xz",
"clang+llvm-15.0.0-amd64-pc-solaris2.11.tar.xz",
"clang+llvm-15.0.0-aarch64-linux-gnu.tar.xz",
"LLVM-15.0.0-woa64.exe",
"LLVM-15.0.0-win64.exe",
"LLVM-15.0.0-win32.exe"
],
"llvmorg-14.0.6": [
"clang+llvm-14.0.6-x86_64-linux-gnu-rhel-8.4.tar.xz",
"clang+llvm-14.0.6-x86_64-apple-darwin.tar.xz",
"clang+llvm-14.0.6-powerpc64le-linux-ubuntu-18.04.5.tar.xz",
"clang+llvm-14.0.6-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-14.0.6-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-14.0.6-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-14.0.6-arm64-apple-darwin22.3.0.tar.xz",
"clang+llvm-14.0.6-amd64-unknown-freebsd13.tar.xz",
"clang+llvm-14.0.6-amd64-unknown-freebsd12.tar.xz",
"clang+llvm-14.0.6-aarch64-linux-gnu.tar.xz",
"LLVM-14.0.6-woa64.zip",
"LLVM-14.0.6-win64.exe",
"LLVM-14.0.6-win32.exe"
],
"llvmorg-14.0.5": [
"clang+llvm-14.0.5-x86_64-apple-darwin.tar.xz",
"clang+llvm-14.0.5-powerpc64le-linux-ubuntu-18.04.5.tar.xz",
"clang+llvm-14.0.5-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-14.0.5-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-14.0.5-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-14.0.5-amd64-unknown-freebsd13.tar.xz",
"clang+llvm-14.0.5-amd64-unknown-freebsd12.tar.xz",
"clang+llvm-14.0.5-aarch64-linux-gnu.tar.xz",
"LLVM-14.0.5-woa64.zip",
"LLVM-14.0.5-win64.exe",
"LLVM-14.0.5-win32.exe"
],
"llvmorg-14.0.4": [
"clang+llvm-14.0.4-x86_64-apple-darwin.tar.xz",
"clang+llvm-14.0.4-powerpc64le-linux-ubuntu-18.04.5.tar.xz",
"clang+llvm-14.0.4-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-14.0.4-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-14.0.4-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-14.0.4-amd64-unknown-freebsd13.tar.xz",
"clang+llvm-14.0.4-amd64-unknown-freebsd12.tar.xz",
"clang+llvm-14.0.4-aarch64-linux-gnu.tar.xz",
"LLVM-14.0.4-woa64.zip",
"LLVM-14.0.4-win64.exe",
"LLVM-14.0.4-win32.exe"
],
"llvmorg-14.0.3": [
"clang+llvm-14.0.3-x86_64-apple-darwin.tar.xz",
"clang+llvm-14.0.3-powerpc64le-linux-ubuntu-18.04.tar.xz",
"clang+llvm-14.0.3-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-14.0.3-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-14.0.3-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-14.0.3-amd64-unknown-freebsd13.tar.xz",
"clang+llvm-14.0.3-amd64-unknown-freebsd12.tar.xz",
"clang+llvm-14.0.3-aarch64-linux-gnu.tar.xz",
"LLVM-14.0.3-woa64.zip",
"LLVM-14.0.3-win64.exe",
"LLVM-14.0.3-win32.exe"
],
"llvmorg-14.0.2": [
"clang+llvm-14.0.2-x86_64-apple-darwin.tar.xz",
"clang+llvm-14.0.2-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-14.0.2-amd64-unknown-freebsd13.tar.xz",
"clang+llvm-14.0.2-amd64-unknown-freebsd12.tar.xz",
"clang+llvm-14.0.2-aarch64-linux-gnu.tar.xz",
"LLVM-14.0.2-woa64.zip",
"LLVM-14.0.2-win64.exe",
"LLVM-14.0.2-win32.exe"
],
"llvmorg-14.0.1": [
"clang+llvm-14.0.1-x86_64-apple-darwin.tar.xz",
"clang+llvm-14.0.1-sparcv9-sun-solaris2.11.tar.xz",
"clang+llvm-14.0.1-powerpc64le-linux-ubuntu-18.04.tar.xz",
"clang+llvm-14.0.1-powerpc64le-linux-rhel-8.4.tar.xz",
"clang+llvm-14.0.1-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-14.0.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-14.0.1-amd64-unknown-freebsd13.tar.xz",
"clang+llvm-14.0.1-amd64-unknown-freebsd12.tar.xz",
"clang+llvm-14.0.1-amd64-pc-solaris2.11.tar.xz",
"clang+llvm-14.0.1-aarch64-linux-gnu.tar.xz",
"LLVM-14.0.1-win64.exe",
"LLVM-14.0.1-win32.exe"
],
"llvmorg-14.0.0": [
"clang+llvm-14.0.0-x86_64-linux-sles12.4.tar.xz",
"clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
"clang+llvm-14.0.0-x86_64-apple-darwin.tar.xz",
"clang+llvm-14.0.0-sparcv9-sun-solaris2.11.tar.xz",
"clang+llvm-14.0.0-powerpc64le-linux-ubuntu-18.04.tar.xz",
"clang+llvm-14.0.0-powerpc64le-linux-rhel-7.9.tar.xz",
"clang+llvm-14.0.0-powerpc64-ibm-aix-7.2.tar.xz",
"clang+llvm-14.0.0-i386-unknown-freebsd13.tar.xz",
"clang+llvm-14.0.0-i386-unknown-freebsd12.tar.xz",
"clang+llvm-14.0.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-14.0.0-amd64-unknown-freebsd13.tar.xz",
"clang+llvm-14.0.0-amd64-unknown-freebsd12.tar.xz",
"clang+llvm-14.0.0-amd64-pc-solaris2.11.tar.xz",
"clang+llvm-14.0.0-aarch64-linux-gnu.tar.xz",
"LLVM-14.0.0-woa64.zip",
"LLVM-14.0.0-win64.exe",
"LLVM-14.0.0-win32.exe"
],
"llvmorg-13.0.1": [
"clang+llvm-13.0.1-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
"clang+llvm-13.0.1-x86_64-apple-darwin.tar.xz",
"clang+llvm-13.0.1-powerpc64le-linux-ubuntu-18.04.5.tar.xz",
"clang+llvm-13.0.1-powerpc64le-linux-rhel-7.9.tar.xz",
"clang+llvm-13.0.1-i386-unknown-freebsd13.tar.xz",
"clang+llvm-13.0.1-i386-unknown-freebsd12.tar.xz",
"clang+llvm-13.0.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-13.0.1-amd64-unknown-freebsd13.tar.xz",
"clang+llvm-13.0.1-amd64-unknown-freebsd12.tar.xz",
"clang+llvm-13.0.1-aarch64-linux-gnu.tar.xz",
"LLVM-13.0.1-woa64.zip",
"LLVM-13.0.1-win64.exe",
"LLVM-13.0.1-win32.exe"
],
"llvmorg-13.0.0": [
"clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz",
"clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz",
"clang+llvm-13.0.0-powerpc64le-linux-ubuntu-18.04.tar.xz",
"clang+llvm-13.0.0-powerpc64le-linux-rhel-7.9.tar.xz",
"clang+llvm-13.0.0-i386-unknown-freebsd13.tar.xz",
"clang+llvm-13.0.0-i386-unknown-freebsd12.tar.xz",
"clang+llvm-13.0.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-13.0.0-amd64-unknown-freebsd13.tar.xz",
"clang+llvm-13.0.0-amd64-unknown-freebsd12.tar.xz",
"clang+llvm-13.0.0-aarch64-linux-gnu.tar.xz",
"LLVM-13.0.0-woa64.zip",
"LLVM-13.0.0-win64.exe",
"LLVM-13.0.0-win32.exe"
],
"llvmorg-12.0.1": [
"clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-12.0.1-powerpc64le-linux-ubuntu-18.04.tar.xz",
"clang+llvm-12.0.1-powerpc64le-linux-rhel-7.9.tar.xz",
"clang+llvm-12.0.1-i386-unknown-freebsd12.tar.xz",
"clang+llvm-12.0.1-i386-unknown-freebsd11.tar.xz",
"clang+llvm-12.0.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-12.0.1-amd64-unknown-freebsd12.tar.xz",
"clang+llvm-12.0.1-amd64-unknown-freebsd11.tar.xz",
"clang+llvm-12.0.1-aarch64-linux-gnu.tar.xz",
"LLVM-12.0.1-win64.exe",
"LLVM-12.0.1-win32.exe"
],
"llvmorg-12.0.0": [
"clang+llvm-12.0.0-x86_64-linux-sles12.4.tar.xz",
"clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz",
"clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-12.0.0-x86_64-apple-darwin.tar.xz",
"clang+llvm-12.0.0-powerpc64le-linux-ubuntu-18.04.tar.xz",
"clang+llvm-12.0.0-powerpc64le-linux-rhel-7.9.tar.xz",
"clang+llvm-12.0.0-i386-unknown-freebsd12.tar.xz",
"clang+llvm-12.0.0-i386-unknown-freebsd11.tar.xz",
"clang+llvm-12.0.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-12.0.0-amd64-unknown-freebsd12.tar.xz",
"clang+llvm-12.0.0-amd64-unknown-freebsd11.tar.xz",
"clang+llvm-12.0.0-aarch64-linux-gnu.tar.xz",
"LLVM-12.0.0-woa64.exe",
"LLVM-12.0.0-win64.exe",
"LLVM-12.0.0-win32.exe"
],
"llvmorg-11.1.0": [
"clang+llvm-11.1.0-x86_64-linux-gnu-ubuntu-20.10.tar.xz",
"clang+llvm-11.1.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-11.1.0-powerpc64le-linux-ubuntu-18.04.tar.xz",
"clang+llvm-11.1.0-powerpc64le-linux-rhel-7.4.tar.xz",
"clang+llvm-11.1.0-i386-unknown-freebsd12.tar.xz",
"clang+llvm-11.1.0-i386-unknown-freebsd11.tar.xz",
"clang+llvm-11.1.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-11.1.0-amd64-unknown-freebsd12.tar.xz",
"clang+llvm-11.1.0-amd64-unknown-freebsd11.tar.xz",
"clang+llvm-11.1.0-aarch64-linux-gnu.tar.xz",
"LLVM-11.1.0-win64.exe",
"LLVM-11.1.0-win32.exe"
],
"llvmorg-11.0.1": [
"clang+llvm-11.0.1-x86_64-linux-sles12.4.tar.xz",
"clang+llvm-11.0.1-x86_64-linux-gnu-ubuntu-20.10.tar.xz",
"clang+llvm-11.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-11.0.1-powerpc64le-linux-ubuntu-18.04.tar.xz",
"clang+llvm-11.0.1-powerpc64le-linux-rhel-7.4.tar.xz",
"clang+llvm-11.0.1-i386-unknown-freebsd12.tar.xz",
"clang+llvm-11.0.1-i386-unknown-freebsd11.tar.xz",
"clang+llvm-11.0.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-11.0.1-amd64-unknown-freebsd12.tar.xz",
"clang+llvm-11.0.1-amd64-unknown-freebsd11.tar.xz",
"clang+llvm-11.0.1-aarch64-linux-gnu.tar.xz",
"LLVM-11.0.1-win64.exe",
"LLVM-11.0.1-win32.exe"
],
"llvmorg-11.0.0": [
"clang+llvm-11.0.1-rc2-x86_64-linux-gnu-ubuntu-20.10.tar.xz",
"clang+llvm-11.0.0-x86_64-linux-sles12.4.tar.xz",
"clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz",
"clang+llvm-11.0.0-x86_64-apple-darwin.tar.xz",
"clang+llvm-11.0.0-sparcv9-sun-solaris2.11.tar.xz",
"clang+llvm-11.0.0-powerpc64le-linux-ubuntu-16.04.tar.xz",
"clang+llvm-11.0.0-powerpc64le-linux-rhel-7.4.tar.xz",
"clang+llvm-11.0.0-i386-unknown-freebsd11.tar.xz",
"clang+llvm-11.0.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-11.0.0-amd64-unknown-freebsd11.tar.xz",
"clang+llvm-11.0.0-amd64-pc-solaris2.11.tar.xz",
"clang+llvm-11.0.0-aarch64-linux-gnu.tar.xz",
"LLVM-11.0.0-win64.exe",
"LLVM-11.0.0-win32.exe"
],
"llvmorg-10.0.1": [
"clang+llvm-10.0.1-x86_64-linux-sles12.4.tar.xz",
"clang+llvm-10.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-10.0.1-x86_64-apple-darwin.tar.xz",
"clang+llvm-10.0.1-powerpc64le-linux-ubuntu-16.04.tar.xz",
"clang+llvm-10.0.1-powerpc64le-linux-rhel-7.4.tar.xz",
"clang+llvm-10.0.1-i386-unknown-freebsd11.tar.xz",
"clang+llvm-10.0.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-10.0.1-amd64-unknown-freebsd11.tar.xz",
"clang+llvm-10.0.1-aarch64-linux-gnu.tar.xz"
],
"llvmorg-10.0.0": [
"clang+llvm-10.0.0-x86_64-linux-sles11.3.tar.xz",
"clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
"clang+llvm-10.0.0-x86_64-apple-darwin.tar.xz",
"clang+llvm-10.0.0-sparcv9-sun-solaris2.11.tar.xz",
"clang+llvm-10.0.0-powerpc64le-linux-ubuntu-16.04.tar.xz",
"clang+llvm-10.0.0-powerpc64le-linux-rhel-7.4.tar.xz",
"clang+llvm-10.0.0-i386-unknown-freebsd11.tar.xz",
"clang+llvm-10.0.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-10.0.0-amd64-unknown-freebsd11.tar.xz",
"clang+llvm-10.0.0-amd64-pc-solaris2.11.tar.xz",
"clang+llvm-10.0.0-aarch64-linux-gnu.tar.xz",
"LLVM-10.0.0-win64.exe",
"LLVM-10.0.0-win32.exe"
],
"llvmorg-9.0.1": [
"clang+llvm-9.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-9.0.1-x86_64-apple-darwin.tar.xz",
"clang+llvm-9.0.1-powerpc64le-linux-ubuntu-16.04.tar.xz",
"clang+llvm-9.0.1-powerpc64le-linux-rhel-7.4.tar.xz",
"clang+llvm-9.0.1-i386-unknown-freebsd11.tar.xz",
"clang+llvm-9.0.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-9.0.1-amd64-unknown-freebsd11.tar.xz",
"clang+llvm-9.0.1-aarch64-linux-gnu.tar.xz",
"LLVM-9.0.1-win64.exe",
"LLVM-9.0.1-win32.exe"
],
"llvmorg-8.0.1": [
"clang+llvm-8.0.1-x86_64-linux-sles11.3.tar.xz",
"clang+llvm-8.0.1-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-8.0.1-powerpc64le-linux-ubuntu-16.04.tar.xz",
"clang+llvm-8.0.1-powerpc64le-linux-rhel-7.4.tar.xz",
"clang+llvm-8.0.1-i386-unknown-freebsd11.tar.xz",
"clang+llvm-8.0.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-8.0.1-amd64-unknown-freebsd11.tar.xz",
"clang+llvm-8.0.1-aarch64-linux-gnu.tar.xz",
"LLVM-8.0.1-win64.exe",
"LLVM-8.0.1-win32.exe"
],
"llvmorg-7.1.0": [
"clang+llvm-7.1.0-x86_64-linux-sles11.3.tar.xz",
"clang+llvm-7.1.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-7.1.0-i386-unknown-freebsd11.tar.xz",
"clang+llvm-7.1.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-7.1.0-amd64-unknown-freebsd11.tar.xz",
"clang+llvm-7.1.0-aarch64-linux-gnu.tar.xz",
"LLVM-7.1.0-win64.exe",
"LLVM-7.1.0-win32.exe"
]
}

View File

@ -10,9 +10,13 @@ import { addUpdateAlternativesToRc, installAptPack } from "setup-apt"
import { rcOptions } from "../cli-options.js" import { rcOptions } from "../cli-options.js"
import { setupGcc } from "../gcc/gcc.js" import { setupGcc } from "../gcc/gcc.js"
import { setupMacOSSDK } from "../macos-sdk/macos-sdk.js" import { setupMacOSSDK } from "../macos-sdk/macos-sdk.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { isUbuntu } from "../utils/env/isUbuntu.js" import { isUbuntu } from "../utils/env/isUbuntu.js"
import { ubuntuVersion } from "../utils/env/ubuntu_version.js" import { ubuntuVersion } from "../utils/env/ubuntu_version.js"
import { type InstallationInfo, setupBin } from "../utils/setup/setupBin.js" import { type InstallationInfo, setupBin } from "../utils/setup/setupBin.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
import { semverCoerceIfInvalid } from "../utils/setup/version.js" import { semverCoerceIfInvalid } from "../utils/setup/version.js"
import { getVersion } from "../versions/versions.js" import { getVersion } from "../versions/versions.js"
import { LLVMPackages, setupLLVMApt } from "./llvm_installer.js" import { LLVMPackages, setupLLVMApt } from "./llvm_installer.js"
@ -82,6 +86,14 @@ async function llvmBinaryDeps_raw(majorVersion: number) {
} else { } else {
await installAptPack([{ name: "libtinfo-dev" }]) await installAptPack([{ name: "libtinfo-dev" }])
} }
} else if (isArch()) {
// https://aur.archlinux.org/packages/ncurses5-compat-libs
await setupPacmanPack("ncurses5-compat-libs", undefined, "yay")
} else if (hasDnf()) {
// https://packages.fedoraproject.org/pkgs/ncurses/ncurses-compat-libs/index.html
await setupDnfPack([
{ name: "ncurses-compat-libs" },
])
} }
} }
const llvmBinaryDeps = memoize(llvmBinaryDeps_raw, { promise: true }) const llvmBinaryDeps = memoize(llvmBinaryDeps_raw, { promise: true })

View File

@ -0,0 +1,335 @@
{
"9.0.0": [
"clang+llvm-9.0.0-x86_64-pc-linux-gnu.tar.xz",
"clang+llvm-9.0.0-x86_64-linux-sles11.3.tar.xz",
"clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
"clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-9.0.0-x86_64-darwin-apple.tar.xz",
"clang+llvm-9.0.0-sparcv9-sun-solaris2.11.tar.xz",
"clang+llvm-9.0.0-powerpc64le-linux-ubuntu-16.04.tar.xz",
"clang+llvm-9.0.0-powerpc64le-linux-rhel-7.4.tar.xz",
"clang+llvm-9.0.0-i386-unknown-freebsd11.tar.xz",
"clang+llvm-9.0.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-9.0.0-amd64-unknown-freebsd11.tar.xz",
"clang+llvm-9.0.0-amd64-pc-solaris2.11.tar.xz",
"clang+llvm-9.0.0-aarch64-linux-gnu.tar.xz",
"LLVM-9.0.0-win64.exe",
"LLVM-9.0.0-win32.exe"
],
"8.0.0": [
"clang+llvm-8.0.0-x86_64-linux-sles11.3.tar.xz",
"clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
"clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz",
"clang+llvm-8.0.0-powerpc64le-unknown-unknown.tar.xz",
"clang+llvm-8.0.0-i386-unknown-freebsd11.tar.xz",
"clang+llvm-8.0.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-8.0.0-amd64-unknown-freebsd11.tar.xz",
"clang+llvm-8.0.0-aarch64-linux-gnu.tar.xz",
"LLVM-8.0.0-win64.exe",
"LLVM-8.0.0-win32.exe"
],
"7.0.1": [
"clang+llvm-7.0.1-x86_64-linux-sles11.3.tar.xz",
"clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
"clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-7.0.1-powerpc64le-unknown-unknown.tar.xz",
"clang+llvm-7.0.1-i386-unknown-freebsd11.tar.xz",
"clang+llvm-7.0.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-7.0.1-amd64-unknown-freebsd11.tar.xz",
"clang+llvm-7.0.1-aarch64-linux-gnu.tar.xz",
"LLVM-7.0.1-win64.exe",
"LLVM-7.0.1-win32.exe"
],
"7.0.0": [
"clang+llvm-7.0.0-x86_64-linux-sles12.3.tar.xz",
"clang+llvm-7.0.0-x86_64-linux-sles11.3.tar.xz",
"clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-7.0.0-x86_64-apple-darwin.tar.xz",
"clang+llvm-7.0.0-powerpc64le-unknown-unknown.tar.xz",
"clang+llvm-7.0.0-i386-unknown-freebsd11.tar.xz",
"clang+llvm-7.0.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-7.0.0-amd64-unknown-freebsd11.tar.xz",
"clang+llvm-7.0.0-aarch64-linux-gnu.tar.xz",
"LLVM-7.0.0-win64.exe",
"LLVM-7.0.0-win32.exe"
],
"6.0.1": [
"clang+llvm-6.0.1-x86_64-linux-sles12.3.tar.xz",
"clang+llvm-6.0.1-x86_64-linux-sles11.3.tar.xz",
"clang+llvm-6.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-6.0.1-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-6.0.1-i386-unknown-freebsd10.tar.xz",
"clang+llvm-6.0.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-6.0.1-amd64-unknown-freebsd10.tar.xz",
"clang+llvm-6.0.1-aarch64-linux-gnu.tar.xz",
"LLVM-6.0.1-win64.exe",
"LLVM-6.0.1-win32.exe"
],
"6.0.0": [
"clang+llvm-6.0.0-x86_64-linux-sles12.2.tar.xz",
"clang+llvm-6.0.0-x86_64-linux-sles11.3.tar.xz",
"clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-6.0.0-x86_64-linux-gnu-debian8.tar.xz",
"clang+llvm-6.0.0-x86_64-linux-gnu-Fedora27.tar.xz",
"clang+llvm-6.0.0-x86_64-apple-darwin.tar.xz",
"clang+llvm-6.0.0-mipsel-linux-gnu.tar.xz",
"clang+llvm-6.0.0-mips-linux-gnu.tar.xz",
"clang+llvm-6.0.0-i686-linux-gnu-Fedora27.tar.xz",
"clang+llvm-6.0.0-i386-unknown-freebsd-10.tar.xz",
"clang+llvm-6.0.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-6.0.0-amd64-unknown-freebsd-10.tar.xz",
"clang+llvm-6.0.0-aarch64-linux-gnu.tar.xz",
"LLVM-6.0.0-win64.exe",
"LLVM-6.0.0-win32.exe"
],
"5.0.2": [
"clang+llvm-5.0.2-x86_64-linux-sles11.3.tar.xz",
"clang+llvm-5.0.2-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-5.0.2-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-5.0.2-x86_64-apple-darwin.tar.xz",
"LLVM-5.0.2-win64.exe",
"LLVM-5.0.2-win32.exe"
],
"5.0.1": [
"clang+llvm-5.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-5.0.1-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-5.0.1-x86_64-linux-gnu-debian8.tar.xz",
"clang+llvm-5.0.1-x86_64-linux-gnu-Fedora27.tar.xz",
"clang+llvm-5.0.1-x86_64-apple-darwin.tar.xz",
"clang+llvm-5.0.1-ppc64le-linux-gnu-Fedora-27.tar.xz",
"clang+llvm-5.0.1-ppc64-linux-gnu-Fedora-27.tar.xz",
"clang+llvm-5.0.1-mipsel-linux-gnu.tar.xz",
"clang+llvm-5.0.1-mips-linux-gnu.tar.xz",
"clang+llvm-5.0.1-linux-x86_64-sles12.2.tar.xz",
"clang+llvm-5.0.1-linux-x86_64-sles11.3.tar.xz",
"clang+llvm-5.0.1-i686-linux-gnu-Fedora-27.tar.xz",
"clang+llvm-5.0.1-i386-unknown-freebsd10.tar.xz",
"clang+llvm-5.0.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-5.0.1-amd64-unknown-freebsd10.tar.xz",
"clang+llvm-5.0.1-aarch64-linux-gnu.tar.xz",
"LLVM-5.0.1-win64.exe",
"LLVM-5.0.1-win32.exe"
],
"5.0.0": [
"clang+llvm-5.0.0-x86_64-linux-gnu-debian8.tar.xz",
"clang+llvm-5.0.0-x86_64-apple-darwin.tar.xz",
"clang+llvm-5.0.0-mipsel-linux-gnu.tar.xz",
"clang+llvm-5.0.0-mips-linux-gnu.tar.xz",
"clang+llvm-5.0.0-linux-x86_64-ubuntu16.04.tar.xz",
"clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz",
"clang+llvm-5.0.0-linux-x86_64-sles11.3.tar.xz",
"clang+llvm-5.0.0-i386-unknown-freebsd10.tar.xz",
"clang+llvm-5.0.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-5.0.0-amd64-unknown-freebsd10.tar.xz",
"clang+llvm-5.0.0-aarch64-linux-gnu.tar.xz",
"LLVM-5.0.0-win64.exe",
"LLVM-5.0.0-win32.exe"
],
"4.0.1": [
"clang+llvm-4.0.1-x86_64-linux-gnu-debian8.tar.xz",
"clang+llvm-4.0.1-x86_64-linux-gnu-Fedora-25.tar.xz",
"clang+llvm-4.0.1-x86_64-apple-darwin.tar.xz",
"clang+llvm-4.0.1-ppc64le-linux-gnu-Fedora-25.tar.xz",
"clang+llvm-4.0.1-ppc64-linux-gnu-Fedora-25.tar.xz",
"clang+llvm-4.0.1-mipsel-linux-gnu.tar.xz",
"clang+llvm-4.0.1-mips-linux-gnu.tar.xz",
"clang+llvm-4.0.1-linux-x86_64-sles11.3.tar.xz",
"clang+llvm-4.0.1-i386-unknown-freebsd10.tar.xz",
"clang+llvm-4.0.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-4.0.1-amd64-unknown-freebsd10.tar.xz",
"clang+llvm-4.0.1-aarch64-linux-gnu.tar.xz",
"LLVM-4.0.1-win64.exe",
"LLVM-4.0.1-win32.exe"
],
"4.0.0": [
"clang+llvm-4.0.0-x86_64-linux-gnu-ubuntu-16.10.tar.xz",
"clang+llvm-4.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-4.0.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-4.0.0-x86_64-linux-gnu-debian8.tar.xz",
"clang+llvm-4.0.0-x86_64-apple-darwin.tar.xz",
"clang+llvm-4.0.0-mipsel-linux-gnu.tar.xz",
"clang+llvm-4.0.0-mips-linux-gnu.tar.xz",
"clang+llvm-4.0.0-i386-unknown-freebsd10.tar.xz",
"clang+llvm-4.0.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-4.0.0-amd64-unknown-freebsd10.tar.xz",
"clang+llvm-4.0.0-aarch64-linux-gnu.tar.xz",
"LLVM-4.0.0-win64.exe",
"LLVM-4.0.0-win32.exe"
],
"3.9.1": [
"clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-3.9.1-x86_64-linux-gnu-debian8.tar.xz",
"clang+llvm-3.9.1-mipsel-linux-gnu.tar.xz",
"clang+llvm-3.9.1-mips-linux-gnu.tar.xz",
"clang+llvm-3.9.1-i386-unknown-freebsd10.tar.xz",
"clang+llvm-3.9.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-3.9.1-amd64-unknown-freebsd10.tar.xz",
"clang+llvm-3.9.1-aarch64-linux-gnu.tar.xz",
"LLVM-3.9.1-win64.exe",
"LLVM-3.9.1-win32.exe"
],
"3.9.0": [
"clang+llvm-3.9.0-x86_64-opensuse13.2.tar.xz",
"clang+llvm-3.9.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-3.9.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-3.9.0-x86_64-linux-gnu-debian8.tar.xz",
"clang+llvm-3.9.0-x86_64-fedora23.tar.xz",
"clang+llvm-3.9.0-x86_64-apple-darwin.tar.xz",
"clang+llvm-3.9.0-mipsel-linux-gnu.tar.xz",
"clang+llvm-3.9.0-mips-linux-gnu.tar.xz",
"clang+llvm-3.9.0-i686-fedora23.tar.xz",
"clang+llvm-3.9.0-i586-opensuse13.2.tar.xz",
"clang+llvm-3.9.0-i386-unknown-freebsd10.tar.xz",
"clang+llvm-3.9.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-3.9.0-amd64-unknown-freebsd10.tar.xz",
"clang+llvm-3.9.0-aarch64-linux-gnu.tar.xz",
"LLVM-3.9.0-win64.exe",
"LLVM-3.9.0-win32.exe"
],
"3.8.1": [
"clang+llvm-3.8.1-x86_64-opensuse13.2.tar.xz",
"clang+llvm-3.8.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-3.8.1-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-3.8.1-x86_64-linux-gnu-debian8.tar.xz",
"clang+llvm-3.8.1-x86_64-fedora22.tar.xz",
"clang+llvm-3.8.1-mipsel-linux-gnu.tar.xz",
"clang+llvm-3.8.1-mips-linux-gnu.tar.xz",
"clang+llvm-3.8.1-linux-x86_64-sles11.3.tar.xz",
"clang+llvm-3.8.1-linux-armhf-vivid.tar.xz",
"clang+llvm-3.8.1-i686-fedora23.tar.xz",
"clang+llvm-3.8.1-i586-opensuse13.2.tar.xz",
"clang+llvm-3.8.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-3.8.1-aarch64-linux-gnu.tar.xz",
"LLVM-3.8.1-win64.exe",
"LLVM-3.8.1-win32.exe"
],
"3.8.0": [
"clang+llvm-3.8.0-x86_64-sles11.3-linux-gnu.tar.xz",
"clang+llvm-3.8.0-x86_64-opensuse13.2.tar.xz",
"clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
"clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-15.10.tar.xz",
"clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-3.8.0-x86_64-linux-gnu-debian8.tar.xz",
"clang+llvm-3.8.0-x86_64-fedora23.tar.xz",
"clang+llvm-3.8.0-x86_64-apple-darwin.tar.xz",
"clang+llvm-3.8.0-mipsel-linux-gnu.tar.xz",
"clang+llvm-3.8.0-mips-linux-gnu.tar.xz",
"clang+llvm-3.8.0-linux-x86_64-centos6.tar.xz",
"clang+llvm-3.8.0-linux-armhf-vivid.tar.xz",
"clang+llvm-3.8.0-i686-fedora23.tar.xz",
"clang+llvm-3.8.0-i586-opensuse13.2.tar.xz",
"clang+llvm-3.8.0-i386-unknown-freebsd10.tar.xz",
"clang+llvm-3.8.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-3.8.0-amd64-unknown-freebsd10.tar.xz",
"clang+llvm-3.8.0-aarch64-linux-gnu.tar.xz",
"LLVM-3.8.0-win64.exe",
"LLVM-3.8.0-win32.exe"
],
"3.7.1": [
"clang+llvm-3.7.1-x86_64-opensuse13.2.tar.xz",
"clang+llvm-3.7.1-x86_64-linux-gnu-ubuntu-15.10.tar.xz",
"clang+llvm-3.7.1-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-3.7.1-x86_64-linux-gnu-debian8.tar.xz",
"clang+llvm-3.7.1-x86_64-fedora22.tar.xz",
"clang+llvm-3.7.1-mipsel-linux-gnu.tar.xz",
"clang+llvm-3.7.1-mips-linux-gnu.tar.xz",
"clang+llvm-3.7.1-i686-fedora22.tar.xz",
"clang+llvm-3.7.1-i586-opensuse13.2.tar.xz",
"clang+llvm-3.7.1-i386-unknown-freebsd10.tar.xz",
"clang+llvm-3.7.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-3.7.1-amd64-unknown-freebsd10.tar.xz",
"clang+llvm-3.7.1-aarch64-linux-gnu.tar.xz",
"LLVM-3.7.1-win64.exe",
"LLVM-3.7.1-win32.exe"
],
"3.7.0": [
"clang+llvm-3.7.0-x86_64-opensuse13.2.tar.xz",
"clang+llvm-3.7.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-3.7.0-x86_64-fedora22.tar.xz",
"clang+llvm-3.7.0-x86_64-apple-darwin.tar.xz",
"clang+llvm-3.7.0-mipsel-linux-gnu.tar.xz",
"clang+llvm-3.7.0-mips-linux-gnu.tar.xz",
"clang+llvm-3.7.0-i686-fedora22.tar.xz",
"clang+llvm-3.7.0-i586-opensuse13.2.tar.xz",
"clang+llvm-3.7.0-i386-unknown-freebsd10.tar.xz",
"clang+llvm-3.7.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-3.7.0-amd64-unknown-freebsd10.tar.xz",
"clang+llvm-3.7.0-aarch64-linux-gnu.tar.xz",
"LLVM-3.7.0-win64.exe",
"LLVM-3.7.0-win32.exe"
],
"3.6.2": [
"clang+llvm-3.6.2-x86_64-opensuse13.2.tar.xz",
"clang+llvm-3.6.2-x86_64-linux-gnu-ubuntu-15.04.tar.xz",
"clang+llvm-3.6.2-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-3.6.2-x86_64-fedora21.tar.xz",
"clang+llvm-3.6.2-x86_64-apple-darwin.tar.xz",
"clang+llvm-3.6.2-mipsel-linux-gnu.tar.xz",
"clang+llvm-3.6.2-mips-linux-gnu.tar.xz",
"clang+llvm-3.6.2-i586-opensuse13.2.tar.xz",
"clang+llvm-3.6.2-i386-unknown-freebsd10.tar.xz",
"clang+llvm-3.6.2-i386-fedora21.tar.xz",
"clang+llvm-3.6.2-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-3.6.2-amd64-unknown-freebsd10.tar.xz",
"clang+llvm-3.6.2-aarch64-linux-gnu.tar.xz",
"LLVM-3.6.2-win32.exe"
],
"3.6.1": [
"clang+llvm-3.6.1-x86_64-opensuse13.2.tar.xz",
"clang+llvm-3.6.1-x86_64-linux-gnu-ubuntu-15.04.tar.xz",
"clang+llvm-3.6.1-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-3.6.1-x86_64-fedora21.tar.xz",
"clang+llvm-3.6.1-x86_64-apple-darwin.tar.xz",
"clang+llvm-3.6.1-mipsel-linux-gnu.tar.xz",
"clang+llvm-3.6.1-mips-linux-gnu.tar.xz",
"clang+llvm-3.6.1-i586-opensuse13.2.tar.xz",
"clang+llvm-3.6.1-i386-unknown-freebsd10.tar.xz",
"clang+llvm-3.6.1-i386-fedora21.tar.xz",
"clang+llvm-3.6.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-3.6.1-amd64-unknown-freebsd10.tar.xz",
"clang+llvm-3.6.1-aarch64-linux-gnu.tar.xz",
"LLVM-3.6.1-win32.exe"
],
"3.6.0": [
"clang+llvm-3.6.0-x86_64-opensuse13.2.tar.xz",
"clang+llvm-3.6.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-3.6.0-x86_64-fedora21.tar.xz",
"clang+llvm-3.6.0-x86_64-apple-darwin.tar.xz",
"clang+llvm-3.6.0-mipsel-linux-gnu.tar.xz",
"clang+llvm-3.6.0-mips-linux-gnu.tar.xz",
"clang+llvm-3.6.0-i686-fedora21.tar.xz",
"clang+llvm-3.6.0-i586-opensuse13.2.tar.xz",
"clang+llvm-3.6.0-i386-unknown-freebsd10.tar.xz",
"clang+llvm-3.6.0-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-3.6.0-amd64-unknown-freebsd10.tar.xz",
"clang+llvm-3.6.0-aarch64-linux-gnu.tar.xz",
"LLVM-3.6.0-win32.exe"
],
"3.5.2": [
"clang+llvm-3.5.2-x86_64-linux-gnu-ubuntu-14.04.tar.xz",
"clang+llvm-3.5.2-x86_64-apple-darwin.tar.xz",
"clang+llvm-3.5.2-mipsel-linux-gnu.tar.xz",
"clang+llvm-3.5.2-mips-linux-gnu.tar.xz",
"clang+llvm-3.5.2-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-3.5.2-aarch64-linux-gnu.tar.xz",
"LLVM-3.5.2-win32.exe"
],
"3.5.1": [
"clang+llvm-3.5.1-x86_64-opensuse13.1.tar.xz",
"clang+llvm-3.5.1-x86_64-linux-gnu.tar.xz",
"clang+llvm-3.5.1-x86_64-fedora20.tar.xz",
"clang+llvm-3.5.1-mipsel-linux-gnu.tar.xz",
"clang+llvm-3.5.1-mips-linux-gnu.tar.xz",
"clang+llvm-3.5.1-i686-fedora20.tar.xz",
"clang+llvm-3.5.1-i586-opensuse13.1.tar.xz",
"clang+llvm-3.5.1-armv7a-linux-gnueabihf.tar.xz",
"clang+llvm-3.5.1-aarch64-linux-gnu.tar.xz"
]
}

View File

@ -1,329 +1,25 @@
import { info, warning } from "ci-log" import path, { join } from "path"
import { isUrlOnline } from "is-url-online" import { fileURLToPath } from "url"
import { info } from "ci-log"
import { addExeExt } from "patha" import { addExeExt } from "patha"
import semverLte from "semver/functions/lte" import { loadAssetList, matchAsset } from "../utils/asset/load-assets.js"
import { arm64, armv7, powerpc64le, sparc64, x86, x86_64 } from "../utils/env/arch.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isUbuntu } from "../utils/env/isUbuntu.js"
import { ubuntuVersion } from "../utils/env/ubuntu_version.js"
import { extractExe, extractTarByExe } from "../utils/setup/extract.js" import { extractExe, extractTarByExe } from "../utils/setup/extract.js"
import type { PackageInfo } from "../utils/setup/setupBin.js" import type { PackageInfo } from "../utils/setup/setupBin.js"
import { getSpecificVersionAndUrl, getSpecificVersions, getVersions } from "../utils/setup/version.js"
// ================================================ const dirname = typeof __dirname === "string" ? __dirname : path.dirname(fileURLToPath(import.meta.url))
// Version
// ================================================
/** The specific and minimum LLVM versions supported by this action. */
export const VERSIONS: Set<string> = getVersions([
"3.5.0",
"3.5.1",
"3.5.2",
"3.6.0",
"3.6.1",
"3.6.2",
"3.7.0",
"3.7.1",
"3.8.0",
"3.8.1",
"3.9.0",
"3.9.1",
"4.0.0",
"4.0.1",
"5.0.0",
"5.0.1",
"5.0.2",
"6.0.0",
"6.0.1",
"7.0.0",
"7.0.1",
"7.1.0",
"8.0.0",
"8.0.1",
"9.0.0",
"9.0.1",
"10.0.0",
"10.0.1",
"11.0.0",
"11.0.1",
"11.1.0",
"12.0.0",
"12.0.1",
"13.0.0",
"13.0.1",
"14.0.0",
"14.0.1",
"14.0.2",
"14.0.3",
"14.0.4",
"14.0.5",
"14.0.6",
"15.0.0",
"15.0.1",
"15.0.2",
"15.0.3",
"15.0.4",
"15.0.5",
"15.0.6",
"15.0.7",
"16.0.0",
"16.0.1",
"16.0.2",
"16.0.3",
"16.0.4",
"16.0.5",
"16.0.6",
"17.0.1",
"17.0.2",
"17.0.3",
"17.0.4",
"17.0.5",
"17.0.6",
"18.1.0",
"18.1.1",
"18.1.2",
"18.1.3",
"18.1.4",
"18.1.5",
"18.1.6",
"18.1.7",
"18.1.8",
])
/** The LLVM versions that were never released for the Windows platform. */
const WIN32_MISSING: Set<string> = new Set(["10.0.1", "15.0.5", "15.0.6", "17.0.5"])
/** The LLVM versions that were never released for the Darwin platform. */
const DARWIN_X64_MISSING = new Set([
"3.5.1",
"3.6.1",
"3.6.2",
"3.7.1",
"3.8.1",
"3.9.1",
"6.0.1",
"7.0.1",
"7.1.0",
"8.0.1",
"11.0.1",
"11.1.0",
"12.0.1",
"15.0.4",
"15.0.5",
"15.0.6",
"16.0.0",
"16.0.1",
"16.0.2",
"16.0.3",
"16.0.4",
"16.0.5",
"16.0.6",
"17.0.1",
"17.0.2",
"17.0.3",
"17.0.4",
"17.0.5",
"17.0.6",
"18.1.0",
"18.1.1",
"18.1.2",
"18.1.3",
"18.1.4",
"18.1.5",
"18.1.6",
"18.1.7",
"18.1.8",
])
/**
* The LLVM versions that should use the last RC version instead of the release version for the Linux (Ubuntu) platform.
* This is useful when there were binaries released for the Linux (Ubuntu) platform for the last RC version but not for
* the actual release version.
*/
const UBUNTU_RC: Map<string, string> = new Map()
/**
* The (latest) Ubuntu versions for each LLVM version.
*
* https://github.com/llvm/llvm-project/releases/tag/llvmorg-14.0.1 or https://releases.llvm.org/14.0.1
*/
// TODO change based on ubuntu version
const UBUNTU_X64_SUFFIX_MAP: { [key: string]: string } = {
"3.5.0": "-ubuntu-14.04",
"3.5.1": "",
"3.5.2": "-ubuntu-14.04",
"3.6.0": "-ubuntu-14.04",
"3.6.1": "-ubuntu-14.04",
"3.6.2": "-ubuntu-14.04",
"3.7.0": "-ubuntu-14.04",
"3.7.1": "-ubuntu-14.04",
"3.8.0": "-ubuntu-16.04",
"3.8.1": "-ubuntu-16.04",
"3.9.0": "-ubuntu-16.04",
"3.9.1": "-ubuntu-16.04",
"4.0.0": "-ubuntu-16.04",
"5.0.0": "-ubuntu16.04",
"5.0.1": "-ubuntu-16.04",
"5.0.2": "-ubuntu-16.04",
"6.0.0": "-ubuntu-16.04",
"6.0.1": "-ubuntu-16.04",
"7.0.0": "-ubuntu-16.04",
"7.0.1": "-ubuntu-18.04",
"7.1.0": "-ubuntu-14.04",
"8.0.0": "-ubuntu-18.04",
"9.0.0": "-ubuntu-18.04",
"9.0.1": "-ubuntu-16.04",
"10.0.0": "-ubuntu-18.04",
"10.0.1": "-ubuntu-16.04",
"11.0.0": "-ubuntu-20.04",
"11.0.1": "-ubuntu-16.04",
"11.1.0": "-ubuntu-16.04",
"12.0.0": "-ubuntu-20.04",
"12.0.1": "-ubuntu-16.04",
"13.0.0": "-ubuntu-20.04",
"13.0.0-ubuntu-16.04": "-ubuntu-16.04",
"13.0.0-ubuntu-20.04": "-ubuntu-20.04",
"13.0.1": "-ubuntu-18.04",
"13.0.1-ubuntu-18.04": "-ubuntu-18.04",
"14.0.0": "-ubuntu-18.04",
"15.0.2": "-rhel86",
"15.0.5": "-ubuntu-18.04",
"15.0.6": "-ubuntu-18.04",
"16.0.0": "-ubuntu-18.04",
"16.0.2": "-ubuntu-22.04",
"16.0.3": "-ubuntu-22.04",
"16.0.4": "-ubuntu-22.04",
"17.0.2": "-ubuntu-22.04",
"17.0.4": "-ubuntu-22.04",
"17.0.5": "-ubuntu-22.04",
"17.0.6": "-ubuntu-22.04",
"18.1.4": "-ubuntu-18.04",
"18.1.7": "-ubuntu-18.04",
"18.1.8": "-ubuntu-18.04",
}
/** The latest supported LLVM version for the Linux (Ubuntu) platform. */
const MAX_UBUNTU: string = "18.1.8"
// ================================================
// URL
// ================================================
/** Gets a LLVM download URL for GitHub. */
function getGitHubUrl(version: string, prefix: string, suffix: string): string {
const file = `${prefix}${version}${suffix}`
return `https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/${file}`
}
/** Gets a LLVM download URL for https://releases.llvm.org. */
function getReleaseUrl(version: string, prefix: string, suffix: string): string {
const file = `${prefix}${version}${suffix}`
return `https://releases.llvm.org/${version}/${file}`
}
/** Gets an LLVM download URL for the Darwin platform. */
function getDarwinUrl(version: string): string | null {
if (DARWIN_X64_MISSING.has(version)) {
return null
}
const darwin = version === "9.0.0" ? "-darwin-apple" : "-apple-darwin"
const prefix = "clang+llvm-"
const suffix = `-x86_64${darwin}.tar.xz`
if (semverLte(version, "9.0.1")) {
return getReleaseUrl(version, prefix, suffix)
} else {
return getGitHubUrl(version, prefix, suffix)
}
}
/** Gets an LLVM download URL for the Linux (Ubuntu) platform. */
export function getLinuxUrl(versionGiven: string): string {
let version = versionGiven
const rc = UBUNTU_RC.get(version)
if (rc !== undefined) {
version = rc
}
let linuxVersion: string
// ubuntu-version is specified
if (version.includes("ubuntu")) {
const givenUbuntuVersion = version.replace(/-ubuntu-.*/, "")
if (!VERSIONS.has(givenUbuntuVersion)) {
throw new Error(`Unsupported Ubuntu version: ${givenUbuntuVersion}`)
}
linuxVersion = version.replace(givenUbuntuVersion, "")
version = getSpecificVersions(VERSIONS, givenUbuntuVersion)[0]
} else if (version !== "" && version in UBUNTU_X64_SUFFIX_MAP) {
linuxVersion = UBUNTU_X64_SUFFIX_MAP[version]
} else {
// default to the maximum version
linuxVersion = UBUNTU_X64_SUFFIX_MAP[MAX_UBUNTU]
warning(`Falling back to LLVM version ${MAX_UBUNTU} ${linuxVersion} for the Ubuntu.`)
}
const prefix = "clang+llvm-"
let suffix: string
if (version === "5.0.0") {
suffix = `-linux-x86_64${linuxVersion}.tar.xz`
} else if (linuxVersion.includes("-rhel86")) {
suffix = `-x86_64-unknown-linux-gnu${linuxVersion}.tar.xz`
} else {
suffix = `-x86_64-linux-gnu${linuxVersion}.tar.xz`
}
if (semverLte(version, "9.0.1")) {
return getReleaseUrl(version, prefix, suffix)
} else {
return getGitHubUrl(version, prefix, suffix)
}
}
/** Gets an LLVM download URL for the Windows platform. */
async function getWin32Url(version: string): Promise<string | null> {
if (WIN32_MISSING.has(version)) {
return null
}
const prefix = "LLVM-"
const suffix = semverLte(version, "3.7.0") ? "-win32.exe" : "-win64.exe"
const olderThan9_1 = semverLte(version, "9.0.1")
let url: string
let fallback = false
if (olderThan9_1) {
url = getReleaseUrl(version, prefix, suffix)
if (!(await isUrlOnline(url))) {
fallback = true // fallback to github
}
}
if (fallback || !olderThan9_1) {
url = getGitHubUrl(version, prefix, suffix)
}
return url!
}
/** Gets an LLVM download URL. */
export function getUrl(platform: string, version: string): string | null | Promise<string | null> {
switch (platform) {
case "darwin":
return getDarwinUrl(version)
case "linux":
return getLinuxUrl(version)
case "win32":
return getWin32Url(version)
default:
return null
}
}
export async function getLLVMPackageInfo( export async function getLLVMPackageInfo(
version: string, version: string,
platform: NodeJS.Platform, platform: NodeJS.Platform,
// eslint-disable-next-line @typescript-eslint/no-unused-vars arch: string,
_arch: string,
): Promise<PackageInfo> { ): Promise<PackageInfo> {
const [specificVersion, url] = await getSpecificVersionAndUrl(VERSIONS, platform, version, getUrl) const url = await getLLVMAssetURL(platform, arch, version)
info(`specific llvm version: ${specificVersion}`) info(`Downloading LLVM from ${url}`)
return { return {
url, url,
extractedFolderName: "", extractedFolderName: "",
@ -336,3 +32,139 @@ export async function getLLVMPackageInfo(
}, },
} }
} }
export async function getLLVMAssetURL(platform: string, arch: string, version: string) {
const { keywords, optionalKeywords } = await getAssetKeywords(platform, arch)
// first check the github releases
const llvmGitHubAssets = await loadAssetList(
join(dirname, "github_llvm_llvm-project.json"),
)
const ghAsset = matchAsset(
llvmGitHubAssets,
{
version,
keywords,
optionalKeywords,
filterMapTag(tag) {
return tag.replace(/^llvmorg-/, "")
},
},
)
if (ghAsset !== undefined) {
return `https://github.com/llvm/llvm-project/releases/download/${ghAsset.tag}/${ghAsset.name}`
}
// check the llvm website
const llvmWebsiteAssets = await loadAssetList(
join(dirname, "llvm_org_releases.json"),
)
const websiteAsset = matchAsset(
llvmWebsiteAssets,
{
version,
keywords,
optionalKeywords,
},
)
if (websiteAsset !== undefined) {
return `https://llvm.org/releases/${websiteAsset.tag}/${websiteAsset.name}`
}
throw new Error(`No asset found for version ${version} matching ${keywords} and ${optionalKeywords}`)
}
async function getAssetKeywords(platform: string, arch: string) {
const keywords: string[] = []
const optionalKeywords: string[] = []
switch (platform) {
case "win32": {
if (x86_64.includes(arch)) {
keywords.push("win64")
// TODO fallback to win32 if win64 is not available (e.g. for LLVM 3.6.2 and older)
} else if (x86.includes(arch)) {
keywords.push("win32")
} else if (arm64.includes(arch)) {
keywords.push("woa64")
} else {
info(`Using arch ${arch} for LLVM`)
keywords.push(arch)
}
break
}
case "linux": {
keywords.push("linux")
if (isUbuntu()) {
optionalKeywords.push("ubuntu")
const ubuntuVer = await ubuntuVersion()
if (ubuntuVer !== null) {
optionalKeywords.push(`${ubuntuVer[0]}`)
const ubuntuMin = ubuntuVer[1] < 10 ? `0${ubuntuVer[1]}` : `${ubuntuVer[1]}`
optionalKeywords.push(`${ubuntuVer[0]}.${ubuntuMin}`)
optionalKeywords.push(`${ubuntuVer[0]}.${ubuntuMin}.${ubuntuVer[2]}`)
}
} else if (hasDnf()) {
optionalKeywords.push("rhel")
}
if (x86_64.includes(arch)) {
keywords.push("x86_64")
} else if (x86.includes(arch)) {
keywords.push("x86")
} else if (arm64.includes(arch)) {
keywords.push("aarch64")
} else if (armv7.includes(arch)) {
keywords.push("armv7a")
} else if (powerpc64le.includes(arch)) {
keywords.push("powerpc64le")
} else if (sparc64.includes(arch)) {
keywords.push("sparc64")
} else {
info(`Using arch ${arch} for LLVM`)
keywords.push(arch)
}
break
}
case "darwin": {
keywords.push("apple")
if (x86_64.includes(arch)) {
keywords.push("x86_64")
} else if (arm64.includes(arch)) {
// allow falling back to x86_64 if arm64 is not available
optionalKeywords.push("arm64")
} else {
info(`Using arch ${arch} for LLVM`)
keywords.push(arch)
}
break
}
case "freebsd": {
keywords.push("freebsd")
if (x86_64.includes(arch)) {
keywords.push("amd64")
} else if (x86.includes(arch)) {
keywords.push("i386")
} else {
info(`Using arch ${arch} for LLVM`)
keywords.push(arch)
}
break
}
default:
info(`Using ${platform} ${arch} for LLVM`)
optionalKeywords.push(platform, arch)
break
}
return { keywords, optionalKeywords }
}

View File

@ -1,6 +1,7 @@
import { join } from "path"
import { addPath } from "envosman" import { addPath } from "envosman"
import { installAptPack } from "setup-apt" import { installAptPack } from "setup-apt"
import { installBrewPack } from "setup-brew" import { getBrewDir, installBrewPack } from "setup-brew"
import { rcOptions } from "../cli-options.js" import { rcOptions } from "../cli-options.js"
import { hasDnf } from "../utils/env/hasDnf.js" import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js" import { isArch } from "../utils/env/isArch.js"
@ -17,8 +18,10 @@ export async function setupMake(version: string, _setupDir: string, _arch: strin
} }
case "darwin": { case "darwin": {
await installBrewPack("make", version) await installBrewPack("make", version)
await addPath("/usr/local/opt/make/libexec/gnubin", rcOptions)
return { binDir: "/usr/local/opt/make/libexec/gnubin" } const gnuBinDir = join(getBrewDir(), "opt/make/libexec/gnubin")
await addPath(gnuBinDir, rcOptions)
return { binDir: gnuBinDir }
} }
case "linux": { case "linux": {
if (isArch()) { if (isArch()) {

View File

@ -1,24 +1,34 @@
import { addExeExt } from "patha" import { addExeExt } from "patha"
import { arm64, x86, x86_64 } from "../utils/env/arch.js"
import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin.js" import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin.js"
/** Get the platform name Ninja uses in their download links */ /** Get the platform name Ninja uses in their download links */
function getNinjaPlatform(platform: NodeJS.Platform) { function getNinjaPlatformArch(platform: NodeJS.Platform, arch: string) {
switch (platform) { switch (platform) {
case "win32": case "win32":
return "win" return x86_64.includes(arch)
|| x86.includes(arch)
? "win"
: arm64.includes(arch)
? "winarm64"
: "win"
case "darwin": case "darwin":
return "mac" return "mac"
case "linux": case "linux":
return "linux" return x86_64.includes(arch)
|| x86.includes(arch)
? "linux"
: arm64.includes(arch)
? "linux-aarch64"
: "linux"
default: default:
throw new Error(`Unsupported platform '${platform}'`) throw new Error(`Unsupported platform '${platform}'`)
} }
} }
/** Get the platform data for ninja */ /** Get the platform data for ninja */
// eslint-disable-next-line @typescript-eslint/no-unused-vars function getNinjaPackageInfo(version: string, platform: NodeJS.Platform, arch: string): PackageInfo {
function getNinjaPackageInfo(version: string, platform: NodeJS.Platform, _arch: string): PackageInfo { const ninjaPlatform = getNinjaPlatformArch(platform, arch)
const ninjaPlatform = getNinjaPlatform(platform)
return { return {
binRelativeDir: "", binRelativeDir: "",
binFileName: addExeExt("ninja"), binFileName: addExeExt("ninja"),

View File

@ -47,17 +47,19 @@ async function fetchGitHubAssetList(
continue continue
} }
if (!(release.tag_name in assets)) { const versionAssets: string[] = []
assets[release.tag_name] = []
}
const assets_ref = assets[release.tag_name] // const assets_ref = assets[release.tag_name]!
for (const asset of release.assets) { for (const asset of release.assets) {
if (filterAssets !== undefined && !filterAssets(asset.name)) { if (filterAssets !== undefined && !filterAssets(asset.name)) {
continue continue
} }
assets_ref.push(asset.name) versionAssets.push(asset.name)
}
if (versionAssets.length !== 0) {
assets[release.tag_name] = versionAssets.sort().reverse()
} }
} }
} catch (err) { } catch (err) {

View File

@ -0,0 +1,124 @@
import { existsSync } from "fs"
import { join } from "path"
import { mkdir, readFile, readdir, writeFile } from "fs/promises"
import { DownloaderHelper } from "node-downloader-helper"
import JsonStringify from "safe-stable-stringify"
import { compareVersion } from "../setup/version.ts"
type Options = {
/**
* The directory to download the HTML files
*/
htmlDownloadDir: string
/**
* The path to write the output json file
*/
path: string
/**
* A generator that returns the version and the URL of the asset to download
*
* The generator should return a tuple of the version and the URL
*/
getAssetVersionAndURL: () => Generator<[string, string], void, unknown>
/**
* Filter the assets
*/
filterAssets?: (asset: string) => boolean
}
/**
* Save the assets of the HTML files to a json file
*
* The assets are extracted from the href of the html files
*/
export async function saveHTMLAssets(opts: Options) {
await fetchIndexFiles(opts)
const assets: Record<string, string[]> = await extractAssetsFromHTML(opts)
// sort the assets by version
const jsonStringify = JsonStringify.configure({
deterministic: compareVersion,
})
// write the assets to a json file
const data = jsonStringify(assets, null, 2)
await writeFile(opts.path, data)
}
async function fetchIndexFiles(opts: Options) {
const promises: Promise<void>[] = []
await mkdir(opts.htmlDownloadDir, { recursive: true })
for (const [version, url] of opts.getAssetVersionAndURL()) {
promises.push(fetchIndexFile(version, url, opts.htmlDownloadDir))
}
await Promise.all(promises)
}
async function fetchIndexFile(version: string, url: string, htmlDownloadDir: string) {
try {
if (existsSync(join(htmlDownloadDir, version))) {
return
}
const dl = new DownloaderHelper(
url,
htmlDownloadDir,
{
fileName: `${version}.html`,
override: {
skip: true,
},
timeout: 500,
},
)
dl.on("start", () => {
console.log(`Downloading ${version}`)
})
dl.on("error", (err) => {
console.error(`Failed to download ${version}.html: ${err}`)
})
await dl.start()
} catch (err) {
console.error(err)
}
}
async function extractAssetsFromHTML(opts: Options) {
const assets: Record<string, string[]> = {}
const linkRegex = /href="([^"]+)"/g // match all href in the html
const indexFiles = await readdir(opts.htmlDownloadDir)
await Promise.all(indexFiles.map(async (indexFile) => {
const version = indexFile.replace(".html", "")
const versionAssets: string[] = []
// read the html file
const body = await readFile(`${opts.htmlDownloadDir}/${indexFile}`, "utf8")
// parse the html via regex
let match: RegExpExecArray | null
// biome-ignore lint/suspicious/noAssignInExpressions: ignore
while ((match = linkRegex.exec(body)) !== null) {
const asset = match[1]
if (opts.filterAssets !== undefined && !opts.filterAssets(asset)) {
continue
}
versionAssets.push(asset.replace("%2B", "+"))
}
if (versionAssets.length !== 0) {
// sort the names and update the assets
assets[version] = versionAssets.sort().reverse()
}
}))
return assets
}

View File

@ -0,0 +1,149 @@
import { readFile } from "fs/promises"
/**
* The list of assets
* @key tag The tag of the release
* @value assets The names of the assets of the release
*/
export type Assets = Record<string, string[] | undefined>
/**
* Load the list of assets from a json file
*/
export async function loadAssetList(path: string): Promise<Assets> {
const data = await readFile(path, "utf-8")
return JSON.parse(data)
}
type MatchAssetOpts = {
version: string
keywords?: string[]
optionalKeywords?: string[]
filterMapTag?: (tag: string) => string | undefined
filterName?: (asset: string) => boolean
}
/**
* Match the asset that matches the version and given keywords
*/
export function matchAsset(
assets: Assets,
opts: MatchAssetOpts,
): { tag: string; name: string } | undefined {
// get the list of versions
const origTags = Object.keys(assets)
// filter/map the tags
const versionMap: Map<string, string> = new Map()
if (opts.filterMapTag === undefined) {
for (const origTag of origTags) {
versionMap.set(origTag, origTag)
}
} else {
for (const origTag of origTags) {
const mappedTag = opts.filterMapTag(origTag)
if (mappedTag !== undefined) {
versionMap.set(mappedTag, origTag)
}
}
}
if (versionMap.size === 0) {
return undefined
}
// find the first tag that starts with the version
// loop over the versions starting with the latest
const candidateTags: string[] = []
for (const [version, origTag] of versionMap.entries()) {
if (version.startsWith(opts.version)) {
candidateTags.push(origTag)
}
}
if (candidateTags.length === 0) {
return undefined
}
// Loop over the candidate tags and return the first one that has assets
for (const candidateTag of candidateTags) {
// get the list of assets
let assetNames = assets[candidateTag]
if (assetNames === undefined) {
continue
}
// filter the assets
if (opts.filterName !== undefined) {
assetNames = assetNames.filter(opts.filterName)
}
if (assetNames.length === 0) {
continue
}
// check if this version contains the keywords and optional keywords in the asset name
const match = matchAssetName(candidateTag, assetNames, opts)
if (match !== undefined) {
return match
}
}
return undefined
}
function matchAssetName(tag: string, assetNames: string[], opts: MatchAssetOpts) {
// if no keywords are given, return the first asset
if (
(opts.keywords === undefined
|| opts.keywords.length === 0)
&& (opts.optionalKeywords === undefined
|| opts.optionalKeywords.length === 0)
) {
return { tag, name: assetNames[0] }
}
// check if the asset contains all the keywords
let candidates: string[] = []
if (
opts.keywords !== undefined
&& opts.keywords.length !== 0
) {
for (const name of assetNames) {
if (opts.keywords!.every((keyword) => name.includes(keyword))) {
candidates.push(name)
}
}
} else {
candidates = assetNames
}
if (candidates.length === 0) {
return undefined
}
// prefer the candidates that contain more optional keywords
if (
opts.optionalKeywords !== undefined
&& opts.optionalKeywords.length !== 0
) {
// rate the candidates based on the number of optional keywords they contain
const candidateScores = candidates.map((name) => {
let score = 0
for (const keyword of opts.optionalKeywords!) {
if (name.includes(keyword)) {
score++
}
}
return score
})
// find the candidate with the highest score
const maxScore = Math.max(...candidateScores)
const maxIndex = candidateScores.indexOf(maxScore)
return { tag, name: candidates[maxIndex] }
}
// return the first candidate if no optional keywords are given
return { tag, name: candidates[0] }
}

6
src/utils/env/arch.ts vendored Normal file
View File

@ -0,0 +1,6 @@
export const x86_64 = ["x64", "amd64", "x86_64", "win64", "64"]
export const x86 = ["x86", "i386", "ia32", "win32", "32", "x32"]
export const arm64 = ["aarch64", "arm64", "woa64", "arm"]
export const armv7 = ["armv7", "armv7a"]
export const powerpc64le = ["powerpc64le", "ppc64le"]
export const sparc64 = ["sparc64"]

View File

@ -42,12 +42,17 @@ function detectUsingOsVersion() {
return null return null
} }
// #46~22.04.1-Ubuntu SMP ... // #40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2
const osVersion: string = os.version() const osVersion: string = os.version()
const versionSplitted = osVersion.split(".") // parse the version
const majorVersion = Number.parseInt(versionSplitted[0].replace("#", ""), 10) const versionMatch = osVersion.match(/(\d+)\.(\d+)\.(\d+)/)
const minorVersion = Number.parseInt(versionSplitted[1].replace("~", ""), 10) if (versionMatch === null) {
const patchVersion = Number.parseInt(versionSplitted[2].split("-")[0], 10) return null
}
const majorVersion = Number.parseInt(versionMatch[1], 10)
const minorVersion = Number.parseInt(versionMatch[2], 10)
const patchVersion = Number.parseInt(versionMatch[3], 10)
return [majorVersion, minorVersion, patchVersion] return [majorVersion, minorVersion, patchVersion]
} }

View File

@ -1,80 +0,0 @@
import { readFile } from "fs/promises"
/**
* The list of assets of a GitHub release
* @key tag The tag of the release
* @value assets The names of the assets of the release
*/
export type Assets = Record<string, string[]>
export async function loadGitHubAssetList(path: string): Promise<Assets> {
const data = await readFile(path, "utf-8")
return JSON.parse(data)
}
type MatchAssetOpts = {
version: string
arch?: string
filterTag?: (version: string) => boolean
filterName?: (asset: string) => boolean
}
/**
* Match the asset that matches the version and arch
*/
export function matchAsset(
assets: Assets,
opts: MatchAssetOpts,
): { tag: string; name: string } {
// get the list of versions
let tags = Object.keys(assets)
// filter the versions
if (opts.filterTag !== undefined) {
tags = tags.filter(opts.filterTag)
}
if (tags.length === 0) {
throw new Error(`no tag found for version ${opts.version}`)
}
// find the first tag that starts with the version
// loop over the versions starting with the latest
let tag: string | undefined
for (const mingwVersion of tags) {
if (mingwVersion.startsWith(opts.version)) {
tag = mingwVersion
break
}
}
if (tag === undefined) {
throw new Error(`version ${opts.version} is not supported`)
}
// get the list of assets
let matchedNames = assets[tag]
// filter the assets
if (opts.filterName !== undefined) {
matchedNames = matchedNames.filter(opts.filterName)
}
if (matchedNames.length === 0) {
throw new Error(`no asset found for version ${opts.version} and arch ${opts.arch}`)
}
// use the first asset if the arch is not specified
if (opts.arch === undefined) {
return { tag, name: matchedNames[0] }
}
// find the asset that matches the arch
for (const name of matchedNames) {
// search each asset name for the arch
if (name.includes(opts.arch)) {
return { tag, name }
}
}
throw new Error(`arch ${opts.arch} could not be found among ${JSON.stringify(matchedNames)}`)
}

View File

@ -92,7 +92,7 @@ export function extractExe(file: string, dest: string) {
export async function extractZip(file: string, dest: string) { export async function extractZip(file: string, dest: string) {
// if unzip is available use it // if unzip is available use it
if (which.sync("unzip", { nothrow: true }) !== null) { if (which.sync("unzip", { nothrow: true }) !== null) {
await execa("unzip", [file, "-d", dest], { stdio: "inherit" }) await execa("unzip", ["-q", file, "-d", dest], { stdio: "inherit" })
await grantUserWriteAccess(dest) await grantUserWriteAccess(dest)
return dest return dest
} }

View File

@ -1,4 +1,6 @@
import { execRootSync } from "admina" import { tmpdir } from "os"
import { join } from "path"
import { execRootSync, isRoot } from "admina"
import { info, warning } from "ci-log" import { info, warning } from "ci-log"
import { execa, execaSync } from "execa" import { execa, execaSync } from "execa"
import which from "which" import which from "which"
@ -14,9 +16,8 @@ export async function setupPacmanPack(name: string, version?: string, aur?: stri
const pacman = "pacman" const pacman = "pacman"
if (aur === "yay" && which.sync("yay", { nothrow: true }) === null) { if (aur === "yay") {
// TODO: install yay automatically setupYay()
throw new Error(`yay is needed for ${name}, but it is not installed, please install it manually first`)
} }
// yay can't run as root, so skip update // yay can't run as root, so skip update
@ -33,9 +34,14 @@ export async function setupPacmanPack(name: string, version?: string, aur?: stri
const runInstall = (arg: string) => { const runInstall = (arg: string) => {
if (aur === "yay") { if (aur === "yay") {
// run yay as non-root, ERROR: Running makepkg as root is not allowed as it can cause permanent, catastrophic damage to your system. // run yay as non-root to fix ERROR: Running makepkg as root is not allowed as it can cause permanent, catastrophic damage to your system.
if (isRoot() && createdBuilderUser) {
// Run yay as builder user
return execRootSync("su", ["-", "builder", "-c", `yay -S --noconfirm ${arg}`])
} else {
return execaSync(aur, ["-S", "--noconfirm", arg]) return execaSync(aur, ["-S", "--noconfirm", arg])
} }
}
return execRootSync(aur ?? pacman, ["-S", "--noconfirm", arg]) return execRootSync(aur ?? pacman, ["-S", "--noconfirm", arg])
} }
@ -78,3 +84,54 @@ async function availablePacmanVersions(pacman: string, name: string) {
} }
return availableVersions return availableVersions
} }
let createdBuilderUser = false
function setupYay() {
if (which.sync("yay", { nothrow: true }) === null) {
try {
// Install prerequisites
execRootSync("pacman", ["-S", "--noconfirm", "base-devel", "git"])
const yayBuildDir = join(tmpdir(), "yay")
execRootSync("mkdir", ["-p", yayBuildDir])
if (isRoot()) {
// Create a non-root user to build yay
warning("Creating a non-root user to build yay")
execRootSync("useradd", ["-m", "-G", "wheel", "builder"])
execRootSync("passwd", ["-d", "builder"])
execRootSync("chown", ["-R", "builder:builder", yayBuildDir])
execRootSync("bash", ["-c", `echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers`])
createdBuilderUser = true
// Clone the yay repository into a temporary directory
execaSync("su", ["-", "builder", "-c", `git clone https://aur.archlinux.org/yay.git ${yayBuildDir}`], {
stdio: "inherit",
})
execaSync("su", ["-", "builder", "-c", `cd ${yayBuildDir} && makepkg -si --noconfirm`], {
stdio: "inherit",
})
} else {
// Clone the yay repository into a temporary directory
execaSync("git", ["clone", "https://aur.archlinux.org/yay.git", yayBuildDir], {
stdio: "inherit",
cwd: tmpdir(),
})
// Build and install yay
execaSync("makepkg", ["-si", "--noconfirm"], {
stdio: "inherit",
cwd: yayBuildDir,
})
}
// clean-up
execaSync("rm", ["-rf", yayBuildDir], { stdio: "inherit" })
} catch (error) {
throw new Error(`Failed to install yay: ${error}. Install yay manually and re-run the script.`)
}
}
}

View File

@ -7,6 +7,7 @@ import { mkdirp } from "mkdirp"
import { pathExists } from "path-exists" import { pathExists } from "path-exists"
import { addExeExt } from "patha" import { addExeExt } from "patha"
import { installAptPack } from "setup-apt" import { installAptPack } from "setup-apt"
import { installBrewPack } from "setup-brew"
import { untildifyUser } from "untildify-user" import { untildifyUser } from "untildify-user"
import which from "which" import which from "which"
import { rcOptions } from "../../cli-options.js" import { rcOptions } from "../../cli-options.js"
@ -186,6 +187,8 @@ export function setupPipPackSystem(name: string, addPythonPrefix = true) {
} else if (isUbuntu()) { } else if (isUbuntu()) {
return installAptPack([{ name: addPythonPrefix ? `python3-${name}` : name }]) return installAptPack([{ name: addPythonPrefix ? `python3-${name}` : name }])
} }
} else if (process.platform === "darwin") {
return installBrewPack(name)
} }
return null return null
} }

View File

@ -1,27 +1,18 @@
import { isArch } from "../utils/env/isArch.js" import { isArch } from "../utils/env/isArch.js"
// passing "" to a tool installed by a package manager (apt, brew, choco) will result in the default version of that package manager. const defaultLLVM = process.platform === "darwin" && process.arch === "x64"
// the directly downloaded tools require a given version ("" doesn't work). ? "15.0.7"
: "18.1.8"
function getLLVMDefault() {
switch (process.platform) {
case "win32":
return "17.0.6"
case "linux":
// used for non-ubuntu (Fedora, Arch)
// the suffixes relate to the suffix in the llvm releases
return "17.0.6-ubuntu-22.04"
case "darwin":
return "15.0.3"
default:
return "17.0.6"
}
}
/**
* Default versions for the tools
* DefaultUbuntuVersion overrides the default version for the tools on Ubuntu
*/
export const DefaultVersions: Record<string, string | undefined> = { export const DefaultVersions: Record<string, string | undefined> = {
llvm: getLLVMDefault(), // https://github.com/llvm/llvm-project/releases // https://github.com/llvm/llvm-project/releases
clangtidy: getLLVMDefault(), llvm: defaultLLVM,
clangformat: getLLVMDefault(), clangtidy: defaultLLVM,
clangformat: defaultLLVM,
ninja: "1.12.1", // https://github.com/ninja-build/ninja/releases ninja: "1.12.1", // https://github.com/ninja-build/ninja/releases
cmake: "3.30.2", // https://github.com/Kitware/CMake/releases cmake: "3.30.2", // https://github.com/Kitware/CMake/releases
gcovr: "5.2", // "6.0", // https://pypi.org/project/gcovr/ gcovr: "5.2", // "6.0", // https://pypi.org/project/gcovr/
@ -34,7 +25,7 @@ export const DefaultVersions: Record<string, string | undefined> = {
? "14.2.0posix-18.1.8-12.0.0-ucrt-r1" ? "14.2.0posix-18.1.8-12.0.0-ucrt-r1"
: "", // use the default version on Ubuntu, Fedora, Arch, macOS, etc. : "", // use the default version on Ubuntu, Fedora, Arch, macOS, etc.
// mingw: isArch() ? "12.2.0-1" : "8", // https://archlinux.org/packages/extra/x86_64/mingw-w64-gcc/ // mingw: isArch() ? "12.2.0-1" : "8", // https://archlinux.org/packages/extra/x86_64/mingw-w64-gcc/
powershell: "7.4.5", // https://github.com/PowerShell/PowerShell/releases/tag/v7.4.5 powershell: "7.4.5",
} }
export const MinVersions: Record<string, string | undefined> = { export const MinVersions: Record<string, string | undefined> = {
@ -45,38 +36,13 @@ export const MinVersions: Record<string, string | undefined> = {
/// If an ubuntu versions is not in this map: /// If an ubuntu versions is not in this map:
// - the newer ubuntu versions use the first entry (e.g. v20), // - the newer ubuntu versions use the first entry (e.g. v20),
// - the older ones use "" // - the older ones use ""
export const DefaultLinuxVersion: Record<string, Record<number, string> | undefined> = { export const DefaultUbuntuVersion: Record<string, Record<number, string> | undefined> = {
// https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=mingw-w64 // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=mingw-w64
mingw: { mingw: {
24: "8.0.0-1", 24: "8.0.0-1",
22: "8.0.0-1", 22: "8.0.0-1",
20: "7.0.0-2", 20: "7.0.0-2",
}, },
// the suffixes relate to the suffix in the llvm releases
llvm: {
24: "17.0.6-ubuntu-22.04",
22: "17.0.6-ubuntu-22.04",
20: "17.0.6-ubuntu-22.04",
18: "15.0.6-ubuntu-18.04",
16: "15.0.6-ubuntu-18.04",
14: "13.0.0-ubuntu-16.04",
},
clangtidy: {
24: "17.0.6-ubuntu-22.04",
22: "17.0.6-ubuntu-22.04",
20: "17.0.6-ubuntu-22.04",
18: "15.0.6-ubuntu-18.04",
16: "15.0.6-ubuntu-18.04",
14: "13.0.0-ubuntu-16.04",
},
clangformat: {
24: "17.0.6-ubuntu-22.04",
22: "17.0.6-ubuntu-22.04",
20: "17.0.6-ubuntu-22.04",
18: "15.0.6-ubuntu-18.04",
16: "15.0.6-ubuntu-18.04",
14: "13.0.0-ubuntu-16.04",
},
gcovr: { gcovr: {
24: "6.0", 24: "6.0",
22: "6.0", 22: "6.0",

View File

@ -1,11 +1,11 @@
import type { Opts } from "../cli-options.js" import type { Opts } from "../cli-options.js"
import type { Inputs } from "../tool.js" import type { Inputs } from "../tool.js"
import { DefaultLinuxVersion, DefaultVersions } from "./default_versions.js" import { DefaultUbuntuVersion, DefaultVersions } from "./default_versions.js"
/** Get the default version if passed true or undefined, otherwise return the version itself */ /** Get the default version if passed true or undefined, otherwise return the version itself */
export function getVersion(name: string, version: string | undefined, osVersion: number[] | null = null) { export function getVersion(name: string, version: string | undefined, osVersion: number[] | null = null) {
if (isVersionDefault(version) && process.platform === "linux" && osVersion !== null && name in DefaultLinuxVersion) { if (isVersionDefault(version) && process.platform === "linux" && osVersion !== null && name in DefaultUbuntuVersion) {
return getDefaultLinuxVersion(osVersion, DefaultLinuxVersion[name]!) return getDefaultLinuxVersion(osVersion, DefaultUbuntuVersion[name]!)
} else if (isVersionDefault(version) && name in DefaultVersions) { } else if (isVersionDefault(version) && name in DefaultVersions) {
return DefaultVersions[name] ?? "" return DefaultVersions[name] ?? ""
} else if (version === "true") { } else if (version === "true") {