diff --git a/scripts/azure-pipelines/azure-pipelines.yml b/scripts/azure-pipelines/azure-pipelines.yml index 4ef04aa9b3f414..7b3fc507fc4155 100644 --- a/scripts/azure-pipelines/azure-pipelines.yml +++ b/scripts/azure-pipelines/azure-pipelines.yml @@ -6,48 +6,61 @@ variables: linux-pool: 'PrLin-2022-03-09-1' osx-pool: 'PrOsx-2022-02-04' +parameters: +- name: vcpkgToolSha + displayName: 'Custom SHA of vcpkg-tool to use rather than bootstrap' + type: string + default: 'use default' + jobs: - template: windows/azure-pipelines.yml parameters: triplet: x86-windows jobName: x86_windows poolName: $(windows-pool) + vcpkgToolSha: ${{ parameters.vcpkgToolSha }} - template: windows/azure-pipelines.yml parameters: triplet: x64-windows jobName: x64_windows poolName: $(windows-pool) + vcpkgToolSha: ${{ parameters.vcpkgToolSha }} - template: windows/azure-pipelines.yml parameters: triplet: x64-windows-static jobName: x64_windows_static poolName: $(windows-pool) + vcpkgToolSha: ${{ parameters.vcpkgToolSha }} - template: windows/azure-pipelines.yml parameters: triplet: x64-windows-static-md jobName: x64_windows_static_md poolName: $(windows-pool) + vcpkgToolSha: ${{ parameters.vcpkgToolSha }} - template: windows/azure-pipelines.yml parameters: triplet: x64-uwp jobName: x64_uwp poolName: $(windows-pool) + vcpkgToolSha: ${{ parameters.vcpkgToolSha }} - template: windows/azure-pipelines.yml parameters: triplet: arm64-windows jobName: arm64_windows poolName: $(windows-pool) + vcpkgToolSha: ${{ parameters.vcpkgToolSha }} - template: windows/azure-pipelines.yml parameters: triplet: arm-uwp jobName: arm_uwp poolName: $(windows-pool) + vcpkgToolSha: ${{ parameters.vcpkgToolSha }} - template: osx/azure-pipelines.yml parameters: diff --git a/scripts/azure-pipelines/windows/azure-pipelines.yml b/scripts/azure-pipelines/windows/azure-pipelines.yml index de254db6476d01..679854e347bdf0 100644 --- a/scripts/azure-pipelines/windows/azure-pipelines.yml +++ b/scripts/azure-pipelines/windows/azure-pipelines.yml @@ -1,7 +1,6 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: MIT # - jobs: - job: ${{ parameters.jobName }} pool: @@ -34,6 +33,22 @@ jobs: pwsh: true - script: .\bootstrap-vcpkg.bat displayName: 'Bootstrap vcpkg' + condition: eq('use default', '${{ parameters.vcpkgToolSha }}') + - task: CmdLine@2 + displayName: "Build vcpkg with CMake" + condition: ne('use default', '${{ parameters.vcpkgToolSha }}') + inputs: + script: | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x86 -host_arch=x86 + dir /s C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake + set PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;%PATH% + git clone https://github.com/microsoft/vcpkg-tool vcpkg-tool + git -C vcpkg-tool switch -d ${{ parameters.vcpkgToolSha }} + rmdir /s /q build.x86.release > nul 2> nul + cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=OFF -DVCPKG_WARNINGS_AS_ERRORS=OFF -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_BUILD_TLS12_DOWNLOADER=OFF -B build.x86.release -S vcpkg-tool + ninja.exe -C build.x86.release + move build.x86.release\vcpkg.exe vcpkg.exe + failOnStderr: true - script: | if exist ${{ variables.VCPKG_DOWNLOADS }} rmdir /S /Q ${{ variables.VCPKG_DOWNLOADS }} 2>&1 displayName: 'Clean downloads'