summaryrefslogtreecommitdiff
path: root/tools/util.js
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-11-19 16:11:20 -0700
committerGitHub <noreply@github.com>2023-11-19 16:11:20 -0700
commit93c4c1a2c16f2db3051353d78989ffd29bf9e455 (patch)
tree3a2c504761d576a2aebddaa72bf74bfa7e3cd149 /tools/util.js
parentc806fbdabe144c865612bbbc9ef596c9611c8310 (diff)
chore: add aarch64-apple-darwin builds to ci (#21243)
This is a prerequisite to automatic code signing.
Diffstat (limited to 'tools/util.js')
-rw-r--r--tools/util.js17
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/util.js b/tools/util.js
index 0d57213e0..95eccbfe3 100644
--- a/tools/util.js
+++ b/tools/util.js
@@ -19,6 +19,8 @@ const versions = {
"dlint": "dlint 0.51.0",
};
+const compressed = new Set(["ld64.lld"]);
+
export const ROOT_PATH = dirname(dirname(fromFileUrl(import.meta.url)));
async function getFilesFromGit(baseDir, args) {
@@ -176,7 +178,7 @@ export function getPrebuiltToolPath(toolName) {
}
const downloadUrl =
- `https://raw.githubusercontent.com/denoland/deno_third_party/69ffd968c0c435f5f9dbba713a92b4fb6a3e2301/prebuilt/${platformDirName}`;
+ `https://raw.githubusercontent.com/denoland/deno_third_party/1fd66ef78ab40841db833d4a1efd5c5597faf066/prebuilt/${platformDirName}`;
export async function downloadPrebuilt(toolName) {
// Ensure only one download per tool happens at a time
@@ -195,7 +197,10 @@ export async function downloadPrebuilt(toolName) {
try {
await Deno.mkdir(PREBUILT_TOOL_DIR, { recursive: true });
- const url = `${downloadUrl}/${toolName}${executableSuffix}`;
+ let url = `${downloadUrl}/${toolName}${executableSuffix}`;
+ if (compressed.has(toolName)) {
+ url += ".gz";
+ }
const resp = await fetch(url);
if (!resp.ok) {
@@ -208,7 +213,13 @@ export async function downloadPrebuilt(toolName) {
mode: 0o755,
});
- await resp.body.pipeTo(file.writable);
+ if (compressed.has(toolName)) {
+ await resp.body.pipeThrough(new DecompressionStream("gzip")).pipeTo(
+ file.writable,
+ );
+ } else {
+ await resp.body.pipeTo(file.writable);
+ }
spinner.text = `Checking prebuilt tool: ${toolName}`;
await sanityCheckPrebuiltFile(tempFile);
if (!await verifyVersion(toolName, tempFile)) {