chore: update node checksums (#186181)

* chore: update node checksums

* chore: bump distro
This commit is contained in:
Robo 2023-06-27 01:20:59 +09:00 committed by GitHub
parent d35617d170
commit 9cdd289db0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 18 deletions

View file

@ -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);
}
}

View file

@ -1,7 +1,7 @@
{
"name": "code-oss-dev",
"version": "1.80.0",
"distro": "c2d5cc90ebce835fa01abe430b39d200a8417894",
"distro": "e741dbd03d4a6f9ac2093d4a173aa5e5c30411a5",
"author": {
"name": "Microsoft Corporation"
},

View file

@ -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"