ci: remove install build dependencies step on linux (#257050)

This commit is contained in:
Robo
2025-07-21 18:38:54 +09:00
committed by GitHub
parent c3d67c3e49
commit b37c013d08
5 changed files with 10 additions and 63 deletions

View File

@@ -15,7 +15,6 @@ const fs_1 = __importDefault(require("fs"));
const https_1 = __importDefault(require("https"));
const path_1 = __importDefault(require("path"));
const crypto_1 = require("crypto");
const ansi_colors_1 = __importDefault(require("ansi-colors"));
// Based on https://source.chromium.org/chromium/chromium/src/+/main:build/linux/sysroot_scripts/install-sysroot.py.
const URL_PREFIX = 'https://msftelectronbuild.z5.web.core.windows.net';
const URL_PATH = 'sysroots/toolchain';
@@ -89,22 +88,22 @@ async function fetchUrl(options, retries = 10, retryDelay = 1000) {
});
if (assetResponse.ok && (assetResponse.status >= 200 && assetResponse.status < 300)) {
const assetContents = Buffer.from(await assetResponse.arrayBuffer());
console.log(`Fetched response body buffer: ${ansi_colors_1.default.magenta(`${assetContents.byteLength} bytes`)}`);
console.log(`Fetched response body buffer: ${assetContents.byteLength} bytes`);
if (options.checksumSha256) {
const actualSHA256Checksum = (0, crypto_1.createHash)('sha256').update(assetContents).digest('hex');
if (actualSHA256Checksum !== options.checksumSha256) {
throw new Error(`Checksum mismatch for ${ansi_colors_1.default.cyan(asset.url)} (expected ${options.checksumSha256}, actual ${actualSHA256Checksum}))`);
throw new Error(`Checksum mismatch for ${asset.url} (expected ${options.checksumSha256}, actual ${actualSHA256Checksum}))`);
}
}
console.log(`Verified SHA256 checksums match for ${ansi_colors_1.default.cyan(asset.url)}`);
console.log(`Verified SHA256 checksums match for ${asset.url}`);
const tarCommand = `tar -xz -C ${options.dest}`;
(0, child_process_1.execSync)(tarCommand, { input: assetContents });
console.log(`Fetch complete!`);
return;
}
throw new Error(`Request ${ansi_colors_1.default.magenta(asset.url)} failed with status code: ${assetResponse.status}`);
throw new Error(`Request ${asset.url} failed with status code: ${assetResponse.status}`);
}
throw new Error(`Request ${ansi_colors_1.default.magenta('https://api.github.com')} failed with status code: ${response.status}`);
throw new Error(`Request https://api.github.com failed with status code: ${response.status}`);
}
finally {
clearTimeout(timeout);

View File

@@ -10,7 +10,6 @@ import https from 'https';
import path from 'path';
import { createHash } from 'crypto';
import { DebianArchString } from './types';
import ansiColors from 'ansi-colors';
// Based on https://source.chromium.org/chromium/chromium/src/+/main:build/linux/sysroot_scripts/install-sysroot.py.
const URL_PREFIX = 'https://msftelectronbuild.z5.web.core.windows.net';
@@ -98,22 +97,22 @@ async function fetchUrl(options: IFetchOptions, retries = 10, retryDelay = 1000)
});
if (assetResponse.ok && (assetResponse.status >= 200 && assetResponse.status < 300)) {
const assetContents = Buffer.from(await assetResponse.arrayBuffer());
console.log(`Fetched response body buffer: ${ansiColors.magenta(`${(assetContents as Buffer).byteLength} bytes`)}`);
console.log(`Fetched response body buffer: ${(assetContents as Buffer).byteLength} bytes`);
if (options.checksumSha256) {
const actualSHA256Checksum = createHash('sha256').update(assetContents).digest('hex');
if (actualSHA256Checksum !== options.checksumSha256) {
throw new Error(`Checksum mismatch for ${ansiColors.cyan(asset.url)} (expected ${options.checksumSha256}, actual ${actualSHA256Checksum}))`);
throw new Error(`Checksum mismatch for ${asset.url} (expected ${options.checksumSha256}, actual ${actualSHA256Checksum}))`);
}
}
console.log(`Verified SHA256 checksums match for ${ansiColors.cyan(asset.url)}`);
console.log(`Verified SHA256 checksums match for ${asset.url}`);
const tarCommand = `tar -xz -C ${options.dest}`;
execSync(tarCommand, { input: assetContents });
console.log(`Fetch complete!`);
return;
}
throw new Error(`Request ${ansiColors.magenta(asset.url)} failed with status code: ${assetResponse.status}`);
throw new Error(`Request ${asset.url} failed with status code: ${assetResponse.status}`);
}
throw new Error(`Request ${ansiColors.magenta('https://api.github.com')} failed with status code: ${response.status}`);
throw new Error(`Request https://api.github.com failed with status code: ${response.status}`);
} finally {
clearTimeout(timeout);
}