Skip to content

Commit e75b1a6

Browse files
committed
Merge branch 'joao/linux-arm'
2 parents 13aca0a + 8684731 commit e75b1a6

11 files changed

Lines changed: 247 additions & 88 deletions

File tree

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

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,25 @@ steps:
5252
git merge $(node -p "require('./package.json').distro")
5353
displayName: Merge distro
5454

55+
- script: |
56+
echo -n $VSCODE_ARCH > .build/arch
57+
displayName: Prepare arch cache flag
58+
5559
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
5660
inputs:
57-
keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
61+
keyfile: '.build/arch, build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
5862
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
5963
vstsFeed: 'npm-vscode'
6064

6165
- script: |
6266
set -e
63-
CHILD_CONCURRENCY=1 yarn --frozen-lockfile
67+
CHILD_CONCURRENCY=1 npm_config_arch=$(NPM_ARCH) yarn --frozen-lockfile
6468
displayName: Install dependencies
6569
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
6670

6771
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
6872
inputs:
69-
keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
73+
keyfile: '.build/arch, build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
7074
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
7175
vstsFeed: 'npm-vscode'
7276
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
@@ -85,64 +89,64 @@ steps:
8589
- script: |
8690
set -e
8791
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
88-
yarn gulp vscode-linux-x64-min-ci
92+
yarn gulp vscode-linux-$(VSCODE_ARCH)-min-ci
8993
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
90-
yarn gulp vscode-reh-linux-x64-min-ci
94+
yarn gulp vscode-reh-linux-$(VSCODE_ARCH)-min-ci
9195
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
92-
yarn gulp vscode-reh-web-linux-x64-min-ci
96+
yarn gulp vscode-reh-web-linux-$(VSCODE_ARCH)-min-ci
9397
displayName: Build
9498

9599
- script: |
96100
set -e
97101
service xvfb start
98102
displayName: Start xvfb
99-
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
103+
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
100104

101105
- script: |
102106
set -e
103107
DISPLAY=:10 ./scripts/test.sh --build --tfs "Unit Tests"
104108
displayName: Run unit tests (Electron)
105-
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
109+
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
106110

107111
- script: |
108112
set -e
109113
DISPLAY=:10 yarn test-browser --build --browser chromium --tfs "Browser Unit Tests"
110114
displayName: Run unit tests (Browser)
111-
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
115+
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
112116

113117
- script: |
114118
# Figure out the full absolute path of the product we just built
115119
# including the remote server and configure the integration tests
116120
# to run with these builds instead of running out of sources.
117121
set -e
118-
APP_ROOT=$(agent.builddirectory)/VSCode-linux-x64
122+
APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
119123
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
120124
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
121-
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-x64" \
125+
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-$(VSCODE_ARCH)" \
122126
DISPLAY=:10 ./scripts/test-integration.sh --build --tfs "Integration Tests"
123127
displayName: Run integration tests (Electron)
124-
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
128+
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
125129

126130
- script: |
127131
set -e
128-
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-linux-x64" \
132+
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-linux-$(VSCODE_ARCH)" \
129133
DISPLAY=:10 ./resources/server/test/test-web-integration.sh --browser chromium
130134
displayName: Run integration tests (Browser)
131-
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
135+
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
132136

133137
- script: |
134138
set -e
135-
APP_ROOT=$(agent.builddirectory)/VSCode-linux-x64
139+
APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
136140
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
137141
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
138-
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-x64" \
142+
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-$(VSCODE_ARCH)" \
139143
DISPLAY=:10 ./resources/server/test/test-remote-integration.sh
140144
displayName: Run remote integration tests (Electron)
141-
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
145+
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
142146

143147
- task: PublishPipelineArtifact@0
144148
inputs:
145-
artifactName: crash-dump-linux
149+
artifactName: 'crash-dump-linux-$(VSCODE_ARCH)'
146150
targetPath: .build/crashes
147151
displayName: 'Publish Crash Reports'
148152
continueOnError: true
@@ -157,15 +161,26 @@ steps:
157161

158162
- script: |
159163
set -e
160-
yarn gulp "vscode-linux-x64-build-deb"
161-
yarn gulp "vscode-linux-x64-build-rpm"
162-
yarn gulp "vscode-linux-x64-prepare-snap"
163-
displayName: Build packages
164+
yarn gulp "vscode-linux-$(VSCODE_ARCH)-build-deb"
165+
yarn gulp "vscode-linux-$(VSCODE_ARCH)-build-rpm"
166+
displayName: Build deb, rpm packages
167+
168+
- script: |
169+
set -e
170+
yarn gulp "vscode-linux-$(VSCODE_ARCH)-prepare-snap"
171+
displayName: Prepare snap package
172+
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'))
173+
174+
# needed for code signing
175+
- task: UseDotNet@2
176+
displayName: 'Install .NET Core SDK 2.x'
177+
inputs:
178+
version: 2.x
164179

