Skip to content

Commit 9cdd289

Browse files
authored
chore: update node checksums (microsoft#186181)
* chore: update node checksums * chore: bump distro
1 parent d35617d commit 9cdd289

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

build/gulpfile.reh.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,10 @@ function getNodeChecksum(nodeVersion, platform, arch) {
138138
break;
139139

140140
case 'darwin':
141+
case 'alpine':
141142
case 'linux':
142143
expectedName = `node-v${nodeVersion}-${platform}-${arch}.tar.gz`;
143144
break;
144-
145-
case 'alpine':
146-
expectedName = `${platform}-${arch}/node`;
147-
break;
148145
}
149146

150147
const nodeJsChecksums = fs.readFileSync(path.join(REPO_ROOT, 'build', 'checksums', 'nodejs.txt'), 'utf8');
@@ -157,6 +154,13 @@ function getNodeChecksum(nodeVersion, platform, arch) {
157154
return undefined;
158155
}
159156

157+
function extractAlpinefromDocker(nodeVersion, platform, arch) {
158+
const imageName = arch === 'arm64' ? 'arm64v8/node' : 'node';
159+
log(`Downloading node.js ${nodeVersion} ${platform} ${arch} from docker image ${imageName}`);
160+
const contents = cp.execSync(`docker run --rm ${imageName}:${nodeVersion}-alpine /bin/sh -c 'cat \`which node\`'`, { maxBuffer: 100 * 1024 * 1024, encoding: 'buffer' });
161+
return es.readArray([new File({ path: 'node', contents, stat: { mode: parseInt('755', 8) } })]);
162+
}
163+
160164
const { nodeVersion, internalNodeVersion } = getNodeVersion();
161165

162166
BUILD_TARGETS.forEach(({ platform, arch }) => {
@@ -219,18 +223,14 @@ function nodejs(platform, arch) {
219223
.pipe(filter('**/node'))
220224
.pipe(util.setExecutableBit('**'))
221225
.pipe(rename('node'));
222-
case 'alpine': {
223-
const imageName = arch === 'arm64' ? 'arm64v8/node' : 'node';
224-
log(`Downloading node.js ${nodeVersion} ${platform} ${arch} from docker image ${imageName}`);
225-
const contents = cp.execSync(`docker run --rm ${imageName}:${nodeVersion}-alpine /bin/sh -c 'cat \`which node\`'`, { maxBuffer: 100 * 1024 * 1024, encoding: 'buffer' });
226-
if (checksumSha256) {
227-
const actualSHA256Checksum = crypto.createHash('sha256').update(contents).digest('hex');
228-
if (actualSHA256Checksum !== checksumSha256) {
229-
throw new Error(`Checksum mismatch for node.js from docker image (expected ${options.checksumSha256}, actual ${actualSHA256Checksum}))`);
230-
}
231-
}
232-
return es.readArray([new File({ path: 'node', contents, stat: { mode: parseInt('755', 8) } })]);
233-
}
226+
case 'alpine':
227+
return product.nodejsRepository !== 'https://nodejs.org' ?
228+
fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: `node-v${nodeVersion}-${platform}-${arch}.tar.gz`, checksumSha256 })
229+
.pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
230+
.pipe(filter('**/node'))
231+
.pipe(util.setExecutableBit('**'))
232+
.pipe(rename('node'))
233+
: extractAlpinefromDocker(nodeVersion, platform, arch);
234234
}
235235
}
236236

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "code-oss-dev",
33
"version": "1.80.0",
4-
"distro": "c2d5cc90ebce835fa01abe430b39d200a8417894",
4+
"distro": "e741dbd03d4a6f9ac2093d4a173aa5e5c30411a5",
55
"author": {
66
"name": "Microsoft Corporation"
77
},

remote/.yarnrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
disturl "http://nodejs.org/dist"
22
target "16.17.1"
3-
ms_build_id "218982"
3+
ms_build_id "220517"
44
runtime "node"
55
build_from_source "true"

0 commit comments

Comments
 (0)