Use vcpkg supplied by eng/common (#6771)

* Use vcpkg supplied by eng/common

* /

* Remove Set-VcpkgWriteModeCache.ps1 in favor of eng/common version

* Use vcpkg versions from https://github.com/Azure/azure-sdk-for-cpp/pull/6756/files
This commit is contained in:
Daniel Jurek 2025-10-16 09:51:40 -07:00 committed by GitHub
parent d00d68e750
commit 9023c03ee8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 38 additions and 76 deletions

View File

@ -18,7 +18,7 @@ macro(az_vcpkg_integrate)
message("AZURE_SDK_DISABLE_AUTO_VCPKG is not defined. Fetch a local copy of vcpkg.")
# GET VCPKG FROM SOURCE
# User can set env var AZURE_SDK_VCPKG_COMMIT to pick the VCPKG commit to fetch
set(VCPKG_COMMIT_STRING 120deac3062162151622ca4860575a33844ba10b) # default SDK tested commit
set(VCPKG_COMMIT_STRING 4334d8b4c8916018600212ab4dd4bbdc343065d1) # default SDK tested commit
if(DEFINED ENV{AZURE_SDK_VCPKG_COMMIT})
message("AZURE_SDK_VCPKG_COMMIT is defined. Using that instead of the default.")
set(VCPKG_COMMIT_STRING "$ENV{AZURE_SDK_VCPKG_COMMIT}") # default SDK tested commit

View File

@ -142,7 +142,15 @@ jobs:
workingDirectory: $(Agent.TempDirectory)
displayName: Download and Install Doxygen
- template: /eng/pipelines/templates/steps/vcpkg.yml
- template: /eng/common/pipelines/templates/steps/set-vcpkg-cache-vars.yml
- script: vcpkg --version
condition: >-
and(
succeeded(),
not(eq(variables['Agent.OS'], 'Darwin'))
)
displayName: vcpkg --version
- template: /eng/pipelines/templates/steps/cmake-build.yml
parameters:

View File

@ -135,7 +135,15 @@ jobs:
)
displayName: Xcode version
- template: /eng/pipelines/templates/steps/vcpkg.yml
- template: /eng/common/pipelines/templates/steps/set-vcpkg-cache-vars.yml
- script: vcpkg --version
condition: >-
and(
succeeded(),
not(eq(variables['Agent.OS'], 'Darwin'))
)
displayName: vcpkg --version
# Validate all the files are formatted correctly according to the
# .clang-format file. This step runs on linux only and assumes that

View File

@ -87,7 +87,15 @@ jobs:
condition: and(succeeded(), ne(variables['BrewDependencies'], ''))
displayName: Install dependencies from brew
- template: /eng/pipelines/templates/steps/vcpkg.yml
- template: /eng/common/pipelines/templates/steps/set-vcpkg-cache-vars.yml
- script: vcpkg --version
condition: >-
and(
succeeded(),
not(eq(variables['Agent.OS'], 'Darwin'))
)
displayName: vcpkg --version
- script: cmake --version
displayName: cmake --version

View File

@ -135,7 +135,15 @@ jobs:
condition: and(succeededOrFailed(), ne(variables['AptDependencies'], ''))
displayName: Install dependencies from apt
- template: /eng/pipelines/templates/steps/vcpkg.yml
- template: /eng/common/pipelines/templates/steps/set-vcpkg-cache-vars.yml
- script: vcpkg --version
condition: >-
and(
succeeded(),
not(eq(variables['Agent.OS'], 'Darwin'))
)
displayName: vcpkg --version
- script: |
dotnet tool install -g dotnet-reportgenerator-globaltool

View File

@ -1,26 +0,0 @@
steps:
- pwsh: |
Write-Host "##vso[task.setvariable variable=VCPKG_BINARY_SOURCES_SECRET;issecret=true;]clear;x-azblob,https://azuresdkartifacts.blob.core.windows.net/public-vcpkg-container,,read"
Write-Host "##vso[task.setvariable variable=X_VCPKG_ASSET_SOURCES_SECRET;issecret=true;]clear;x-azurl,https://azuresdkartifacts.blob.core.windows.net/public-vcpkg-container,,read"
displayName: Set Vcpkg Variables
- script: vcpkg --version
condition: >-
and(
succeeded(),
not(eq(variables['Agent.OS'], 'Darwin'))
)
displayName: vcpkg --version
- ${{if eq(variables['System.TeamProject'], 'internal') }}:
- task: AzurePowerShell@5
displayName: Set Vcpkg Write-mode Cache
inputs:
azureSubscription: 'Azure SDK Artifacts'
ScriptType: FilePath
ScriptPath: eng/scripts/Set-VcpkgWriteModeCache.ps1
azurePowerShellVersion: LatestVersion
pwsh: true
# This step is idempotent and can be run multiple times in cases of
# failure and partial execution.
retryCountOnTaskFailure: 3

View File

@ -1,44 +0,0 @@
param(
[string] $StorageAccountName = 'azuresdkartifacts',
[string] $StorageContainerName = 'public-vcpkg-container'
)
."$PSScriptRoot/../common/scripts/Helpers/PSModule-Helpers.ps1"
Write-Host "`$env:PSModulePath = $($env:PSModulePath)"
# Work around double backslash
if ($IsWindows) {
$hostedAgentModulePath = $env:SystemDrive + "\\Modules"
$moduleSeperator = ";"
} else {
$hostedAgentModulePath = "/usr/share"
$moduleSeperator = ":"
}
$modulePaths = $env:PSModulePath -split $moduleSeperator
$modulePaths = $modulePaths.Where({ !$_.StartsWith($hostedAgentModulePath) })
$AzModuleCachePath = (Get-ChildItem "$hostedAgentModulePath/az_*" -Attributes Directory) -join $moduleSeperator
if ($AzModuleCachePath -and $env.PSModulePath -notcontains $AzModuleCachePath) {
$modulePaths += $AzModuleCachePath
}
$env:PSModulePath = $modulePaths -join $moduleSeperator
Install-ModuleIfNotInstalled "Az.Storage" "4.3.0" | Import-Module
$ctx = New-AzStorageContext `
-StorageAccountName $StorageAccountName `
-UseConnectedAccount
$vcpkgBinarySourceSas = New-AzStorageContainerSASToken `
-Name $StorageContainerName `
-Permission "rwcl" `
-Context $ctx `
-ExpiryTime (Get-Date).AddHours(1)
Write-Host "Ensure redaction of SAS tokens in logs"
Write-Host "##vso[task.setvariable variable=VCPKG_BINARY_SAS_TOKEN;issecret=true;]$vcpkgBinarySourceSas"
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://$StorageAccountName.blob.core.windows.net/$StorageContainerName,$vcpkgBinarySourceSas,readwrite"
Write-Host "##vso[task.setvariable variable=X_VCPKG_ASSET_SOURCES_SECRET;issecret=true;]clear;x-azurl,https://$StorageAccountName.blob.core.windows.net/$StorageContainerName,$vcpkgBinarySourceSas,readwrite"

View File

@ -1,7 +1,7 @@
{
"name": "azure-sdk-for-cpp",
"version": "1.5.0",
"builtin-baseline": "120deac3062162151622ca4860575a33844ba10b",
"builtin-baseline": "4334d8b4c8916018600212ab4dd4bbdc343065d1",
"dependencies": [
{
"name": "curl"