Skip to content

Commit 7884ce2

Browse files
Tajudeenclaude
andcommitted
fix(build): add riscv64/loong64/ppc64/s390x to REH targets and support unofficial Node.js builds
- Add riscv64, loong64, ppc64, s390x to BUILD_TARGETS in gulpfile.reh.ts so that gulp tasks (vscode-reh-linux-*-min-ci) are registered for these architectures. - Update nodejs() to check VSCODE_NODEJS_SITE/VSCODE_NODEJS_URLROOT/VSCODE_NODEJS_URLSUFFIX env vars (set by package_reh.sh) so unofficial-builds.nodejs.org is used for architectures not available on nodejs.org (riscv64, loong64, x64-glibc-217). - Fix win32ContextMenu null guard in gulpfile.vscode.ts to prevent TypeError when product.json lacks the win32ContextMenu field (not present in CortexIDE product.json). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7de915d commit 7884ce2

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

build/gulpfile.reh.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ const BUILD_TARGETS = [
5555
{ platform: 'linux', arch: 'x64' },
5656
{ platform: 'linux', arch: 'armhf' },
5757
{ platform: 'linux', arch: 'arm64' },
58+
{ platform: 'linux', arch: 'riscv64' },
59+
{ platform: 'linux', arch: 'loong64' },
60+
{ platform: 'linux', arch: 'ppc64' },
61+
{ platform: 'linux', arch: 's390x' },
5862
{ platform: 'alpine', arch: 'arm64' },
5963
// legacy: we use to ship only one alpine so it was put in the arch, but now we ship
6064
// multiple alpine images and moved to a better model (alpine as the platform)
@@ -238,14 +242,28 @@ function nodejs(platform: string, arch: string): NodeJS.ReadWriteStream | undefi
238242
fetchUrls(`/dist/v${nodeVersion}/win-${arch}/node.exe`, { base: 'https://nodejs.org', checksumSha256 }))
239243
.pipe(rename('node.exe'));
240244
case 'darwin':
241-
case 'linux':
245+
case 'linux': {
246+
// Support unofficial Node.js builds (e.g. riscv64, loong64) via VSCODE_NODEJS_SITE env var.
247+
// Set by package_reh.sh for architectures not available on nodejs.org.
248+
const unofficialSite = process.env['VSCODE_NODEJS_SITE'];
249+
const unofficialUrlRoot = process.env['VSCODE_NODEJS_URLROOT'];
250+
const unofficialUrlSuffix = process.env['VSCODE_NODEJS_URLSUFFIX'] ?? '';
251+
if (unofficialSite && unofficialUrlRoot) {
252+
log(`Downloading node.js ${nodeVersion} ${platform} ${arch} from unofficial builds: ${unofficialSite}...`);
253+
return fetchUrls(`${unofficialUrlRoot}/v${nodeVersion}/node-v${nodeVersion}-${platform}-${arch}${unofficialUrlSuffix}.tar.gz`, { base: unofficialSite, checksumSha256 })
254+
.pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
255+
.pipe(filter('**/node'))
256+
.pipe(util.setExecutableBit('**'))
257+
.pipe(rename('node'));
258+
}
242259
return (product.nodejsRepository !== 'https://nodejs.org' ?
243260
fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: expectedName!, checksumSha256 }) :
244261
fetchUrls(`/dist/v${nodeVersion}/node-v${nodeVersion}-${platform}-${arch}.tar.gz`, { base: 'https://nodejs.org', checksumSha256 })
245262
).pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
246263
.pipe(filter('**/node'))
247264
.pipe(util.setExecutableBit('**'))
248265
.pipe(rename('node'));
266+
}
249267
case 'alpine':
250268
return product.nodejsRepository !== 'https://nodejs.org' ?
251269
fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: expectedName!, checksumSha256 })

build/gulpfile.vscode.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,8 @@ function packageTask(platform: string, arch: string, sourceFolderName: string, d
611611
result = es.merge(result, gulp.src('.build/policies/win32/**', { base: '.build/policies/win32' })
612612
.pipe(rename(f => f.dirname = `policies/${f.dirname}`)));
613613

614-
if (quality === 'stable' || quality === 'insider') {
614+
const win32ContextMenu = (product as { win32ContextMenu?: Record<string, { clsid: string }> }).win32ContextMenu;
615+
if ((quality === 'stable' || quality === 'insider') && win32ContextMenu?.[arch]) {
615616
result = es.merge(result, gulp.src('.build/win32/appx/**', { base: '.build/win32' }));
616617
const rawVersion = version.replace(/-\w+$/, '').split('.');
617618
const appxVersion = `${rawVersion[0]}.0.${rawVersion[1]}.${rawVersion[2]}`;
@@ -623,7 +624,7 @@ function packageTask(platform: string, arch: string, sourceFolderName: string, d
623624
.pipe(replace('@@ApplicationIdShort@@', product.win32RegValueName))
624625
.pipe(replace('@@ApplicationExe@@', product.nameShort + '.exe'))
625626
.pipe(replace('@@FileExplorerContextMenuID@@', quality === 'stable' ? 'OpenWithCode' : 'OpenWithCodeInsiders'))
626-
.pipe(replace('@@FileExplorerContextMenuCLSID@@', (product as { win32ContextMenu?: Record<string, { clsid: string }> }).win32ContextMenu![arch].clsid))
627+
.pipe(replace('@@FileExplorerContextMenuCLSID@@', win32ContextMenu[arch].clsid))
627628
.pipe(replace('@@FileExplorerContextMenuDLL@@', `${quality === 'stable' ? 'code' : 'code_insider'}_explorer_command_${arch}.dll`))
628629
.pipe(rename(f => f.dirname = `appx/manifest`)));
629630
}

0 commit comments

Comments
 (0)