Skip to content

Commit 518a183

Browse files
authored
eng - add build version of node.js to .yarnrc (microsoft#185302)
* eng - add build version of node.js to `.yarnrc` * 🆙 distro
1 parent 0e9c2fa commit 518a183

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

build/gulpfile.reh.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ const serverWithWebEntryPoints = [
125125

126126
function getNodeVersion() {
127127
const yarnrc = fs.readFileSync(path.join(REPO_ROOT, 'remote', '.yarnrc'), 'utf8');
128-
const target = /^target "(.*)"$/m.exec(yarnrc)[1];
129-
return target;
128+
const nodeVersion = /^target "(.*)"$/m.exec(yarnrc)[1];
129+
const internalNodeVersion = /^ms_build_id "(.*)"$/m.exec(yarnrc)[1];
130+
return { nodeVersion, internalNodeVersion };
130131
}
131132

132133
function getNodeChecksum(nodeVersion, platform, arch) {
@@ -156,7 +157,7 @@ function getNodeChecksum(nodeVersion, platform, arch) {
156157
return undefined;
157158
}
158159

159-
const nodeVersion = getNodeVersion();
160+
const { nodeVersion, internalNodeVersion } = getNodeVersion();
160161

161162
BUILD_TARGETS.forEach(({ platform, arch }) => {
162163
gulp.task(task.define(`node-${platform}-${arch}`, () => {
@@ -193,7 +194,7 @@ function nodejs(platform, arch) {
193194
arch = 'x64';
194195
}
195196

196-
log(`Downloading node.js ${nodeVersion} ${platform} ${arch} from ${product.nodejs.repository}...`);
197+
log(`Downloading node.js ${nodeVersion} ${platform} ${arch} from ${product.nodejsRepository}...`);
197198

198199
const checksumSha256 = getNodeChecksum(nodeVersion, platform, arch);
199200

@@ -205,14 +206,14 @@ function nodejs(platform, arch) {
205206

206207
switch (platform) {
207208
case 'win32':
208-
return (product.nodejs.repository !== 'https://nodejs.org' ?
209-
fetchGithub(product.nodejs.repository, { version: product.nodejs.version, name: `win-${arch}-node.exe`, checksumSha256 }) :
209+
return (product.nodejsRepository !== 'https://nodejs.org' ?
210+
fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: `win-${arch}-node.exe`, checksumSha256 }) :
210211
fetchUrls(`/dist/v${nodeVersion}/win-${arch}/node.exe`, { base: 'https://nodejs.org', checksumSha256 }))
211212
.pipe(rename('node.exe'));
212213
case 'darwin':
213214
case 'linux':
214-
return (product.nodejs.repository !== 'https://nodejs.org' ?
215-
fetchGithub(product.nodejs.repository, { version: product.nodejs.version, name: `node-v${nodeVersion}-${platform}-${arch}.tar.gz`, checksumSha256 }) :
215+
return (product.nodejsRepository !== 'https://nodejs.org' ?
216+
fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: `node-v${nodeVersion}-${platform}-${arch}.tar.gz`, checksumSha256 }) :
216217
fetchUrls(`/dist/v${nodeVersion}/node-v${nodeVersion}-${platform}-${arch}.tar.gz`, { base: 'https://nodejs.org', checksumSha256 })
217218
).pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
218219
.pipe(filter('**/node'))

package.json

Lines changed: 2 additions & 2 deletions
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": "a44605dbeeed7ad5c41513260004329c4f502793",
4+
"distro": "94a4bd29af2fe03e39c7867fdca1b2e27fed3a39",
55
"author": {
66
"name": "Microsoft Corporation"
77
},
@@ -230,4 +230,4 @@
230230
"optionalDependencies": {
231231
"windows-foreground-love": "0.5.0"
232232
}
233-
}
233+
}

product.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"linuxIconName": "code-oss",
3131
"licenseFileName": "LICENSE.txt",
3232
"reportIssueUrl": "https://github.com/microsoft/vscode/issues/new",
33+
"nodejsRepository": "https://nodejs.org",
3334
"urlProtocol": "code-oss",
3435
"webviewContentExternalBaseUrlTemplate": "https://{{uuid}}.vscode-cdn.net/insider/ef65ac1ba57f57f2a3961bfe94aa20481caca4c6/out/vs/workbench/contrib/webview/browser/pre/",
3536
"builtInExtensions": [
@@ -81,9 +82,5 @@
8182
"publisherDisplayName": "Microsoft"
8283
}
8384
}
84-
],
85-
"nodejs": {
86-
"repository": "https://nodejs.org",
87-
"version": "16.17.1"
88-
}
85+
]
8986
}

remote/.yarnrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
disturl "http://nodejs.org/dist"
22
target "16.17.1"
3+
ms_build_id "20230714"
34
runtime "node"
45
build_from_source "true"

0 commit comments

Comments
 (0)