Files
vscode/build/azure-pipelines/alpine/cli-build-alpine.yml
Connor Peet 52840e3ca5 cli: cleanup build (#190213)
- Remove the `prepare` script entirely
- Variables are now populated from the product.json during build. Most
  variables are mapped automatically, with some special handling in a
	few cases. `build.rs` is now much more self-contained.
- Look for the `product.overrides.json` for vscode developers instead of
  looking for a peer `vscode-distro` folder

Fixes #178691
2023-08-10 20:14:30 -07:00

89 lines
3.2 KiB
YAML

parameters:
- name: VSCODE_BUILD_ALPINE
type: boolean
default: false
- name: VSCODE_BUILD_ALPINE_ARM64
type: boolean
default: false
- name: VSCODE_QUALITY
type: string
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.x"
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
# Install yarn as the ARM64 build agent is using vanilla Ubuntu
- ${{ if eq(parameters.VSCODE_BUILD_ALPINE_ARM64, true) }}:
- task: Npm@1
displayName: Install yarn
inputs:
command: custom
customCommand: install --global yarn
- script: |
set -e
yarn --frozen-lockfile --ignore-optional
workingDirectory: build
displayName: Install pipeline build
- template: ../cli/cli-apply-patches.yml
- task: Npm@1
displayName: Download openssl prebuilt
inputs:
command: custom
customCommand: pack @vscode-internal/openssl-prebuilt@0.0.8
customRegistry: useFeed
customFeed: "Monaco/openssl-prebuilt"
workingDir: $(Build.ArtifactStagingDirectory)
- script: |
set -e
mkdir $(Build.ArtifactStagingDirectory)/openssl
tar -xvzf $(Build.ArtifactStagingDirectory)/vscode-internal-openssl-prebuilt-0.0.8.tgz --strip-components=1 --directory=$(Build.ArtifactStagingDirectory)/openssl
displayName: Extract openssl prebuilt
# inspired by: https://github.com/emk/rust-musl-builder/blob/main/Dockerfile
- bash: |
set -e
sudo apt-get update
sudo apt-get install -yq build-essential musl-dev musl-tools linux-libc-dev pkgconf xutils-dev lld
sudo ln -s "/usr/bin/g++" "/usr/bin/musl-g++" || echo "link exists"
displayName: Install musl build dependencies
- template: ../cli/install-rust-posix.yml
parameters:
targets:
- ${{ if eq(parameters.VSCODE_BUILD_ALPINE_ARM64, true) }}:
- aarch64-unknown-linux-musl
- ${{ if eq(parameters.VSCODE_BUILD_ALPINE, true) }}:
- x86_64-unknown-linux-musl
- ${{ if eq(parameters.VSCODE_BUILD_ALPINE_ARM64, true) }}:
- template: ../cli/cli-compile-and-publish.yml
parameters:
VSCODE_CLI_TARGET: aarch64-unknown-linux-musl
VSCODE_CLI_ARTIFACT: vscode_cli_alpine_arm64_cli
VSCODE_QUALITY: ${{ parameters.VSCODE_QUALITY }}
VSCODE_CLI_ENV:
CXX_aarch64-unknown-linux-musl: musl-g++
CC_aarch64-unknown-linux-musl: musl-gcc
OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/openssl/arm64-linux-musl/lib
OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/openssl/arm64-linux-musl/include
OPENSSL_STATIC: "1"
- ${{ if eq(parameters.VSCODE_BUILD_ALPINE, true) }}:
- template: ../cli/cli-compile-and-publish.yml
parameters:
VSCODE_CLI_TARGET: x86_64-unknown-linux-musl
VSCODE_CLI_ARTIFACT: vscode_cli_alpine_x64_cli
VSCODE_QUALITY: ${{ parameters.VSCODE_QUALITY }}
VSCODE_CLI_ENV:
CXX_aarch64-unknown-linux-musl: musl-g++
CC_aarch64-unknown-linux-musl: musl-gcc
OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/openssl/x64-linux-musl/lib
OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/openssl/x64-linux-musl/include
OPENSSL_STATIC: "1"