Skip to content

Commit 00039b0

Browse files
authored
refactor: linux pipeline to use containers only for yarn step (microsoft#188383)
* ci: use container only in yarn step * chore: invalidate cache * chore: install missing deps for packaging * chore: remove duplicate package installations * fix: oss build * chore: separate deb and rpm package preparation * chore: mount out folder when packaging * ci: switch to official docker image
1 parent b949114 commit 00039b0

File tree

7 files changed

+148
-116
lines changed

7 files changed

+148
-116
lines changed

build/.cachesalt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023-06-12T12:55:48.130Z
1+
2023-07-20T13:31:34.746Z
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
# To workaround the issue of yarn not respecting the registry value from .npmrc
6+
yarn config set registry "$NPM_REGISTRY"
7+
8+
if [ -z "$CC" ] || [ -z "$CXX" ]; then
9+
# Download clang based on chromium revision used by vscode
10+
curl -s https://raw.githubusercontent.com/chromium/chromium/108.0.5359.215/tools/clang/scripts/update.py | python - --output-dir=$PWD/.build/CR_Clang --host-os=linux
11+
12+
# Download libcxx headers and objects from upstream electron releases
13+
DEBUG=libcxx-fetcher \
14+
VSCODE_LIBCXX_OBJECTS_DIR=$PWD/.build/libcxx-objects \
15+
VSCODE_LIBCXX_HEADERS_DIR=$PWD/.build/libcxx_headers \
16+
VSCODE_LIBCXXABI_HEADERS_DIR=$PWD/.build/libcxxabi_headers \
17+
VSCODE_ARCH="$npm_config_arch" \
18+
node build/linux/libcxx-fetcher.js
19+
20+
# Set compiler toolchain
21+
# Flags for the client build are based on
22+
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/108.0.5359.215:build/config/arm.gni
23+
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/108.0.5359.215:build/config/compiler/BUILD.gn
24+
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/108.0.5359.215:build/config/c++/BUILD.gn
25+
export CC=$PWD/.build/CR_Clang/bin/clang
26+
export CXX=$PWD/.build/CR_Clang/bin/clang++
27+
export CXXFLAGS="-nostdinc++ -D__NO_INLINE__ -I$PWD/.build/libcxx_headers -isystem$PWD/.build/libcxx_headers/include -isystem$PWD/.build/libcxxabi_headers/include -fPIC -flto=thin -fsplit-lto-unit -D_LIBCPP_ABI_NAMESPACE=Cr"
28+
export LDFLAGS="-stdlib=libc++ -fuse-ld=lld -flto=thin -L$PWD/.build/libcxx-objects -lc++abi -Wl,--lto-O0"
29+
export VSCODE_REMOTE_CC=$(which gcc)
30+
export VSCODE_REMOTE_CXX=$(which g++)
31+
fi
32+
33+
for i in {1..5}; do # try 5 times
34+
yarn --frozen-lockfile --check-files && break
35+
if [ $i -eq 3 ]; then
36+
echo "Yarn failed too many times" >&2
37+
exit 1
38+
fi
39+
echo "Yarn failed $i, trying again..."
40+
done

build/azure-pipelines/linux/product-build-linux-test.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@ steps:
1414
GITHUB_TOKEN: "$(github-distro-mixin-password)"
1515
displayName: Download Electron and Playwright
1616

17-
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
18-
- script: |
19-
set -e
20-
sudo apt-get update
21-
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libkrb5-dev libxss1 dbus xvfb libgtk-3-0 libgbm1
22-
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
23-
sudo chmod +x /etc/init.d/xvfb
24-
sudo update-rc.d xvfb defaults
25-
sudo service xvfb start
26-
displayName: Setup build environment
27-
2817
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
2918
- script: |
3019
set -e

build/azure-pipelines/linux/product-build-linux.yml

Lines changed: 99 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,28 @@ steps:
4141
- script: tar -xzf $(Build.ArtifactStagingDirectory)/compilation.tar.gz
4242
displayName: Extract compilation output
4343

44-
- script: |
45-
set -e
46-
# Start X server
47-
/etc/init.d/xvfb start
48-
# Start dbus session
49-
DBUS_LAUNCH_RESULT=$(sudo dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address)
50-
echo "##vso[task.setvariable variable=DBUS_SESSION_BUS_ADDRESS]$DBUS_LAUNCH_RESULT"
51-
displayName: Setup system services
52-
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'))
44+
- script: |
45+
set -e
46+
# Start X server
47+
sudo apt-get update
48+
sudo apt-get install -y pkg-config \
49+
libxss1 \
50+
dbus \
51+
xvfb \
52+
libgtk-3-0 \
53+
libgbm1 \
54+
libxkbfile-dev \
55+
libsecret-1-dev \
56+
libkrb5-dev
57+
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
58+
sudo chmod +x /etc/init.d/xvfb
59+
sudo update-rc.d xvfb defaults
60+
sudo service xvfb start
61+
# Start dbus session
62+
sudo mkdir -p /var/run/dbus
63+
DBUS_LAUNCH_RESULT=$(sudo dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address)
64+
echo "##vso[task.setvariable variable=DBUS_SESSION_BUS_ADDRESS]$DBUS_LAUNCH_RESULT"
65+
displayName: Setup system services
5366
5467
- script: node build/setup-npm-registry.js $NPM_REGISTRY
5568
condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))
@@ -72,7 +85,10 @@ steps:
7285
- script: |
7386
set -e
7487
npm config set registry "$NPM_REGISTRY" --location=project
75-
npm config set always-auth=true --location=project
88+
# npm >v7 deprecated the `always-auth` config option, refs npm/cli@72a7eeb
89+
# following is a workaround for yarn to send authorization header
90+
# for GET requests to the registry.
91+
echo "always-auth=true" >> .npmrc
7692
yarn config set registry "$NPM_REGISTRY"
7793
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none'))
7894
displayName: Setup NPM & Yarn
@@ -83,17 +99,6 @@ steps:
8399
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none'))
84100
displayName: Setup NPM Authentication
85101

