diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js index e99a1a1a306..b72e1e44008 100644 --- a/build/gulpfile.reh.js +++ b/build/gulpfile.reh.js @@ -39,7 +39,7 @@ const REMOTE_FOLDER = path.join(REPO_ROOT, 'remote'); const BUILD_TARGETS = [ { platform: 'win32', arch: 'ia32' }, { platform: 'win32', arch: 'x64' }, - { platform: 'darwin', arch: null }, + { platform: 'darwin', arch: null }, // TODO@server-darwin-arm64: See also postinstall.js which hard-codes remote to x64 { platform: 'linux', arch: 'ia32' }, { platform: 'linux', arch: 'x64' }, { platform: 'linux', arch: 'armhf' }, diff --git a/build/npm/postinstall.js b/build/npm/postinstall.js index 2433da29e86..250190a4585 100644 --- a/build/npm/postinstall.js +++ b/build/npm/postinstall.js @@ -64,6 +64,12 @@ for (let dir of dirs) { if (process.env['CXXFLAGS']) { delete env['CXXFLAGS']; } if (process.env['LDFLAGS']) { delete env['LDFLAGS']; } if (process.env['VSCODE_REMOTE_NODE_GYP']) { env['npm_config_node_gyp'] = process.env['VSCODE_REMOTE_NODE_GYP']; } + + // TODO@server-darwin-arm64: Remove this check when support for arm64 for the server is added on darwin + if (/^remote/.test(dir) && process.platform === 'darwin' && (process.arch === 'arm64' || process.env['npm_config_arch'] === 'arm64')) { + // darwin arm: force `x64` on remote folder + env['npm_config_arch'] = 'x64'; + } opts = { env }; } else if (/^extensions\//.test(dir)) { opts = { ignoreEngines: true };