Skip to content

Commit

Permalink
Add support for 12.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleMayes committed Jul 21, 2021
1 parent 94441eb commit 3c8956c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

21 changes: 19 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const VERSIONS: Set<string> = getVersions([
"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.0", "12.0.1",
]);

/** Gets the ordering of two (specific or minimum) LLVM versions. */
Expand Down Expand Up @@ -111,6 +111,7 @@ const DARWIN_MISSING: Set<string> = new Set([
"8.0.1",
"11.0.1",
"11.1.0",
"12.0.1",
]);

/** Gets an LLVM download URL for the Darwin platform. */
Expand All @@ -129,6 +130,16 @@ function getDarwinUrl(version: string, options: Options): string | null {
}
}

/**
* 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([
["12.0.1", "12.0.1-rc4"],
]);

/** The (latest) Ubuntu versions for each LLVM version. */
const UBUNTU: { [key: string]: string } = {
"3.5.0": "-ubuntu-14.04",
Expand Down Expand Up @@ -161,13 +172,19 @@ const UBUNTU: { [key: string]: string } = {
"11.0.1": "-ubuntu-16.04",
"11.1.0": "-ubuntu-16.04",
"12.0.0": "-ubuntu-20.04",
"12.0.1-rc4": "-ubuntu-21.04",
};

/** The latest supported LLVM version for the Linux (Ubuntu) platform. */
const MAX_UBUNTU: string = "12.0.0";
const MAX_UBUNTU: string = "12.0.1-rc4";

/** Gets an LLVM download URL for the Linux (Ubuntu) platform. */
function getLinuxUrl(version: string, options: Options): string | null {
const rc = UBUNTU_RC.get(version);
if (rc) {
version = rc;
}

let ubuntu;
if (options.ubuntuVersion) {
ubuntu = `-ubuntu-${options.ubuntuVersion}`;
Expand Down

0 comments on commit 3c8956c

Please sign in to comment.