Skip to content

Commit 007a51e

Browse files
committed
feat: support llvm 15
1 parent ccb81ee commit 007a51e

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/llvm/__tests__/llvm.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ describe("setup-llvm", () => {
5454
it("Finds valid LLVM URLs", async () => {
5555
await Promise.all(
5656
[
57+
"15",
5758
// "14.0.1",
5859
"14.0.0",
5960
"13.0.0",

src/llvm/llvm.ts

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ export const VERSIONS: Set<string> = getVersions([
7171
"14.0.4",
7272
"14.0.5",
7373
"14.0.6",
74+
"15.0.0",
75+
"15.0.1",
76+
"15.0.2",
7477
])
7578

7679
//================================================
@@ -174,6 +177,7 @@ const UBUNTU_SUFFIX_MAP: { [key: string]: string } = {
174177
"13.0.1-ubuntu-18.04": "-ubuntu-18.04",
175178
"14.0.0": "-ubuntu-18.04",
176179
// "14.0.1": "-ubuntu-18.04", // only available for powerpc64le
180+
"15.0.2": "-rhel86",
177181
}
178182

179183
/** The latest supported LLVM version for the Linux (Ubuntu) platform. */
@@ -188,25 +192,34 @@ export function getLinuxUrl(versionGiven: string): string {
188192
version = rc
189193
}
190194

191-
let ubuntu: string
195+
let linuxVersion: string
192196
// ubuntu-version is specified
193197
if (version.includes("ubuntu")) {
194198
const givenUbuntuVersion = version.replace(/-ubuntu-.*/, "")
195199
if (!VERSIONS.has(givenUbuntuVersion)) {
196200
throw new Error(`Unsupported Ubuntu version: ${givenUbuntuVersion}`)
197201
}
198-
ubuntu = version.replace(givenUbuntuVersion, "")
202+
linuxVersion = version.replace(givenUbuntuVersion, "")
199203
version = getSpecificVersions(VERSIONS, givenUbuntuVersion)[0]
200204
} else if (version !== "" && version in UBUNTU_SUFFIX_MAP) {
201-
ubuntu = UBUNTU_SUFFIX_MAP[version]
205+
linuxVersion = UBUNTU_SUFFIX_MAP[version]
202206
} else {
203207
// default to the maximum version
204-
ubuntu = UBUNTU_SUFFIX_MAP[MAX_UBUNTU]
205-
warning(`Falling back to LLVM version ${MAX_UBUNTU} ${ubuntu} for the Ubuntu.`)
208+
linuxVersion = UBUNTU_SUFFIX_MAP[MAX_UBUNTU]
209+
warning(`Falling back to LLVM version ${MAX_UBUNTU} ${linuxVersion} for the Ubuntu.`)
206210
}
207211

208212
const prefix = "clang+llvm-"
209-
const suffix = version === "5.0.0" ? `-linux-x86_64${ubuntu}.tar.xz` : `-x86_64-linux-gnu${ubuntu}.tar.xz`
213+
214+
let suffix: string
215+
if (version === "5.0.0") {
216+
suffix = `-linux-x86_64${linuxVersion}.tar.xz`
217+
} else if (version === "15.0.2") {
218+
suffix = `x86_64-unknown-linux-gnu${linuxVersion}.tar.xz`
219+
} else {
220+
suffix = `-x86_64-linux-gnu${linuxVersion}.tar.xz`
221+
}
222+
210223
if (semverLte(version, "9.0.1")) {
211224
return getReleaseUrl(version, prefix, suffix)
212225
} else {

0 commit comments

Comments
 (0)