165180
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
166181
inputs:
167182
ConnectedServiceName: 'ESRP CodeSign'
168-
FolderPath: '.build/linux/rpm/x86_64'
183+
FolderPath: '.build/linux/rpm'
169184
Pattern: '*.rpm'
170185
signConfigType: inlineSignParams
171186
inlineOperation: |
@@ -186,14 +201,16 @@ steps:
186201
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
187202
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
188203
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
204+
VSCODE_ARCH="$(VSCODE_ARCH)" \
189205
./build/azure-pipelines/linux/publish.sh
190206
displayName: Publish
191207

192208
- task: PublishPipelineArtifact@0
193209
displayName: 'Publish Pipeline Artifact'
194210
inputs:
195-
artifactName: snap-x64
211+
artifactName: 'snap-$(VSCODE_ARCH)'
196212
targetPath: .build/linux/snap-tarball
213+
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'))
197214

198215
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
199216
displayName: 'Component Detection'

build/azure-pipelines/linux/publish.sh

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ REPO="$(pwd)"
44
ROOT="$REPO/.."
55

66
# Publish tarball
7-
PLATFORM_LINUX="linux-x64"
7+
PLATFORM_LINUX="linux-$VSCODE_ARCH"
88
BUILDNAME="VSCode-$PLATFORM_LINUX"
9-
BUILD="$ROOT/$BUILDNAME"
109
BUILD_VERSION="$(date +%s)"
11-
[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$BUILD_VERSION.tar.gz"
10+
[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$VSCODE_ARCH-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$VSCODE_ARCH-$BUILD_VERSION.tar.gz"
1211
TARBALL_PATH="$ROOT/$TARBALL_FILENAME"
1312

1413
rm -rf $ROOT/code-*.tar.*
@@ -28,24 +27,36 @@ rm -rf $ROOT/vscode-server-*.tar.*
2827
node build/azure-pipelines/common/createAsset.js "server-$PLATFORM_LINUX" archive-unsigned "$SERVER_TARBALL_FILENAME" "$SERVER_TARBALL_PATH"
2928

3029
# Publish DEB
31-
PLATFORM_DEB="linux-deb-x64"
32-
DEB_ARCH="amd64"
30+
case $VSCODE_ARCH in
31+
x64) DEB_ARCH="amd64" ;;
32+
*) DEB_ARCH="$VSCODE_ARCH" ;;
33+
esac
34+
35+
PLATFORM_DEB="linux-deb-$VSCODE_ARCH"
3336
DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)"
3437
DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME"
3538

3639
node build/azure-pipelines/common/createAsset.js "$PLATFORM_DEB" package "$DEB_FILENAME" "$DEB_PATH"
3740

3841
# Publish RPM
39-
PLATFORM_RPM="linux-rpm-x64"
40-
RPM_ARCH="x86_64"
42+
case $VSCODE_ARCH in
43+
x64) RPM_ARCH="x86_64" ;;
44+
armhf) RPM_ARCH="armv7hl" ;;
45+
arm64) RPM_ARCH="aarch64" ;;
46+
*) RPM_ARCH="$VSCODE_ARCH" ;;
47+
esac
48+
49+
PLATFORM_RPM="linux-rpm-$VSCODE_ARCH"
4150
RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)"
4251
RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME"
4352

4453
node build/azure-pipelines/common/createAsset.js "$PLATFORM_RPM" package "$RPM_FILENAME" "$RPM_PATH"
4554

46-
# Publish Snap
47-
# Pack snap tarball artifact, in order to preserve file perms
48-
mkdir -p $REPO/.build/linux/snap-tarball
49-
SNAP_TARBALL_PATH="$REPO/.build/linux/snap-tarball/snap-x64.tar.gz"
50-
rm -rf $SNAP_TARBALL_PATH
51-
(cd .build/linux && tar -czf $SNAP_TARBALL_PATH snap)
55+
if [ "$VSCODE_ARCH" == "x64" ]; then
56+
# Publish Snap
57+
# Pack snap tarball artifact, in order to preserve file perms
58+
mkdir -p $REPO/.build/linux/snap-tarball
59+
SNAP_TARBALL_PATH="$REPO/.build/linux/snap-tarball/snap-$VSCODE_ARCH.tar.gz"
60+
rm -rf $SNAP_TARBALL_PATH
61+
(cd .build/linux && tar -czf $SNAP_TARBALL_PATH snap)
62+
fi

build/azure-pipelines/product-build.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ resources:
1313
- container: vscode-x64
1414
image: vscodehub.azurecr.io/vscode-linux-build-agent:x64
1515
endpoint: VSCodeHub
16+
- container: vscode-arm64
17+
image: vscodehub.azurecr.io/vscode-linux-build-agent:buster-arm64
18+
endpoint: VSCodeHub
19+
- container: vscode-armhf
20+
image: vscodehub.azurecr.io/vscode-linux-build-agent:buster-armhf
21+
endpoint: VSCodeHub
1622
- container: snapcraft
1723
image: snapcore/snapcraft:stable
1824

