mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 13:29:44 +00:00
chore: update node checksums (#186181)
* chore: update node checksums * chore: bump distro
This commit is contained in:
parent
d35617d170
commit
9cdd289db0
|
@ -138,13 +138,10 @@ function getNodeChecksum(nodeVersion, platform, arch) {
|
|||
break;
|
||||
|
||||
case 'darwin':
|
||||
case 'alpine':
|
||||
case 'linux':
|
||||
expectedName = `node-v${nodeVersion}-${platform}-${arch}.tar.gz`;
|
||||
break;
|
||||
|
||||
case 'alpine':
|
||||
expectedName = `${platform}-${arch}/node`;
|
||||
break;
|
||||
}
|
||||
|
||||
const nodeJsChecksums = fs.readFileSync(path.join(REPO_ROOT, 'build', 'checksums', 'nodejs.txt'), 'utf8');
|
||||
|
@ -157,6 +154,13 @@ function getNodeChecksum(nodeVersion, platform, arch) {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
function extractAlpinefromDocker(nodeVersion, platform, arch) {
|
||||
const imageName = arch === 'arm64' ? 'arm64v8/node' : 'node';
|
||||
log(`Downloading node.js ${nodeVersion} ${platform} ${arch} from docker image ${imageName}`);
|
||||
const contents = cp.execSync(`docker run --rm ${imageName}:${nodeVersion}-alpine /bin/sh -c 'cat \`which node\`'`, { maxBuffer: 100 * 1024 * 1024, encoding: 'buffer' });
|
||||
return es.readArray([new File({ path: 'node', contents, stat: { mode: parseInt('755', 8) } })]);
|
||||
}
|
||||
|
||||
const { nodeVersion, internalNodeVersion } = getNodeVersion();
|
||||
|
||||
BUILD_TARGETS.forEach(({ platform, arch }) => {
|
||||
|
@ -219,18 +223,14 @@ function nodejs(platform, arch) {
|
|||
.pipe(filter('**/node'))
|
||||
.pipe(util.setExecutableBit('**'))
|
||||
.pipe(rename('node'));
|
||||
case 'alpine': {
|
||||
const imageName = arch === 'arm64' ? 'arm64v8/node' : 'node';
|
||||
log(`Downloading node.js ${nodeVersion} ${platform} ${arch} from docker image ${imageName}`);
|
||||
const contents = cp.execSync(`docker run --rm ${imageName}:${nodeVersion}-alpine /bin/sh -c 'cat \`which node\`'`, { maxBuffer: 100 * 1024 * 1024, encoding: 'buffer' });
|
||||
if (checksumSha256) {
|
||||
const actualSHA256Checksum = crypto.createHash('sha256').update(contents).digest('hex');
|
||||
if (actualSHA256Checksum !== checksumSha256) {
|
||||
throw new Error(`Checksum mismatch for node.js from docker image (expected ${options.checksumSha256}, actual ${actualSHA256Checksum}))`);
|
||||
}
|
||||
}
|
||||
return es.readArray([new File({ path: 'node', contents, stat: { mode: parseInt('755', 8) } })]);
|
||||
}
|
||||
case 'alpine':
|
||||
return product.nodejsRepository !== 'https://nodejs.org' ?
|
||||
fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: `node-v${nodeVersion}-${platform}-${arch}.tar.gz`, checksumSha256 })
|
||||
.pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
|
||||
.pipe(filter('**/node'))
|
||||
.pipe(util.setExecutableBit('**'))
|
||||
.pipe(rename('node'))
|
||||
: extractAlpinefromDocker(nodeVersion, platform, arch);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "code-oss-dev",
|
||||
"version": "1.80.0",
|
||||
"distro": "c2d5cc90ebce835fa01abe430b39d200a8417894",
|
||||
"distro": "e741dbd03d4a6f9ac2093d4a173aa5e5c30411a5",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
disturl "http://nodejs.org/dist"
|
||||
target "16.17.1"
|
||||
ms_build_id "218982"
|
||||
ms_build_id "220517"
|
||||
runtime "node"
|
||||
build_from_source "true"
|
||||
|
|
Loading…
Reference in a new issue