diff --git a/ports/freexl/portfile.cmake b/ports/freexl/portfile.cmake index 6b4998b679e99c..d4ee809df0bff9 100644 --- a/ports/freexl/portfile.cmake +++ b/ports/freexl/portfile.cmake @@ -1,3 +1,5 @@ +message(FATAL_ERROR "Simulate failure") + set(FREEXL_VERSION_STR "1.0.4") vcpkg_download_distfile(ARCHIVE diff --git a/ports/spatialite-tools/portfile.cmake b/ports/spatialite-tools/portfile.cmake index b72e802b38ae87..d44a8fc98dffae 100644 --- a/ports/spatialite-tools/portfile.cmake +++ b/ports/spatialite-tools/portfile.cmake @@ -1,3 +1,5 @@ +message(FATAL_ERROR "Should not build, CASCADED_DUE_TO_MISSING_DEPENDENCIES (freexl)") + set(SPATIALITE_TOOLS_VERSION_STR "5.0.0") vcpkg_download_distfile(ARCHIVE URLS "http://www.gaia-gis.it/gaia-sins/spatialite-tools-sources/spatialite-tools-${SPATIALITE_TOOLS_VERSION_STR}.tar.gz" diff --git a/scripts/azure-pipelines/test-modified-ports.ps1 b/scripts/azure-pipelines/test-modified-ports.ps1 index e089d7a1c5ca86..5bdc750c66428b 100755 --- a/scripts/azure-pipelines/test-modified-ports.ps1 +++ b/scripts/azure-pipelines/test-modified-ports.ps1 @@ -142,16 +142,60 @@ $skipList = . "$PSScriptRoot/generate-skip-list.ps1" ` -BaselineFile "$PSScriptRoot/../ci.baseline.txt" ` -SkipFailures:$skipFailures +$LogSkippedPorts = $true # Maybe parameter +$changedPorts = @() +$skippedPorts = @() +if ($LogSkippedPorts) { + $diffFile = Join-Path $WorkingRoot 'changed-ports.diff' + Start-Process -FilePath 'git' -ArgumentList 'diff --name-only HEAD~10 -- versions ports' ` + -NoNewWindow -Wait ` + -RedirectStandardOutput $diffFile + $changedPorts = (Get-Content -Path $diffFile) ` + -match '^ports/|^versions/.-/' ` + -replace '^(ports/|versions/.-/)([^/]*)(/.*|[.]json$)','$2' ` + | Sort-Object -Unique + $skippedPorts = $skipList -Split ',' + $changedPorts | ForEach-Object { + if ($skippedPorts -contains $_) { + $port = $_ + Write-Host "##vso[task.logissue type=error]$port`: build skipped, reason: CI baseline file." + } + } +} + +$hostArgs = @() if ($Triplet -in @('x64-windows', 'x64-osx', 'x64-linux')) { # WORKAROUND: These triplets are native-targetting which triggers an issue in how vcpkg handles the skip list. # The workaround is to pass the skip list as host-excludes as well. - & "./vcpkg$executableExtension" ci $Triplet --x-xunit=$xmlFile --exclude=$skipList --host-exclude=$skipList --failure-logs=$failureLogs @commonArgs -} -else -{ - & "./vcpkg$executableExtension" ci $Triplet --x-xunit=$xmlFile --exclude=$skipList --failure-logs=$failureLogs @commonArgs + $hostArgs = @("--host-exclude=$skipList") } + +$current_port_and_features = ':' +& "./vcpkg$executableExtension" ci $Triplet --x-xunit=$xmlFile --exclude=$skipList --failure-logs=$failureLogs @hostArgs @commonArgs ` + | ForEach-Object { + $_ + if ($LogSkippedPorts) { + if ($_ -match '^ *([^ :]+):[^:]*: *cascade:' -and $changedPorts -contains $Matches[1]) { + $port = $Matches[1] + Write-Host "##vso[task.logissue type=error]$port`: build skipped, reason: cascade from CI baseline file." + } + elseif ($_ -match '^Building package ([^ ]+)[.][.][.]') { + $current_port_and_features = $Matches[1] + } + elseif ($_ -match 'failed with: CASCADED_DUE_TO_MISSING_DEPENDENCIES') { + & "./vcpkg$executableExtension" depend-info $current_port_and_features | ForEach-Object { + if ($_ -match '^([^:[]+)[:[]' -and $changedPorts -contains $Matches[1]) { + $port = $Matches[1] + if ($current_port_and_features -notmatch "^$port[:[]") { + Write-Host "##vso[task.logissue type=error]$port`: build of depending port '$current_port_and_features' skipped due to missing dependencies." + } + } + } + } + } + } + & "$PSScriptRoot/analyze-test-results.ps1" -logDir $xmlResults ` -triplet $Triplet ` -baselineFile .\scripts\ci.baseline.txt `