diff --git a/build/azure-pipelines/linux/steps/product-build-linux-compile.yml b/build/azure-pipelines/linux/steps/product-build-linux-compile.yml index 89199ebbbb14c..5e92487f4035b 100644 --- a/build/azure-pipelines/linux/steps/product-build-linux-compile.yml +++ b/build/azure-pipelines/linux/steps/product-build-linux-compile.yml @@ -311,7 +311,7 @@ steps: echo "##vso[task.setvariable variable=RPM_PACKAGE_NAME]$(basename $(ls .build/linux/rpm/*.rpm))" displayName: Build rpm package - - ${{ if eq(parameters.VSCODE_ARCH, 'x64') }}: + - ${{ if or(eq(parameters.VSCODE_ARCH, 'x64'), eq(parameters.VSCODE_ARCH, 'arm64')) }}: - task: Docker@1 inputs: azureSubscriptionEndpoint: vscode @@ -323,7 +323,7 @@ steps: - script: | set -e npm run gulp "vscode-linux-$(VSCODE_ARCH)-prepare-snap" - sudo -E docker run -e VSCODE_ARCH -e VSCODE_QUALITY -v $(pwd):/work -w /work vscodehub.azurecr.io/vscode-linux-build-agent:snapcraft-x64 /bin/bash -c "./build/azure-pipelines/linux/build-snap.sh" + sudo -E docker run -e VSCODE_ARCH -e VSCODE_QUALITY -v $(pwd):/work -w /work vscodehub.azurecr.io/vscode-linux-build-agent:snapcraft-$(VSCODE_ARCH) /bin/bash -c "./build/azure-pipelines/linux/build-snap.sh" SNAP_ROOT="$(pwd)/.build/linux/snap/$(VSCODE_ARCH)" SNAP_EXTRACTED_PATH=$(find $SNAP_ROOT -maxdepth 1 -type d -name 'code-*') diff --git a/build/azure-pipelines/product-build.yml b/build/azure-pipelines/product-build.yml index 77c3dd0665f9e..2c77f042a01ef 100644 --- a/build/azure-pipelines/product-build.yml +++ b/build/azure-pipelines/product-build.yml @@ -401,6 +401,7 @@ extends: VSCODE_ARCH: arm64 VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + VSCODE_BUILD_LINUX_SNAP: ${{ parameters.VSCODE_BUILD_LINUX_SNAP }} - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_COMPILE_ONLY, false), eq(variables['VSCODE_BUILD_STAGE_ALPINE'], true)) }}: - stage: Alpine diff --git a/build/gulpfile.vscode.linux.ts b/build/gulpfile.vscode.linux.ts index c5d216319ce07..440a60877c9e1 100644 --- a/build/gulpfile.vscode.linux.ts +++ b/build/gulpfile.vscode.linux.ts @@ -262,8 +262,10 @@ function prepareSnapPackage(arch: string) { const snapcraft = gulp.src('resources/linux/snap/snapcraft.yaml', { base: '.' }) .pipe(replace('@@NAME@@', product.applicationName)) .pipe(replace('@@VERSION@@', commit!.substr(0, 8))) - // Possible run-on values https://snapcraft.io/docs/architectures + // Possible run-on/build-on values https://snapcraft.io/docs/architectures .pipe(replace('@@ARCHITECTURE@@', arch === 'x64' ? 'amd64' : arch)) + .pipe(replace('@@BUILD_ARCHITECTURE@@', arch === 'x64' ? 'amd64' : arch)) + .pipe(replace('@@DEB_ARCHITECTURE@@', arch === 'x64' ? 'x86_64' : 'aarch64')) .pipe(rename('snap/snapcraft.yaml')); const electronLaunch = gulp.src('resources/linux/snap/electron-launch', { base: '.' }) diff --git a/resources/linux/snap/snapcraft.yaml b/resources/linux/snap/snapcraft.yaml index 6f4962af70ac9..604baffb92933 100644 --- a/resources/linux/snap/snapcraft.yaml +++ b/resources/linux/snap/snapcraft.yaml @@ -7,12 +7,12 @@ description: | edit-build-debug cycle. architectures: - - build-on: amd64 + - build-on: @@BUILD_ARCHITECTURE@@ run-on: @@ARCHITECTURE@@ grade: stable confinement: classic -base: core20 +base: core24 compression: lzo parts: @@ -27,9 +27,7 @@ parts: - libatspi2.0-0 - libcairo2 - libcanberra-gtk3-module - - libcurl3-gnutls - - libcurl3-nss - - libcurl4 + - libcurl4t64 - libegl1 - libdrm2 - libgbm1 @@ -59,18 +57,18 @@ parts: - -usr/share/lintian - -usr/share/man override-build: | - snapcraftctl build - patchelf --force-rpath --set-rpath '$ORIGIN/../../lib/x86_64-linux-gnu:$ORIGIN:/snap/core20/current/lib/x86_64-linux-gnu' $SNAPCRAFT_PART_INSTALL/usr/share/@@NAME@@/chrome_crashpad_handler + craftctl default + patchelf --force-rpath --set-rpath '$ORIGIN/../../lib/@@DEB_ARCHITECTURE@@-linux-gnu:$ORIGIN:/snap/core24/current/lib/@@DEB_ARCHITECTURE@@-linux-gnu' $SNAPCRAFT_PART_INSTALL/usr/share/@@NAME@@/chrome_crashpad_handler chmod 0755 $SNAPCRAFT_PART_INSTALL/usr/share/@@NAME@@/chrome-sandbox cleanup: after: - code plugin: nil build-snaps: - - core20 + - core24 override-prime: | set -eux - for snap in "core20"; do + for snap in "core24"; do cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" \; done patchelf --print-rpath $SNAPCRAFT_PRIME/usr/share/@@NAME@@/chrome_crashpad_handler