Avoid recompiling remote native node modules (#112644)

* avoid recompiling remote native node modules

fixes #112320

* fix build

* update cache

* empty

* chore: remove rebuild step

* chore: update salt

* product compile should use same CC CXX

Co-authored-by: deepak1556 <hop2deep@gmail.com>
This commit is contained in:
João Moreno 2020-12-17 11:16:32 +01:00 committed by GitHub
parent 83c47f90d0
commit fd85ae4f4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 17 deletions

View file

@ -1 +1 @@
2020-12-15T15:34:44.634Z
2020-12-17T07:59:24.060Z

View file

@ -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

View file

@ -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

View file

@ -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
}