-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[vcpkg-ci] Add AZP logging markup for skipped ports #19259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
584cfe2
2c16025
e71f8df
0af40b1
ed98a81
df1465b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| message(FATAL_ERROR "Simulate failure") | ||
|
|
||
| set(FREEXL_VERSION_STR "1.0.4") | ||
|
|
||
| vcpkg_download_distfile(ARCHIVE | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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." | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be good to use the file name here so that contributors can find it more easily. |
||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| $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 { | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For other reviewers: I expected this to hang the run until all the output was collected but it didn't seem to do that in testing. |
||||||||||||||
| $_ | ||||||||||||||
| if ($LogSkippedPorts) { | ||||||||||||||
| if ($_ -match '^ *([^ :]+):[^:]*: *cascade:' -and $changedPorts -contains $Matches[1]) { | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a little concerned about making this "output intended for human consumption" load bearing in this way. Not an over my dead body issue but a better solution would be to have the tool do this processing and report it in the output so that changes in the tool don't cause silent failure of the infrastructure. That said, while that is a solution I prefer, this solution is better than the status quo and such failure would only degrade things to the status quo, so I would not block merging over that.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| $port = $Matches[1] | ||||||||||||||
| Write-Host "##vso[task.logissue type=error]$port`: build skipped, reason: cascade from CI baseline file." | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| } | ||||||||||||||
| 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 { | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should save these and process them at the end of the build -- otherwise this is performing concurrent vcpkg calls which is a big no-no.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alternatively: this might be appropriate to add to the original ci command |
||||||||||||||
| 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." | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I see, I had this backwards. It isn't a repeated port name, the actual output is something like: as in, "freexl failed, and that made libspatialite cascade" How about: ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that we cannot be sure that a
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about: |
||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| & "$PSScriptRoot/analyze-test-results.ps1" -logDir $xmlResults ` | ||||||||||||||
| -triplet $Triplet ` | ||||||||||||||
| -baselineFile .\scripts\ci.baseline.txt ` | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may misunderstand the purpose of this machinery, but I think the failures this is intended to capture are when something is moving to skip -- i.e. when the supports field or the ci.baseline.txt is modified. If a port fails to build, we'll already see that error as part of the main CI output. It's the reaction to that (add to ci.baseline.txt or change supports) that causes these "invisible" failures.
Therefore, I think it would be a better test of this machinery would be to change freexl's supports clause.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The case which I wanted to cover here is not obious in the proof-of-concept change:
@BillyONeal That's why the output pattern is:
A: build of depending port 'C' skipped due to missing dependencies."-- I'm looking at C, I know that it depends on A, and I know that A was modified.
(In the proof of concept, A = B.)
I admit that this might generate a lot of output if A and B are frequently used ports, in particular if A = B.
Now I could also collect failed ports, and thus identify that B caused C to be skipped.
In addition, it might be possible to directly mark B as "unrelated" error if not modified and not depending on a modified port. However, this doesn't work when modifying maintainer functions in
scripts.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our policy is that we do not generally merge PRs with B failing -- we will wait for another PR to fix B or fix B in this PR. Given that policy, what does this additional check catch?
(In exceptional circumstances we do merge PRs with a port failing, but in those cases we perform additional manual review to ensure that we aren't in the A+B=C case you've outlined)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay.
With regard to independent ports, the information which would be immediately helpful instead is whether a failing port is unrelated to modified ports. This would reduce workload for contributors and reviewers.
Examples: #20136 (comment)
However, this information would be needed next to the existing message:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "unrelated ports" are now better resolved by microsoft/vcpkg-tool#210.