86-
# TODO@joaomoreno TODO@deepak1556 this should be part of the base image
87-
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
88-
- script: |
89-
sudo apt-get update && sudo apt-get install -y ca-certificates curl gnupg
90-
sudo mkdir -m 0755 -p /etc/apt/keyrings
91-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
92-
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
93-
sudo apt update && sudo apt install -y docker-ce-cli
94-
displayName: Install Docker client
95-
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
96-
97102
- ${{ if and(ne(parameters.VSCODE_QUALITY, 'oss'), or(eq(parameters.VSCODE_ARCH, 'x64'), eq(parameters.VSCODE_ARCH, 'arm64'))) }}:
98103
- task: Docker@1
99104
displayName: "Pull Docker image"
@@ -105,74 +110,65 @@ steps:
105110
containerCommand: uname
106111
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
107112

108-
- ${{ if and(ne(parameters.VSCODE_QUALITY, 'oss'), eq(parameters.VSCODE_ARCH, 'arm64')) }}:
109-
- script: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
110-
displayName: Register Docker QEMU
111-
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), eq(variables['VSCODE_ARCH'], 'arm64'))
112-
113-
- script: |
114-
sudo apt-get update && sudo apt-get install -y libkrb5-dev
115-
displayName: Install libkrb5-dev
116-
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
117-
118-
- script: |
119-
set -e
113+
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
114+
- script: |
115+
set -e
120116
121-
for i in {1..5}; do # try 5 times
122-
yarn --cwd build --frozen-lockfile --check-files && break
123-
if [ $i -eq 3 ]; then
124-
echo "Yarn failed too many times" >&2
125-
exit 1
126-
fi
127-
echo "Yarn failed $i, trying again..."
128-
done
129-
130-
if [ -z "$CC" ] || [ -z "$CXX" ]; then
131-
# Download clang based on chromium revision used by vscode
132-
curl -s https://raw.githubusercontent.com/chromium/chromium/108.0.5359.215/tools/clang/scripts/update.py | python - --output-dir=$PWD/.build/CR_Clang --host-os=linux
133-
# Download libcxx headers and objects from upstream electron releases
134-
DEBUG=libcxx-fetcher \
135-
VSCODE_LIBCXX_OBJECTS_DIR=$PWD/.build/libcxx-objects \
136-
VSCODE_LIBCXX_HEADERS_DIR=$PWD/.build/libcxx_headers \
137-
VSCODE_LIBCXXABI_HEADERS_DIR=$PWD/.build/libcxxabi_headers \
138-
VSCODE_ARCH="$(NPM_ARCH)" \
139-
node build/linux/libcxx-fetcher.js
140-
# Set compiler toolchain
141-
# Flags for the client build are based on
142-
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/108.0.5359.215:build/config/arm.gni
143-
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/108.0.5359.215:build/config/compiler/BUILD.gn
144-
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/108.0.5359.215:build/config/c++/BUILD.gn
145-
export CC=$PWD/.build/CR_Clang/bin/clang
146-
export CXX=$PWD/.build/CR_Clang/bin/clang++
147-
export CXXFLAGS="-nostdinc++ -D__NO_INLINE__ -I$PWD/.build/libcxx_headers -isystem$PWD/.build/libcxx_headers/include -isystem$PWD/.build/libcxxabi_headers/include -fPIC -flto=thin -fsplit-lto-unit -D_LIBCPP_ABI_NAMESPACE=Cr"
148-
export LDFLAGS="-stdlib=libc++ -fuse-ld=lld -flto=thin -L$PWD/.build/libcxx-objects -lc++abi -Wl,--lto-O0"
149-
export VSCODE_REMOTE_CC=$(which gcc)
150-
export VSCODE_REMOTE_CXX=$(which g++)
151-
fi
152-
153-
for i in {1..5}; do # try 5 times
154-
yarn --frozen-lockfile --check-files && break
155-
if [ $i -eq 3 ]; then
156-
echo "Yarn failed too many times" >&2
157-
exit 1
158-
fi
159-
echo "Yarn failed $i, trying again..."
160-
done
161-
env:
162-
npm_config_arch: $(NPM_ARCH)
163-
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
164-
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
165-
GITHUB_TOKEN: "$(github-distro-mixin-password)"
166-
${{ if and(ne(parameters.VSCODE_QUALITY, 'oss'), or(eq(parameters.VSCODE_ARCH, 'x64'), eq(parameters.VSCODE_ARCH, 'arm64'))) }}:
167-
VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME: vscodehub.azurecr.io/vscode-linux-build-agent:centos7-devtoolset8-$(VSCODE_ARCH)
168-
displayName: Install dependencies
169-
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
117+
for i in {1..5}; do # try 5 times
118+
yarn --cwd build --frozen-lockfile --check-files && break
119+
if [ $i -eq 3 ]; then
120+
echo "Yarn failed too many times" >&2
121+
exit 1
122+
fi
123+
echo "Yarn failed $i, trying again..."
124+
done
125+
126+
docker run -e GITHUB_TOKEN -e npm_config_arch -e NPM_REGISTRY \
127+
-e VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME -e VSCODE_HOST_MOUNT \
128+
-e ELECTRON_SKIP_BINARY_DOWNLOAD -e PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD \
129+
-v /mnt/vss/_work/1/s:/home/builduser/vscode -v /mnt/vss/_work/1/s/.build/.netrc:/home/builduser/.netrc \
130+
-v /var/run/docker.sock:/var/run/docker.sock \
131+
-u 1000:1000 \
132+
-w /home/builduser/vscode vscodehub.azurecr.io/vscode-linux-build-agent:bionic-$(VSCODE_ARCH) \
133+
/bin/bash -c "./build/azure-pipelines/linux/install.sh"
134+
135+
sudo chown -R $USER:$USER /mnt/vss/_work/1/s
136+
env:
137+
npm_config_arch: $(NPM_ARCH)
138+
NPM_REGISTRY: "$(NPM_REGISTRY)"
139+
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
140+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
141+
GITHUB_TOKEN: "$(github-distro-mixin-password)"
142+
VSCODE_HOST_MOUNT: "/mnt/vss/_work/1/s"
143+
${{ if or(eq(parameters.VSCODE_ARCH, 'x64'), eq(parameters.VSCODE_ARCH, 'arm64')) }}:
144+
VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME: vscodehub.azurecr.io/vscode-linux-build-agent:centos7-devtoolset8-$(VSCODE_ARCH)
145+
displayName: Install dependencies
146+
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
170147
171-
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
172148
- script: node build/azure-pipelines/distro/mixin-npm
173149
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
174150
displayName: Mixin distro node modules
175151

152+
- ${{ else }}:
153+
- script: |
154+
set -e
155+
156+
for i in {1..5}; do # try 5 times
157+
yarn --frozen-lockfile --check-files && break
158+
if [ $i -eq 3 ]; then
159+
echo "Yarn failed too many times" >&2
160+
exit 1
161+
fi
162+
echo "Yarn failed $i, trying again..."
163+
done
164+
env:
165+
npm_config_arch: $(NPM_ARCH)
166+
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
167+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
168+
GITHUB_TOKEN: "$(github-distro-mixin-password)"
169+
displayName: Install dependencies
170+
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
171+
176172
- script: |
177173
set -e
178174
node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt
@@ -253,12 +249,32 @@ steps:
253249
mv $(Build.ArtifactStagingDirectory)/cli/$APP_NAME $(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)/bin/$CLI_APP_NAME
254250
displayName: Make CLI executable
255251
252+
- script: |
253+
set -e
254+
docker run -v /mnt/vss/_work/1/s:/home/builduser/vscode \
255+
-v /mnt/vss/_work/1/s/.build/.netrc:/home/builduser/.netrc \
256+
-v /mnt/vss/_work/1/VSCode-linux-$(VSCODE_ARCH):/home/builduser/VSCode-linux-$(VSCODE_ARCH) \
257+
-u 1000:1000 \
258+
-w /home/builduser/vscode vscodehub.azurecr.io/vscode-linux-build-agent:bionic-$(VSCODE_ARCH) \
259+
yarn gulp "vscode-linux-$(VSCODE_ARCH)-prepare-deb"
260+
displayName: Prepare deb package
261+
256262
- script: |
257263
set -e
258264
yarn gulp "vscode-linux-$(VSCODE_ARCH)-build-deb"
259265
echo "##vso[task.setvariable variable=DEB_PATH]$(ls .build/linux/deb/*/deb/*.deb)"
260266
displayName: Build deb package
261267
268+
- script: |
269+
set -e
270+
docker run -v /mnt/vss/_work/1/s:/home/builduser/vscode \
271+
-v /mnt/vss/_work/1/s/.build/.netrc:/home/builduser/.netrc \
272+
-v /mnt/vss/_work/1/VSCode-linux-$(VSCODE_ARCH):/home/builduser/VSCode-linux-$(VSCODE_ARCH) \
273+
-u 1000:1000 \
274+
-w /home/builduser/vscode vscodehub.azurecr.io/vscode-linux-build-agent:bionic-$(VSCODE_ARCH) \
275+
yarn gulp "vscode-linux-$(VSCODE_ARCH)-prepare-rpm"
276+
displayName: Prepare rpm package
277+
262278
- script: |
263279
set -e
264280
yarn gulp "vscode-linux-$(VSCODE_ARCH)-build-rpm"

