mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
ci: remove hardcoded chromium version and sysroot file
This commit is contained in:
@@ -9,8 +9,8 @@ import { tmpdir } from 'os';
|
||||
import * as fs from 'fs';
|
||||
import * as https from 'https';
|
||||
import * as path from 'path';
|
||||
import { sysrootInfo } from './sysroots';
|
||||
import { ArchString } from './types';
|
||||
import * as util from '../../lib/util';
|
||||
|
||||
// Based on https://source.chromium.org/chromium/chromium/src/+/main:build/linux/sysroot_scripts/install-sysroot.py.
|
||||
const URL_PREFIX = 'https://msftelectron.blob.core.windows.net';
|
||||
@@ -38,7 +38,14 @@ type SysrootDictEntry = {
|
||||
};
|
||||
|
||||
export async function getSysroot(arch: ArchString): Promise<string> {
|
||||
const sysrootDict: SysrootDictEntry = sysrootInfo[arch];
|
||||
const sysrootJSONUrl = `https://raw.githubusercontent.com/electron/electron/v${util.getElectronVersion()}/script/sysroots.json`;
|
||||
const sysrootDictLocation = `${tmpdir()}/sysroots.json`;
|
||||
const result = spawnSync('curl', [sysrootJSONUrl, '-o', sysrootDictLocation]);
|
||||
if (result.status !== 0) {
|
||||
throw new Error('Cannot retrieve sysroots.json. Stderr:\n' + result.stderr);
|
||||
}
|
||||
const sysrootInfo = require(sysrootDictLocation);
|
||||
const sysrootDict: SysrootDictEntry = sysrootInfo[`bullseye_${arch}`];
|
||||
const tarballFilename = sysrootDict['Tarball'];
|
||||
const tarballSha = sysrootDict['Sha1Sum'];
|
||||
const sysroot = path.join(tmpdir(), sysrootDict['SysrootDir']);
|
||||
|
||||
Reference in New Issue
Block a user