@@ -41,15 +41,28 @@ steps:
41
41
- script : tar -xzf $(Build.ArtifactStagingDirectory)/compilation.tar.gz
42
42
displayName : Extract compilation output
43
43
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
53
66
54
67
- script : node build/setup-npm-registry.js $NPM_REGISTRY
55
68
condition : and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))
@@ -72,7 +85,10 @@ steps:
72
85
- script : |
73
86
set -e
74
87
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
76
92
yarn config set registry "$NPM_REGISTRY"
77
93
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none'))
78
94
displayName: Setup NPM & Yarn
@@ -83,17 +99,6 @@ steps:
83
99
condition : and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none'))
84
100
displayName : Setup NPM Authentication
85
101
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
-
97
102
- ${{ if and(ne(parameters.VSCODE_QUALITY, 'oss'), or(eq(parameters.VSCODE_ARCH, 'x64'), eq(parameters.VSCODE_ARCH, 'arm64'))) }} :
98
103
- task : Docker@1
99
104
displayName : " Pull Docker image"
@@ -105,74 +110,65 @@ steps:
105
110
containerCommand : uname
106
111
condition : and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
107
112
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
120
116
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'))
170
147
171
- - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }} :
172
148
- script : node build/azure-pipelines/distro/mixin-npm
173
149
condition : and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
174
150
displayName : Mixin distro node modules
175
151
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
+
176
172
- script : |
177
173
set -e
178
174
node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt
@@ -253,12 +249,32 @@ steps:
253
249
mv $(Build.ArtifactStagingDirectory)/cli/$APP_NAME $(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)/bin/$CLI_APP_NAME
254
250
displayName: Make CLI executable
255
251
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
+
256
262
- script : |
257
263
set -e
258
264
yarn gulp "vscode-linux-$(VSCODE_ARCH)-build-deb"
259
265
echo "##vso[task.setvariable variable=DEB_PATH]$(ls .build/linux/deb/*/deb/*.deb)"
260
266
displayName: Build deb package
261
267
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
+
262
278
- script : |
263
279
set -e
264
280
yarn gulp "vscode-linux-$(VSCODE_ARCH)-build-rpm"
0 commit comments