@@ -64,6 +70,9 @@ stages:
6470
- job: Linux
6571
condition: and(succeeded(), eq(variables['VSCODE_BUILD_LINUX'], 'true'))
6672
container: vscode-x64
73+
variables:
74+
VSCODE_ARCH: x64
75+
NPM_ARCH: x64
6776
steps:
6877
- template: linux/product-build-linux.yml
6978

@@ -72,22 +81,28 @@ stages:
7281
- Linux
7382
condition: and(succeeded(), eq(variables['VSCODE_BUILD_LINUX'], 'true'))
7483
container: snapcraft
84+
variables:
85+
VSCODE_ARCH: x64
7586
steps:
7687
- template: linux/snap-build-linux.yml
7788

7889
- job: LinuxArmhf
7990
condition: and(succeeded(), eq(variables['VSCODE_BUILD_LINUX_ARMHF'], 'true'))
91+
container: vscode-armhf
8092
variables:
8193
VSCODE_ARCH: armhf
94+
NPM_ARCH: armv7l
8295
steps:
83-
- template: linux/product-build-linux-multiarch.yml
96+
- template: linux/product-build-linux.yml
8497

8598
- job: LinuxArm64
8699
condition: and(succeeded(), eq(variables['VSCODE_BUILD_LINUX_ARM64'], 'true'))
100+
container: vscode-arm64
87101
variables:
88102
VSCODE_ARCH: arm64
103+
NPM_ARCH: arm64
89104
steps:
90-
- template: linux/product-build-linux-multiarch.yml
105+
- template: linux/product-build-linux.yml
91106

92107
- job: LinuxAlpine
93108
condition: and(succeeded(), eq(variables['VSCODE_BUILD_LINUX_ALPINE'], 'true'))

build/azure-pipelines/product-compile.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,13 @@ steps:
5252
displayName: Merge distro
5353
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'))
5454

55+
- script: |
56+
echo -n $VSCODE_ARCH > .build/arch
57+
displayName: Prepare arch cache flag
58+
5559
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
5660
inputs:
57-
keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
61+
keyfile: '.build/arch, build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
5862
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
5963
vstsFeed: 'npm-vscode'
6064
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'))
@@ -67,7 +71,7 @@ steps:
6771

6872
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
6973
inputs:
70-
keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
74+
keyfile: '.build/arch, build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
7175
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
7276
vstsFeed: 'npm-vscode'
7377
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'), ne(variables['CacheRestored'], 'true'))

build/gulpfile.reh.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,11 @@ const BUILD_TARGETS = [
3737

3838
const noop = () => { return Promise.resolve(); };
3939

40-
gulp.task('vscode-reh-win32-ia32-min', noop);
41-
gulp.task('vscode-reh-win32-x64-min', noop);
42-
gulp.task('vscode-reh-darwin-min', noop);
43-
gulp.task('vscode-reh-linux-x64-min', noop);
44-
gulp.task('vscode-reh-linux-armhf-min', noop);
45-
gulp.task('vscode-reh-linux-arm64-min', noop);
46-
gulp.task('vscode-reh-linux-alpine-min', noop);
47-
48-
gulp.task('vscode-reh-web-win32-ia32-min', noop);
49-
gulp.task('vscode-reh-web-win32-x64-min', noop);
50-
gulp.task('vscode-reh-web-darwin-min', noop);
51-
gulp.task('vscode-reh-web-linux-x64-min', noop);
52-
gulp.task('vscode-reh-web-linux-alpine-min', noop);
40+
BUILD_TARGETS.forEach(({ platform, arch }) => {
41+
for (const target of ['reh', 'reh-web']) {
42+
gulp.task(`vscode-${target}-${platform}${ arch ? `-${arch}` : '' }-min`, noop);
43+
}
44+
});
5345

5446
function getNodeVersion() {
5547
const yarnrc = fs.readFileSync(path.join(REPO_ROOT, 'remote', '.yarnrc'), 'utf8');

build/gulpfile.vscode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
263263
let result = all
264264
.pipe(util.skipDirectories())
265265
.pipe(util.fixWin32DirectoryPermissions())
266-
.pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
266+
.pipe(electron(_.extend({}, config, { platform, arch: arch === 'armhf' ? 'arm' : arch, ffmpegChromium: true })))
267267
.pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version'], { dot: true }));
268268

269269
if (platform === 'linux') {
@@ -324,7 +324,7 @@ const BUILD_TARGETS = [
324324
{ platform: 'darwin', arch: null, opts: { stats: true } },
325325
{ platform: 'linux', arch: 'ia32' },
326326
{ platform: 'linux', arch: 'x64' },
327-
{ platform: 'linux', arch: 'arm' },
327+
{ platform: 'linux', arch: 'armhf' },
328328
{ platform: 'linux', arch: 'arm64' },
329329
];
330330
BUILD_TARGETS.forEach(buildTarget => {

0 commit comments

Comments
 (0)