tectonic/dist/azure-build-and-test-vcpkg.yml

76 lines
2.6 KiB
YAML

# Copyright 2016-2020 the Tectonic Project
# Licensed under the MIT License.
#
# Azure Pipelines template for a standard build-and-test job getting
# dependencies through vcpkg. Besides the parameters, the following variables
# are expected:
#
# - TARGET: the build target triple (e.g. "x86_86-unknown-linux-gnu")
# - TOOLCHAIN: the rust toolchain type (e.g., "stable",
# "beta-x86_64-pc-windows-msvc")
parameters:
- name: canaryBuild
type: boolean
default: false
- name: testIt
type: boolean
default: true
steps:
- template: azure-generic-build-setup.yml
- bash: rustup target add $TARGET
displayName: Add target $(TARGET)
- bash: |
set -xeuo pipefail
brew install autoconf-archive automake libtool pkg-config
displayName: "Install vcpkg dependencies (macOS)"
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
- bash: |
set -xeuo pipefail
sudo apt-get update
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y \
autoconf-archive
displayName: "Install vcpkg dependencies (Ubuntu)"
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- bash: |
set -xeuo pipefail
echo CUSTOM VCPKG
###cargo install cargo-vcpkg
cargo install --git https://github.com/mcgoo/cargo-vcpkg --branch master cargo-vcpkg
displayName: Install cargo-vcpkg
# Note: setvariable + `set -x` adds spurious single quotes at ends of variable values
- bash: |
echo "##vso[task.setvariable variable=VCPKG_ROOT;]$(pwd)/target/vcpkg"
echo "##vso[task.setvariable variable=TECTONIC_DEP_BACKEND;]vcpkg"
displayName: Setup build variables
# Without RUST_TEST_THREAD=1, on Windows the doctests fail with a
# PermissionDenied issue that seems to be due to creating multiple tempfiles in
# the same directory (tests/) at once. $VCPKG_DEFAULT_HOST_TRIPLET speeds
# up our builds a bit by further reducing the number of different
# builds we need to do.
- bash: |
echo "##vso[task.setvariable variable=RUSTFLAGS;]-Ctarget-feature=+crt-static"
echo "##vso[task.setvariable variable=VCPKGRS_TRIPLET;]x64-windows-static-release"
echo "##vso[task.setvariable variable=VCPKG_DEFAULT_HOST_TRIPLET;]x64-windows-static-release"
echo "##vso[task.setvariable variable=RUST_TEST_THREADS;]1"
displayName: Setup build variables (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- bash: |
set -xeuo pipefail
cargo vcpkg -v build --target $TARGET
displayName: Build vcpkg deps
- template: azure-generic-build.yml
parameters:
canaryBuild: ${{ parameters.canaryBuild }}
explicitFeatures: "external-harfbuzz"
testIt: ${{ parameters.testIt }}