build/azure-pipelines/product-build.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,6 @@ name: "$(Date:yyyyMMdd).$(Rev:r) (${{ parameters.VSCODE_QUALITY }})"
143143

144144
resources:
145145
containers:
146-
- container: vscode-bionic-x64
147-
image: vscodehub.azurecr.io/vscode-linux-build-agent:bionic-x64
148-
endpoint: VSCodeHub
149-
options: --user 0:0 --cap-add SYS_ADMIN
150-
- container: vscode-arm64
151-
image: vscodehub.azurecr.io/vscode-linux-build-agent:bionic-arm64
152-
endpoint: VSCodeHub
153-
options: --user 0:0 --cap-add SYS_ADMIN
154-
- container: vscode-armhf
155-
image: vscodehub.azurecr.io/vscode-linux-build-agent:bionic-armhf
156-
endpoint: VSCodeHub
157-
options: --user 0:0 --cap-add SYS_ADMIN
158146
- container: snapcraft
159147
image: vscodehub.azurecr.io/vscode-linux-build-agent:snapcraft-x64
160148
endpoint: VSCodeHub
@@ -382,7 +370,6 @@ stages:
382370
- ${{ if eq(variables['VSCODE_CIBUILD'], true) }}:
383371
- job: Linuxx64UnitTest
384372
displayName: Unit Tests
385-
container: vscode-bionic-x64
386373
variables:
387374
VSCODE_ARCH: x64
388375
NPM_ARCH: x64
@@ -398,7 +385,6 @@ stages:
398385
VSCODE_RUN_SMOKE_TESTS: false
399386
- job: Linuxx64IntegrationTest
400387
displayName: Integration Tests
401-
container: vscode-bionic-x64
402388
variables:
403389
VSCODE_ARCH: x64
404390
NPM_ARCH: x64
@@ -414,7 +400,6 @@ stages:
414400
VSCODE_RUN_SMOKE_TESTS: false
415401
- job: Linuxx64SmokeTest
416402
displayName: Smoke Tests
417-
container: vscode-bionic-x64
418403
variables:
419404
VSCODE_ARCH: x64
420405
NPM_ARCH: x64
@@ -431,7 +416,6 @@ stages:
431416

