diff --git a/build/.cachesalt b/build/.cachesalt index 2d4b0cf2154..cf053dd3b9b 100644 --- a/build/.cachesalt +++ b/build/.cachesalt @@ -1 +1 @@ -2020-12-15T15:34:44.634Z +2020-12-17T07:59:24.060Z diff --git a/build/azure-pipelines/linux/product-build-linux.yml b/build/azure-pipelines/linux/product-build-linux.yml index 5b258aec975..f5f1cd2d384 100644 --- a/build/azure-pipelines/linux/product-build-linux.yml +++ b/build/azure-pipelines/linux/product-build-linux.yml @@ -76,12 +76,19 @@ steps: - script: | set -e - if [ -z "$CC" ] || [ -z "$CXX" ] - then + export npm_config_arch=$(NPM_ARCH) + + if [ -z "$CC" ] || [ -z "$CXX" ]; then export CC=$(which gcc-5) export CXX=$(which g++-5) fi - export npm_config_arch=$(NPM_ARCH) + + if [ "$VSCODE_ARCH" == "x64" ]; then + export VSCODE_REMOTE_CC=$(which gcc-4.8) + export VSCODE_REMOTE_CXX=$(which g++-4.8) + export VSCODE_REMOTE_NODE_GYP=$(which node-gyp) + fi + for i in {1..3}; do # try 3 times, for Terrapin yarn --frozen-lockfile && break if [ $i -eq 3 ]; then @@ -103,16 +110,6 @@ steps: vstsFeed: "npm-vscode" condition: and(succeeded(), ne(variables['CacheRestored'], 'true')) - - script: | - set -e - export CC=$(which gcc-4.8) - export CXX=$(which g++-4.8) - export npm_config_node_gyp=$(which node-gyp) - cd remote && rm -rf node_modules/ - yarn - displayName: Rebuild remote modules with gcc-4.8 - condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64')) - - script: | set -e node build/azure-pipelines/mixin diff --git a/build/azure-pipelines/product-compile.yml b/build/azure-pipelines/product-compile.yml index f72cf0151b0..5ef2bfd6ba4 100644 --- a/build/azure-pipelines/product-compile.yml +++ b/build/azure-pipelines/product-compile.yml @@ -70,11 +70,19 @@ steps: - script: | set -e - if [ -z "$CC" ] || [ -z "$CXX" ] - then + export npm_config_arch=$(NPM_ARCH) + + if [ -z "$CC" ] || [ -z "$CXX" ]; then export CC=$(which gcc-5) export CXX=$(which g++-5) fi + + if [ "$VSCODE_ARCH" == "x64" ]; then + export VSCODE_REMOTE_CC=$(which gcc-4.8) + export VSCODE_REMOTE_CXX=$(which g++-4.8) + export VSCODE_REMOTE_NODE_GYP=$(which node-gyp) + fi + for i in {1..3}; do # try 3 times, for Terrapin yarn --frozen-lockfile && break if [ $i -eq 3 ]; then diff --git a/build/npm/postinstall.js b/build/npm/postinstall.js index 8f8b0019a77..88d10e2f2ff 100644 --- a/build/npm/postinstall.js +++ b/build/npm/postinstall.js @@ -34,7 +34,14 @@ function yarnInstall(location, opts) { yarnInstall('extensions'); // node modules shared by all extensions if (!(process.platform === 'win32' && (process.arch === 'arm64' || process.env['npm_config_arch'] === 'arm64'))) { - yarnInstall('remote'); // node modules used by vscode server + const env = { ...process.env }; + if (process.env['VSCODE_REMOTE_CC']) { env['CC'] = process.env['VSCODE_REMOTE_CC']; } + if (process.env['VSCODE_REMOTE_CXX']) { env['CXX'] = process.env['VSCODE_REMOTE_CXX']; } + if (process.env['VSCODE_REMOTE_NODE_GYP']) { env['npm_config_node_gyp'] = process.env['VSCODE_REMOTE_NODE_GYP']; } + + console.log('remote yarn install env', JSON.stringify(env, undefined, ' ')); + + yarnInstall('remote', { env }); // node modules used by vscode server yarnInstall('remote/web'); // node modules used by vscode web }