Skip to content

[workflow] Use MSVC problem matcher for Windows action build #18532

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

Merged
merged 1 commit into from
Dec 28, 2020

Conversation

ammaraskar
Copy link
Member

@ammaraskar ammaraskar commented Feb 17, 2020

This makes warnings and errors from the compiler very prominent so this should help prevent warnings from sneaking into the code base and catch them in review. See https://discuss.python.org/t/using-github-problem-matchers-to-catch-warnings-early/4254 for more details

You can see a demo of this in action here: https://github.com/ammaraskar/cpython/pull/15/files#diff-9ba2eeca0f254ece0a9df4d7cb68e870

or in screenshot form:

example-pull-request

@zooba
Copy link
Member

zooba commented Feb 19, 2020

Looks pretty nice, though I'm concerned that I've gotten more server errors trying to access this PR than I've ever seen from GitHub in the past. Is it possible that it's due to the extra annotation?

Also, where is the source code for the action? I'd like to review it before enabling it.

@ammaraskar
Copy link
Member Author

though I'm concerned that I've gotten more server errors trying to access this PR than I've ever seen from GitHub in the past.

yeah... I think Github still has some kinks to iron out, I've had some weird problems with annotations before too.

Also, where is the source code for the action? I'd like to review it before enabling it.

The source code is here: https://github.com/ammaraskar/msvc-problem-matcher

primarily consisting of these two files:

@ammaraskar
Copy link
Member Author

Ping @zooba, looks like some new warnings managed to sneak their way into the repo.

If you'd prefer it's also possible to put the problem matcher into the CPython repo but it might get stale faster there as opposed to an action published on the market.

@ammaraskar ammaraskar changed the title Use MSVC problem matcher for Windows action build [workflow] Use MSVC problem matcher for Windows action build May 22, 2020
@ammaraskar
Copy link
Member Author

@pablogsal @zware updated to check-in the problem matcher into the repo, take a look at the bottom of https://github.com/python/cpython/pull/18532/files for the existing warnings.

Copy link
Member

@zware zware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little unfortunate that all of the warnings are duplicated (or triplicated, in some cases). I'm also still worried about whether these warnings are going to appear on every PR henceforth; do we know for sure what will happen there? Is it every warning, or just new ones that appear?

Other than those two concerns, LGTM.

@ammaraskar
Copy link
Member Author

It's a little unfortunate that all of the warnings are duplicated (or triplicated, in some cases).

Yeah, looks like MSVC outputs the warnings on the files they occur and then a summary leading to the duplication. VSCode de-duplicates warnings if the text and line numbers match exactly but Github Actions don't. I've filed actions/runner#504 upstream, let's see what they say.

do we know for sure what will happen there? Is it every warning, or just new ones that appear?

The behavior is that if you make changes to a file without the warnings, then they will appear like they do in this PR. At the bottom and marked as Unchanged files with check annotations. If you touch a file that had existing warnings then they'll show up in the actual diff.

As such, before merging this we should try to get rid of as many as the warnings first I think.

@ammaraskar
Copy link
Member Author

Thanks to

most of the existing warnings are gone. There are 3 left but those are minor. This should be ready to go @pablogsal @zware

@ammaraskar
Copy link
Member Author

Closing and re-opening to check if there are no more warnings left.

@ammaraskar ammaraskar closed this Dec 16, 2020
@ammaraskar ammaraskar reopened this Dec 16, 2020
@vstinner
Copy link
Member

Closing and re-opening to check if there are no more warnings left.

Right, the commit aefb69b should fix 3 warnings about pragma in _zoneinfo.c.

@vstinner
Copy link
Member

Can you try to rebase your PR on the master branch? There are warnings which are already fixed in master.

@ammaraskar
Copy link
Member Author

Rebased, looks like the "Unchanged files with check annotations" section is gone now. And there don't seem to be any more warnings highlighted in the log.

Test failure looks unrelated.

@zware zware merged commit 1031f23 into python:master Dec 28, 2020
@vstinner
Copy link
Member

This change looks like a nice enhancement! I hate having to dig into compiler logs to spot some new warnings. The "problem matcher" thing looks convenient.

adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
…H-18532)

This makes warnings and errors from the compiler very prominent so this should help prevent warnings from sneaking into the code base and catch them in review. See https://discuss.python.org/t/using-github-problem-matchers-to-catch-warnings-early/4254 for more details

You can see a demo of this in action here: https://github.com/ammaraskar/cpython/pull/15/files#diff-9ba2eeca0f254ece0a9df4d7cb68e870

GCC and Sphinx matchers have previously been added in pythonGH-18567 and pythonGH-20325, respectively.
@nam20485

This comment has been minimized.

@python python locked and limited conversation to collaborators Oct 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants