From 835f156af99937dfb984532065ebe7bc208867c9 Mon Sep 17 00:00:00 2001 From: Victor Vazquez Date: Thu, 24 Mar 2022 09:11:30 -0700 Subject: [PATCH] Vcpkg manifest and binary caching (#3329) * binary cache and manifest * update packages * udpate * add cache to private pipeline * next try * aver * other * again * aver quick * more * this way * again * one more * print * test * use depend * more deps * dep * Apply suggestions from code review Co-authored-by: Daniel Jurek * updated to use group variable * update identity * end line * Update vcpkg.json * Apply suggestions from code review * cspell * remove comment * updates * make cache mode depend on SAS env var * map env var only for internal pipelines * other approach * what about this * and this * try * amd * another * extra step * typo * override for internal * use default succeded * azure core update manifest * a * run cmake-generate nightly as well * check for SAS * check cache * no secret * fix is secret * pass explicit * use secret all the time * char * One more * export * echos * last * array * remove question * ok * weird * use account key * substring * VCPKG_BINARY_SOURCES * Add module installation * task: * Correct pathing for module * update source gen * format * update spelling * IsWindoows * Use pwsh * Cannot clobber with PSModule-Helpers. Attempt plain install * Attempt plain install * Revert unnecessary change to Update-DocsMsToc.ps1 * template ready * curl is required on Windows as well for some CI gates * attestation * fix format Co-authored-by: Daniel Jurek --- .vscode/cspell.json | 3 +- .../templates/jobs/archetype-sdk-client.yml | 3 - .../jobs/archetype-sdk-cmake-generate.yml | 10 +-- .../templates/jobs/archetype-sdk-tests.yml | 10 --- eng/pipelines/templates/jobs/ci.tests.yml | 2 - .../templates/stages/archetype-sdk-client.yml | 23 +++---- .../templates/stages/platform-matrix.json | 12 +--- eng/pipelines/templates/steps/cmake-build.yml | 5 +- .../templates/steps/cmake-generate.yml | 5 +- eng/pipelines/templates/steps/vcpkg.yml | 45 +++--------- eng/scripts/Set-VcpkgWriteModeCache.ps1 | 17 +++++ eng/scripts/vcpkg.ps1 | 8 +-- .../azure-security-attestation/vcpkg.json | 18 +++++ sdk/core/azure-core/CMakeLists.txt | 1 - sdk/core/azure-core/vcpkg.json | 69 +++++++++++++++++++ sdk/identity/azure-identity/vcpkg.json | 7 ++ sdk/identity/ci.yml | 2 - .../vcpkg.json | 8 +++ .../azure-security-keyvault-keys/vcpkg.json | 8 +++ .../vcpkg.json | 8 +++ sdk/keyvault/ci.yml | 2 - sdk/storage/azure-storage-blobs/vcpkg.json | 25 +++++++ sdk/storage/azure-storage-common/vcpkg.json | 34 +++++++++ .../azure-storage-files-datalake/vcpkg.json | 25 +++++++ .../azure-storage-files-shares/vcpkg.json | 25 +++++++ sdk/storage/azure-storage-queues/vcpkg.json | 25 +++++++ sdk/template/azure-template/CMakeLists.txt | 24 +++++-- sdk/template/azure-template/vcpkg.json | 17 +++++ vcpkg.json | 16 +++++ 29 files changed, 354 insertions(+), 103 deletions(-) create mode 100644 eng/scripts/Set-VcpkgWriteModeCache.ps1 create mode 100644 sdk/attestation/azure-security-attestation/vcpkg.json create mode 100644 sdk/core/azure-core/vcpkg.json create mode 100644 sdk/identity/azure-identity/vcpkg.json create mode 100644 sdk/keyvault/azure-security-keyvault-certificates/vcpkg.json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/vcpkg.json create mode 100644 sdk/keyvault/azure-security-keyvault-secrets/vcpkg.json create mode 100644 sdk/storage/azure-storage-blobs/vcpkg.json create mode 100644 sdk/storage/azure-storage-common/vcpkg.json create mode 100644 sdk/storage/azure-storage-files-datalake/vcpkg.json create mode 100644 sdk/storage/azure-storage-files-shares/vcpkg.json create mode 100644 sdk/storage/azure-storage-queues/vcpkg.json create mode 100644 sdk/template/azure-template/vcpkg.json create mode 100644 vcpkg.json diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 55a6f038e..c2c411171 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -143,7 +143,8 @@ "filename": "**/eng/**", "words": [ "TEAMPROJECTID", - "issecret" + "issecret", + "cppvcpkgcache" ] }, { diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index 1ebbe67a6..243c72b34 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -61,7 +61,6 @@ jobs: name: azsdk-pool-mms-win-2019-general vmImage: MMS2019 variables: - VcpkgDependencies: curl[winssl] libxml2 openssl VCPKG_DEFAULT_TRIPLET: 'x64-windows-static' Package.EnableSBOMSigning: true steps: @@ -98,8 +97,6 @@ jobs: # TODO: We should be able to generate docs without having to install these # prerequisites: - template: /eng/pipelines/templates/steps/vcpkg.yml - parameters: - DependenciesVariableName: VcpkgDependencies - template: /eng/pipelines/templates/steps/cmake-build.yml parameters: diff --git a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml b/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml index a57511762..4452b018d 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml @@ -14,9 +14,6 @@ parameters: - name: CMakeSourceTestOptions type: object default: [] - - name: CMakeTestDependencies - type: string - default: '' jobs: - job: CMakeGenerate @@ -28,19 +25,16 @@ jobs: OSVmImage: MMSUbuntu18.04 CmakeEnvArg: '' AptDependencies: 'libcurl4-openssl-dev' - VcpkgInstall: ${{ parameters.CMakeTestDependencies }} VCPKG_DEFAULT_TRIPLET: 'x64-linux' Windows: Pool: azsdk-pool-mms-win-2019-general OSVmImage: MMS2019 CmakeEnvArg: '' - VcpkgInstall: ${{ parameters.CMakeTestDependencies }} VCPKG_DEFAULT_TRIPLET: 'x64-windows' Mac: Pool: Azure Pipelines OSVmImage: macOS-10.15 CmakeEnvArg: '' - VcpkgInstall: 'openssl ${{ parameters.CMakeTestDependencies }}' VCPKG_DEFAULT_TRIPLET: 'x64-osx' pool: name: $(Pool) @@ -63,8 +57,6 @@ jobs: displayName: Install dependencies from apt - template: /eng/pipelines/templates/steps/vcpkg.yml - parameters: - DependenciesVariableName: VcpkgInstall - script: cmake --version displayName: cmake --version @@ -122,6 +114,8 @@ jobs: brew install $(BrewDependencies) condition: and(succeeded(), ne(variables['BrewDependencies'], '')) displayName: Install dependencies from brew + + - template: /eng/pipelines/templates/steps/vcpkg.yml - script: cmake --version displayName: cmake --version diff --git a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml b/eng/pipelines/templates/jobs/archetype-sdk-tests.yml index f554276b0..4edbe8890 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-tests.yml @@ -35,7 +35,6 @@ jobs: Linux_x64_gcc5_with_unit_test: Pool: azsdk-pool-mms-ubuntu-1804-general OSVmImage: MMSUbuntu18.04 - VcpkgInstall: 'curl[ssl] libxml2 openssl' VCPKG_DEFAULT_TRIPLET: 'x64-linux' # Can't set CC and CXX to env because it would affect VCPKG building which requires g++ > 7 # So, this conf will set the CXX for cmake inline. @@ -45,7 +44,6 @@ jobs: Linux_x64_with_unit_test: Pool: azsdk-pool-mms-ubuntu-1804-general OSVmImage: MMSUbuntu18.04 - VcpkgInstall: 'curl[ssl] libxml2 openssl' VCPKG_DEFAULT_TRIPLET: 'x64-linux' CmakeArgs: ' -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_CODE_COVERAGE=ON' AptDependencies: 'gcovr lcov' @@ -57,7 +55,6 @@ jobs: Ubuntu20_x64_with_unit_test: Pool: azsdk-pool-mms-ubuntu-1804-general OSVmImage: MMSUbuntu18.04 - VcpkgInstall: 'curl[ssl] libxml2 openssl' VCPKG_DEFAULT_TRIPLET: 'x64-linux' CmakeArgs: ' -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SAMPLES=ON' AZURE_CORE_ENABLE_JSON_TESTS: 1 @@ -65,7 +62,6 @@ jobs: Ubuntu20_samples: Pool: azsdk-pool-mms-ubuntu-1804-general OSVmImage: MMSUbuntu18.04 - VcpkgInstall: 'curl[ssl] libxml2 openssl' VCPKG_DEFAULT_TRIPLET: 'x64-linux' # Builds samples and run them against the deployed resources. Samples requires Azure Account, so only works on live tests. CmakeArgs: ' -DBUILD_TESTING=ON -DBUILD_SAMPLES=ON -DCMAKE_BUILD_TYPE=Release ' @@ -74,7 +70,6 @@ jobs: Ubuntu20_x64_no_rtti: Pool: azsdk-pool-mms-ubuntu-1804-general OSVmImage: MMSUbuntu18.04 - VcpkgInstall: 'curl[ssl] libxml2 openssl' VCPKG_DEFAULT_TRIPLET: 'x64-linux' CmakeArgs: ' -DBUILD_RTTI=OFF -DCMAKE_BUILD_TYPE=Release ' BuildArgs: '-j 4' @@ -126,7 +121,6 @@ jobs: Win_x86_with_unit_test_libcurl: Pool: azsdk-pool-mms-win-2019-general OSVmImage: MMS2019 - VcpkgInstall: 'curl[winssl] openssl' VCPKG_DEFAULT_TRIPLET: 'x86-windows-static' CMAKE_GENERATOR: 'Visual Studio 16 2019' CMAKE_GENERATOR_PLATFORM: Win32 @@ -136,7 +130,6 @@ jobs: Win_x64_with_unit_test_libcurl: Pool: azsdk-pool-mms-win-2019-general OSVmImage: MMS2019 - VcpkgInstall: 'curl[winssl] openssl' VCPKG_DEFAULT_TRIPLET: 'x64-windows-static' CMAKE_GENERATOR: 'Visual Studio 16 2019' CMAKE_GENERATOR_PLATFORM: x64 @@ -158,7 +151,6 @@ jobs: MacOS_x64_with_unit_test: Pool: Azure Pipelines OSVmImage: 'macOS-10.15' - VcpkgInstall: 'curl[ssl] libxml2 openssl' VCPKG_DEFAULT_TRIPLET: 'x64-osx' CmakeArgs: ' -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON' AZURE_CORE_ENABLE_JSON_TESTS: 1 @@ -215,8 +207,6 @@ jobs: displayName: Install dependencies from apt - template: /eng/pipelines/templates/steps/vcpkg.yml - parameters: - DependenciesVariableName: VcpkgInstall - script: | dotnet tool install -g dotnet-reportgenerator-globaltool diff --git a/eng/pipelines/templates/jobs/ci.tests.yml b/eng/pipelines/templates/jobs/ci.tests.yml index 33a0f95a0..a9d25fda9 100644 --- a/eng/pipelines/templates/jobs/ci.tests.yml +++ b/eng/pipelines/templates/jobs/ci.tests.yml @@ -95,8 +95,6 @@ jobs: displayName: Set Xcode version - template: /eng/pipelines/templates/steps/vcpkg.yml - parameters: - DependenciesVariableName: VcpkgInstall # Validate all the files are formatted correctly according to the # .clang-format file. This step runs on linux only only and assumes that diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index 55dfd01e7..d980b0f90 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -47,22 +47,17 @@ parameters: - name: CMakeSourceTestOptions type: object default: [] -- name: CMakeTestDependencies - type: string - default: '' stages: - - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - stage: CMakeGeneration - jobs: - - template: /eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml - parameters: - ServiceDirectory: ${{ parameters.ServiceDirectory }} - Artifacts: ${{ parameters.Artifacts }} - ArtifactsSource: ${{ parameters.ArtifactsSource }} - CMakeTestOptions: ${{ parameters.CMakeTestOptions }} - CMakeSourceTestOptions: ${{ parameters.CMakeSourceTestOptions }} - CMakeTestDependencies: ${{ parameters.CMakeTestDependencies }} + - stage: CMakeGeneration + jobs: + - template: /eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml + parameters: + ServiceDirectory: ${{ parameters.ServiceDirectory }} + Artifacts: ${{ parameters.Artifacts }} + ArtifactsSource: ${{ parameters.ArtifactsSource }} + CMakeTestOptions: ${{ parameters.CMakeTestOptions }} + CMakeSourceTestOptions: ${{ parameters.CMakeSourceTestOptions }} - stage: Build dependsOn: [] diff --git a/eng/pipelines/templates/stages/platform-matrix.json b/eng/pipelines/templates/stages/platform-matrix.json index 073d0c13f..5dbf5885f 100644 --- a/eng/pipelines/templates/stages/platform-matrix.json +++ b/eng/pipelines/templates/stages/platform-matrix.json @@ -16,7 +16,6 @@ "StaticConfigs": { "_": { "Pool": "Azure Pipelines", - "VcpkgInstall": "curl[ssl] libxml2 openssl", "BuildArgs": "-j 10", "VCPKG_DEFAULT_TRIPLET": "x64-osx", "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_TRANSPORT_CURL=ON", @@ -42,18 +41,14 @@ }, "TargetPlatform": { "Win32Api_curl": { - "VcpkgInstall": "curl[winssl] openssl", - "CmakeArgs": " -DBUILD_TRANSPORT_CURL=ON", - "BuildArgs": "--parallel 8" + "CmakeArgs": " -DBUILD_TRANSPORT_CURL=ON" }, "Win32Api_release_curl": { - "VcpkgInstall": "curl[winssl] openssl", "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_TRANSPORT_CURL=ON", "BuildArgs": "--parallel 8 --config Release", "PublishMapFiles": "true" }, "Win32Api_debug_tests": { - "VcpkgInstall": "curl[winssl] openssl", "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_TRANSPORT_CURL=ON -DBUILD_TRANSPORT_WINHTTP=ON", "BuildArgs": "--parallel 8 --config Debug", "PublishMapFiles": "true" @@ -109,7 +104,6 @@ "Ubuntu18": { "OSVmImage": "MMSUbuntu18.04", "Pool": "azsdk-pool-mms-ubuntu-1804-general", - "VcpkgInstall": "curl[ssl] libxml2 openssl", "VCPKG_DEFAULT_TRIPLET": "x64-linux", "BuildArgs": "-j 10" } @@ -136,8 +130,7 @@ "CODE_COVERAGE": "enabled", "PublishMapFiles": "true" }, - "included": { - }, + "included": {}, "included_release": { "CMAKE_BUILD_TYPE": "Release", "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON", @@ -154,7 +147,6 @@ "Ubuntu20": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general", - "VcpkgInstall": "curl[ssl] libxml2 openssl", "VCPKG_DEFAULT_TRIPLET": "x64-linux", "BuildArgs": "-j 10", "CC": "/usr/bin/clang-11", diff --git a/eng/pipelines/templates/steps/cmake-build.yml b/eng/pipelines/templates/steps/cmake-build.yml index 7a2d75e36..9918d7f51 100644 --- a/eng/pipelines/templates/steps/cmake-build.yml +++ b/eng/pipelines/templates/steps/cmake-build.yml @@ -14,9 +14,12 @@ steps: workingDirectory: build displayName: cmake --version - - script: ${{ parameters.Env }} cmake ${{ parameters.GenerateArgs }} .. + - script: | + ${{ parameters.Env }} cmake ${{ parameters.GenerateArgs }} .. workingDirectory: build displayName: cmake generate + env: + VCPKG_BINARY_SOURCES: $(VCPKG_BINARY_SOURCES_SECRET) # Core should build all cmake tagets - ${{ if and(eq(parameters.Build, true), eq(parameters.ServiceDirectory, 'core')) }}: diff --git a/eng/pipelines/templates/steps/cmake-generate.yml b/eng/pipelines/templates/steps/cmake-generate.yml index f6529bc41..f39df2633 100644 --- a/eng/pipelines/templates/steps/cmake-generate.yml +++ b/eng/pipelines/templates/steps/cmake-generate.yml @@ -16,9 +16,12 @@ steps: workingDirectory: ${{ parameters.CmakeGeneratePath }}/build displayName: Show current path - - script: ${{ parameters.Env }} cmake ${{ parameters.GenerateArgs }} .. + - script: | + ${{ parameters.Env }} cmake ${{ parameters.GenerateArgs }} .. workingDirectory: ${{ parameters.CmakeGeneratePath }}/build displayName: cmake generate + env: + VCPKG_BINARY_SOURCES: $(VCPKG_BINARY_SOURCES_SECRET) - script: rm -rf build workingDirectory: ${{ parameters.CmakeGeneratePath }} diff --git a/eng/pipelines/templates/steps/vcpkg.yml b/eng/pipelines/templates/steps/vcpkg.yml index 8c33567b4..34e1dafb7 100644 --- a/eng/pipelines/templates/steps/vcpkg.yml +++ b/eng/pipelines/templates/steps/vcpkg.yml @@ -1,9 +1,3 @@ -parameters: - # Use the variable name itself (no $() or other wrapping syntax). This is - # because we use runtime and macro expressions for conditions and script - # invocations - DependenciesVariableName: vcpkg.deps - steps: - pwsh: | $TargetPath = "$(Agent.TempDirectory)/vcpkg" @@ -17,33 +11,17 @@ steps: Write-Host "##vso[task.prependpath]$TargetPath" Write-Host "##vso[task.setvariable variable=VCPKG_INSTALLATION_ROOT]$TargetPath" Write-Host "##vso[task.setvariable variable=VcpkgCommit]$VcpkgCommit" + Write-Host "##vso[task.setvariable variable=VCPKG_BINARY_SOURCES_SECRET;issecret=true;]clear;x-azblob,https://cppvcpkgcache.blob.core.windows.net/public-vcpkg-container,,read" displayName: Set Vcpkg Variables - condition: >- - and( - succeeded(), - not(eq(variables['${{ parameters.DependenciesVariableName }}'], '')) - ) - # This task times out after 10 minutes. An analysis of a subset of Vcpkg Cache - # runs showed that after 10 minutes the cache step is very unlikely to - # succeed. - - task: Cache@2 + - task: PowerShell@2 inputs: - key: >- - $(Agent.JobName) - | "$(VcpkgCommit)" - | $(Agent.Os) - | $(${{ parameters.DependenciesVariableName }}) - path: $(VCPKG_INSTALLATION_ROOT) - cacheHitVar: VcpkgRestoredFromCache - displayName: Vcpkg Cache - timeoutInMinutes: 10 - condition: >- - and( - succeeded(), - not(eq(variables['${{ parameters.DependenciesVariableName }}'], '')), - not(eq(variables['Skip.VcpkgCache'], 'true')) - ) + pwsh: true + targetType: filePath + filePath: eng/scripts/Set-VcpkgWriteModeCache.ps1 + arguments: -StorageAccountKey '$(cpp-vcpkg-cache-storage-key)' + displayName: Set Vcpkg Write-mode Cache + condition: eq(variables['System.TeamProject'], 'internal') - task: PowerShell@2 inputs: @@ -51,12 +29,5 @@ steps: filePath: eng/scripts/vcpkg.ps1 arguments: >- -Ref $(VcpkgCommit) - -Dependencies "$(${{ parameters.DependenciesVariableName }})" -VcpkgPath $(VCPKG_INSTALLATION_ROOT) pwsh: true - condition: >- - and( - succeeded(), - not(eq(variables['${{ parameters.DependenciesVariableName }}'], '')), - ne(variables['VcpkgRestoredFromCache'], true) - ) diff --git a/eng/scripts/Set-VcpkgWriteModeCache.ps1 b/eng/scripts/Set-VcpkgWriteModeCache.ps1 new file mode 100644 index 000000000..bf599c8bf --- /dev/null +++ b/eng/scripts/Set-VcpkgWriteModeCache.ps1 @@ -0,0 +1,17 @@ +param( + [string] $StorageAccountKey +) +Install-Module "Az.Storage" -AllowClobber -Force + +$ctx = New-AzStorageContext ` + -StorageAccountName 'cppvcpkgcache' ` + -StorageAccountKey $StorageAccountKey +$token = New-AzStorageAccountSASToken ` + -Service Blob ` + -ResourceType Object ` + -Permission "rwc" ` + -Context $ctx +$vcpkgBinarySourceSas = $token.Substring(1) + +Write-Host "Setting vcpkg binary cache to read and write" +Write-Host "##vso[task.setvariable variable=VCPKG_BINARY_SOURCES_SECRET;issecret=true;]clear;x-azblob,https://cppvcpkgcache.blob.core.windows.net/public-vcpkg-container,$vcpkgBinarySourceSas,readwrite" diff --git a/eng/scripts/vcpkg.ps1 b/eng/scripts/vcpkg.ps1 index 8c43899b6..41b1885ed 100644 --- a/eng/scripts/vcpkg.ps1 +++ b/eng/scripts/vcpkg.ps1 @@ -4,10 +4,6 @@ Param ( [ValidateNotNullOrEmpty()] [string] $Ref = (Get-Content "$PSScriptRoot/../vcpkg-commit.txt"), - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $Dependencies, - [Parameter()] [ValidateNotNullOrEmpty()] [string] $VcpkgPath = "$PSScriptRoot/../../vcpkg" @@ -23,11 +19,9 @@ try { if ($IsWindows) { .\bootstrap-vcpkg.bat - .\vcpkg.exe install $Dependencies.Split(' ') } else { ./bootstrap-vcpkg.sh - ./vcpkg install $Dependencies.Split(' ') } } finally { Set-Location $initialDirectory -} \ No newline at end of file +} diff --git a/sdk/attestation/azure-security-attestation/vcpkg.json b/sdk/attestation/azure-security-attestation/vcpkg.json new file mode 100644 index 000000000..2e1108d1e --- /dev/null +++ b/sdk/attestation/azure-security-attestation/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "azure-security-attestation-cpp", + "version-semver": "1.0.0-beta.1", + "dependencies": [ + { + "name": "azure-core-cpp" + }, + { + "name": "vcpkg-cmake" + }, + { + "name": "vcpkg-cmake-config" + }, + { + "name": "openssl" + } + ] +} diff --git a/sdk/core/azure-core/CMakeLists.txt b/sdk/core/azure-core/CMakeLists.txt index b3c85925e..54698b777 100644 --- a/sdk/core/azure-core/CMakeLists.txt +++ b/sdk/core/azure-core/CMakeLists.txt @@ -6,7 +6,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake-module include(AzureVcpkg) az_vcpkg_integrate() - # Azure core is compatible with CMake 3.12 cmake_minimum_required (VERSION 3.12) project(azure-core LANGUAGES CXX) diff --git a/sdk/core/azure-core/vcpkg.json b/sdk/core/azure-core/vcpkg.json new file mode 100644 index 000000000..a8f96609d --- /dev/null +++ b/sdk/core/azure-core/vcpkg.json @@ -0,0 +1,69 @@ +{ + "name": "azure-core-cpp", + "version-string": "1.4.0-beta.1", + "dependencies": [ + { + "name": "openssl", + "platform": "!windows & !uwp" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ + "http" + ], + "features": { + "curl": { + "description": "Libcurl HTTP transport implementation", + "dependencies": [ + { + "name": "azure-core-cpp", + "default-features": false + }, + { + "name": "curl", + "default-features": false, + "features": [ + "ssl" + ] + } + ] + }, + "http": { + "description": "All HTTP transport implementations available on the platform", + "dependencies": [ + { + "name": "azure-core-cpp", + "default-features": false, + "features": [ + "curl" + ] + }, + { + "name": "azure-core-cpp", + "default-features": false, + "features": [ + "curl", + "winhttp" + ], + "platform": "windows & !uwp" + } + ] + }, + "winhttp": { + "description": "WinHTTP HTTP transport implementation", + "dependencies": [ + { + "name": "azure-core-cpp", + "default-features": false + } + ] + } + } +} diff --git a/sdk/identity/azure-identity/vcpkg.json b/sdk/identity/azure-identity/vcpkg.json new file mode 100644 index 000000000..22c9f4be7 --- /dev/null +++ b/sdk/identity/azure-identity/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "azure-identity-cpp", + "version-string": "1.0.0", + "dependencies": [ + "azure-core-cpp" + ] +} diff --git a/sdk/identity/ci.yml b/sdk/identity/ci.yml index e9285dab8..8de48628c 100644 --- a/sdk/identity/ci.yml +++ b/sdk/identity/ci.yml @@ -30,8 +30,6 @@ stages: LiveTestCtestRegex: azure-identity. LineCoverageTarget: 99 BranchCoverageTarget: 63 -# Dependencies per package is not supported. List the dependencies for all packages. - CMakeTestDependencies: 'azure-core-cpp' Artifacts: - Name: azure-identity Path: azure-identity diff --git a/sdk/keyvault/azure-security-keyvault-certificates/vcpkg.json b/sdk/keyvault/azure-security-keyvault-certificates/vcpkg.json new file mode 100644 index 000000000..7a4df4ad6 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-certificates/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "azure-security-keyvault-certificates", + "version-string": "1.0.0", + "dependencies": [ + "azure-core-cpp", + "azure-identity-cpp" + ] +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/vcpkg.json b/sdk/keyvault/azure-security-keyvault-keys/vcpkg.json new file mode 100644 index 000000000..1b8c4b9b5 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "azure-security-keyvault-keys", + "version-string": "1.0.0", + "dependencies": [ + "azure-core-cpp", + "azure-identity-cpp" + ] +} diff --git a/sdk/keyvault/azure-security-keyvault-secrets/vcpkg.json b/sdk/keyvault/azure-security-keyvault-secrets/vcpkg.json new file mode 100644 index 000000000..d9d21a607 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-secrets/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "azure-security-keyvault-secrets", + "version-string": "1.0.0", + "dependencies": [ + "azure-core-cpp", + "azure-identity-cpp" + ] +} diff --git a/sdk/keyvault/ci.yml b/sdk/keyvault/ci.yml index 82c9f8e6d..83598a1e6 100644 --- a/sdk/keyvault/ci.yml +++ b/sdk/keyvault/ci.yml @@ -32,8 +32,6 @@ stages: SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) LineCoverageTarget: 81 BranchCoverageTarget: 42 -# Dependencies per package is not supported. List the dependencies for all packages. - CMakeTestDependencies: 'azure-core-cpp azure-identity-cpp' Artifacts: - Name: azure-security-keyvault-keys Path: azure-security-keyvault-keys diff --git a/sdk/storage/azure-storage-blobs/vcpkg.json b/sdk/storage/azure-storage-blobs/vcpkg.json new file mode 100644 index 000000000..c06b902a0 --- /dev/null +++ b/sdk/storage/azure-storage-blobs/vcpkg.json @@ -0,0 +1,25 @@ +{ + "name": "azure-storage-blobs-cpp", + "version-semver": "12.4.0-beta.1", + "description": [ + "Microsoft Azure Storage Blobs SDK for C++", + "This library provides Azure Storage Blobs SDK." + ], + "homepage": "https://github.com/Azure/azure-sdk-for-cpp/tree/main/sdk/storage/azure-storage-blobs", + "license": "MIT", + "dependencies": [ + { + "name": "azure-storage-common-cpp", + "default-features": false, + "version>=": "12.2.2" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/sdk/storage/azure-storage-common/vcpkg.json b/sdk/storage/azure-storage-common/vcpkg.json new file mode 100644 index 000000000..916203dfe --- /dev/null +++ b/sdk/storage/azure-storage-common/vcpkg.json @@ -0,0 +1,34 @@ +{ + "name": "azure-storage-common-cpp", + "version-semver": "12.2.2", + "description": [ + "Microsoft Azure Common Storage SDK for C++", + "This library provides common Azure Storage-related abstractions for Azure SDK." + ], + "homepage": "https://github.com/Azure/azure-sdk-for-cpp/tree/main/sdk/storage/azure-storage-common", + "license": "MIT", + "dependencies": [ + { + "name": "azure-core-cpp", + "default-features": false, + "version>=": "1.3.1" + }, + { + "name": "libxml2", + "platform": "!windows" + }, + { + "name": "openssl", + "platform": "!windows", + "version>=" : "1.1.1n" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/sdk/storage/azure-storage-files-datalake/vcpkg.json b/sdk/storage/azure-storage-files-datalake/vcpkg.json new file mode 100644 index 000000000..fff483c12 --- /dev/null +++ b/sdk/storage/azure-storage-files-datalake/vcpkg.json @@ -0,0 +1,25 @@ +{ + "name": "azure-storage-files-datalake-cpp", + "version-semver": "12.3.1", + "description": [ + "Microsoft Azure Storage Files Data Lake SDK for C++", + "This library provides Azure Storage Files Data Lake SDK." + ], + "homepage": "https://github.com/Azure/azure-sdk-for-cpp/tree/main/sdk/storage/azure-storage-files-datalake", + "license": "MIT", + "dependencies": [ + { + "name": "azure-storage-blobs-cpp", + "default-features": false, + "version>=": "12.3.0" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/sdk/storage/azure-storage-files-shares/vcpkg.json b/sdk/storage/azure-storage-files-shares/vcpkg.json new file mode 100644 index 000000000..0d0d853eb --- /dev/null +++ b/sdk/storage/azure-storage-files-shares/vcpkg.json @@ -0,0 +1,25 @@ +{ + "name": "azure-storage-files-shares-cpp", + "version-semver": "12.2.1", + "description": [ + "Microsoft Azure Storage Files Shares SDK for C++", + "This library provides Azure Storage Files Shares SDK." + ], + "homepage": "https://github.com/Azure/azure-sdk-for-cpp/tree/main/sdk/storage/azure-storage-files-shares", + "license": "MIT", + "dependencies": [ + { + "name": "azure-storage-common-cpp", + "default-features": false, + "version>=": "12.2.2" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/sdk/storage/azure-storage-queues/vcpkg.json b/sdk/storage/azure-storage-queues/vcpkg.json new file mode 100644 index 000000000..b48d71ab2 --- /dev/null +++ b/sdk/storage/azure-storage-queues/vcpkg.json @@ -0,0 +1,25 @@ +{ + "name": "azure-storage-queues-cpp", + "version-semver": "12.0.0-beta.4", + "description": [ + "Microsoft Azure Storage Queues SDK for C++", + "This library provides Azure Storage Queues SDK." + ], + "homepage": "https://github.com/Azure/azure-sdk-for-cpp/tree/main/sdk/storage/azure-storage-queues", + "license": "MIT", + "dependencies": [ + { + "name": "azure-storage-common-cpp", + "default-features": false, + "version>=": "12.2.2" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/sdk/template/azure-template/CMakeLists.txt b/sdk/template/azure-template/CMakeLists.txt index 8d8a854ef..c78558f5e 100644 --- a/sdk/template/azure-template/CMakeLists.txt +++ b/sdk/template/azure-template/CMakeLists.txt @@ -1,16 +1,26 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # SPDX-License-Identifier: MIT +# setting CMAKE_TOOLCHAIN_FILE must happen before creating the project +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake-modules") +include(AzureVcpkg) +az_vcpkg_integrate() + cmake_minimum_required (VERSION 3.13) project(azure-template LANGUAGES CXX) +include(AzureTransportAdapters) +include(AzureBuildTargetForCI) +include(AzureVersion) +include(AzureCodeCoverage) +include(AzureDoxygen) +include(AzureGlobalCompileOptions) +include(AzureConfigRTTI) + set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake-modules") - -include(AzureVcpkg) include(AzureVersion) include(AzureCodeCoverage) include(AzureTransportAdapters) @@ -18,8 +28,9 @@ include(AzureDoxygen) include(AzureGlobalCompileOptions) include(AzureConfigRTTI) include(AzureBuildTargetForCI) +# Add create_map_file function +include(CreateMapFile) -az_vcpkg_integrate() if(NOT AZ_ALL_LIBRARIES) find_package(azure-core-cpp "1.2.0" CONFIG QUIET) @@ -78,6 +89,11 @@ az_rtti_setup( ) if(BUILD_TESTING) + if (NOT AZ_ALL_LIBRARIES OR FETCH_SOURCE_DEPS) + include(AddGoogleTest) + enable_testing () + endif() + # tests add_subdirectory(test) endif() diff --git a/sdk/template/azure-template/vcpkg.json b/sdk/template/azure-template/vcpkg.json new file mode 100644 index 000000000..27a6d5e1b --- /dev/null +++ b/sdk/template/azure-template/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "azure-template-cpp", + "version-string": "1.0.0", + "dependencies": [ + { + "name": "azure-core-cpp" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} \ No newline at end of file diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 000000000..4fb982266 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,16 @@ +{ + "name": "azure-sdk-for-cpp", + "version-string": "1.0.0", + "dependencies": [ + { + "name": "curl" + }, + { + "name": "libxml2", + "platform": "!windows & !uwp" + }, + { + "name": "openssl" + } + ] +}