432417
- ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_LINUX, true)) }}:
433418
- job: Linuxx64
434-
container: vscode-bionic-x64
435419
variables:
436420
VSCODE_ARCH: x64
437421
NPM_ARCH: x64
@@ -458,7 +442,6 @@ stages:
458442

459443
- ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true)) }}:
460444
- job: LinuxArmhf
461-
container: vscode-armhf
462445
variables:
463446
VSCODE_ARCH: armhf
464447
NPM_ARCH: arm
@@ -474,7 +457,6 @@ stages:
474457

475458
- ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_LINUX_ARM64, true)) }}:
476459
- job: LinuxArm64
477-
container: vscode-arm64
478460
variables:
479461
VSCODE_ARCH: arm64
480462
NPM_ARCH: arm64

build/gulpfile.vscode.linux.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,14 @@ const BUILD_TARGETS = [
297297
BUILD_TARGETS.forEach(({ arch }) => {
298298
const debArch = getDebPackageArch(arch);
299299
const prepareDebTask = task.define(`vscode-linux-${arch}-prepare-deb`, task.series(util.rimraf(`.build/linux/deb/${debArch}`), prepareDebPackage(arch)));
300-
const buildDebTask = task.define(`vscode-linux-${arch}-build-deb`, task.series(prepareDebTask, buildDebPackage(arch)));
300+
gulp.task(prepareDebTask);
301+
const buildDebTask = task.define(`vscode-linux-${arch}-build-deb`, buildDebPackage(arch));
301302
gulp.task(buildDebTask);
302303

303304
const rpmArch = getRpmPackageArch(arch);
304305
const prepareRpmTask = task.define(`vscode-linux-${arch}-prepare-rpm`, task.series(util.rimraf(`.build/linux/rpm/${rpmArch}`), prepareRpmPackage(arch)));
305-
const buildRpmTask = task.define(`vscode-linux-${arch}-build-rpm`, task.series(prepareRpmTask, buildRpmPackage(arch)));
306+
gulp.task(prepareRpmTask);
307+
const buildRpmTask = task.define(`vscode-linux-${arch}-build-rpm`, buildRpmPackage(arch));
306308
gulp.task(buildRpmTask);
307309

308310
const prepareSnapTask = task.define(`vscode-linux-${arch}-prepare-snap`, task.series(util.rimraf(`.build/linux/snap/${arch}`), prepareSnapPackage(arch)));

build/npm/postinstall.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ function yarnInstall(dir, opts) {
5353
console.log(`Installing dependencies in ${dir} inside container ${process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME']}...`);
5454

5555
opts.cwd = root;
56-
run('docker', ['run', '-e', 'GITHUB_TOKEN', '-e', 'npm_config_arch', '-v', `/mnt/vss/_work/1/s:/root/vscode`, '-v', `/mnt/vss/_work/1/s/.build/.netrc:/root/.netrc`, process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'yarn', '--cwd', dir, ...args], opts);
56+
if (process.env['npm_config_arch'] === 'arm64') {
57+
run('sudo', ['docker', 'run', '--rm', '--privileged', 'multiarch/qemu-user-static', '--reset', '-p', 'yes'], opts);
58+
}
59+
run('sudo', ['docker', 'run', '-e', 'GITHUB_TOKEN', '-e', 'npm_config_arch', '-v', `${process.env['VSCODE_HOST_MOUNT']}:/root/vscode`, '-v', `${process.env['VSCODE_HOST_MOUNT']}/.build/.netrc:/root/.netrc`, process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'yarn', '--cwd', dir, ...args], opts);
5760
run('sudo', ['chown', '-R', `${userinfo.uid}:${userinfo.gid}`, `${dir}/node_modules`], opts);
5861
} else {
5962
console.log(`Installing dependencies in ${dir}...`);

0 commit comments

Comments
 (0)