fix: remote folder compilation on macOS with node.js v20.18.0 (#231928)

* fix: remote folder compilation on macOS with node.js v20.18.0

* chore: update debian deps

* chore: update rpm deps
This commit is contained in:
Robo
2024-10-22 22:26:13 +09:00
committed by GitHub
parent b79ff2ede0
commit 804f450ca9
7 changed files with 29 additions and 3 deletions

View File

@@ -76,6 +76,20 @@ function setNpmrcConfig(dir, env) {
}
}
// Force node-gyp to use process.config on macOS
// which defines clang variable as expected. Otherwise we
// run into compilation errors due to incorrect compiler
// configuration.
// NOTE: This means the process.config should contain
// the correct clang variable. So keep the version check
// in preinstall sync with this logic.
// Change was first introduced in https://github.com/nodejs/node/commit/6e0a2bb54c5bbeff0e9e33e1a0c683ed980a8a0f
if (dir === 'remote' && process.platform === 'darwin') {
env['npm_config_force_process_config'] = 'true';
} else {
delete env['npm_config_force_process_config'];
}
if (dir === 'build') {
env['npm_config_target'] = process.versions.node;
env['npm_config_arch'] = process.arch;

View File

@@ -9,8 +9,8 @@ const minorNodeVersion = parseInt(nodeVersion[2]);
const patchNodeVersion = parseInt(nodeVersion[3]);
if (!process.env['VSCODE_SKIP_NODE_VERSION_CHECK']) {
if (majorNodeVersion < 20) {
console.error('\x1b[1;31m*** Please use latest Node.js v20 LTS for development.\x1b[0;0m');
if (majorNodeVersion < 20 || (majorNodeVersion === 20 && minorNodeVersion < 18)) {
console.error('\x1b[1;31m*** Please use Node.js v20.18.0 or later for development.\x1b[0;0m');
throw new Error();
}
}