Skip to content
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

add WarningsAsMessages, WarningsAsErrors, WarningsNotAsErrors and Tre… #10942

Merged
merged 10 commits into from
Nov 20, 2024

Conversation

SimaTian
Copy link
Member

@SimaTian SimaTian commented Nov 7, 2024

…atWarningsAsErrors to the engine (e.g. variant without prefix). test those so that nothing breaks

Fixes #10877

Context

adding MSBuildWarnings... variants without prefix to the engine.

Changes Made

added WarningsAsMessages, WarningsAsErrors, WarningsNotAsErrors, TreatWarningsAsErrors to the engine parsing.

Testing

added a series of unit tests to ensure that these are consistent with the original behavior
further added unit tests to test the interaction & compatibility between the two.

Notes

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…atWarningsAsErrors to the engine (e.g. variant without prefix). test those so that nothing breaks

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Optionally capture output in BuildProjectExpectFailure for better test
diagnosability.
Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

Pushed some changes to caputre more information from the tests you added (it wasn't done in the bulk of tests here but for new and modified tests I really want to push for capturing stuff, to improve diagnosability when they fail).

Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

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

This looks good
The reason I'm requesting changes is some code repetition that should be easy to extract; plus a bit confusing unit tests

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…Comments.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…prefix
Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

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

Looks good!

I have couple comments for consideration

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…prefix

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…prefix
@ViktorHofer
Copy link
Member

Does this also fix #10871 and #10873?

@SimaTian
Copy link
Member Author

#10873 yes, the other one I'm not sure but it looks similar enough. @rainersigwald ?

@SimaTian SimaTian merged commit 4dff69f into main Nov 20, 2024
10 checks passed
@SimaTian SimaTian deleted the respect-warningsAsErrors-and-others-without-prefix branch November 20, 2024 11:09
@rainersigwald
Copy link
Member

Yes, it fixes both of those.

@rainersigwald
Copy link
Member

/backport to vs17.12

Copy link
Contributor

Started backporting to vs17.12: https://github.com/dotnet/msbuild/actions/runs/11935160959

Copy link
Contributor

@rainersigwald backporting to vs17.12 failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: add WarningsAsMessages, WarningsAsErrors, WarningsNotAsErrors and TreatWarningsAsErrors to the engine (e.g. variant without prefix). test those so that nothing breaks
Applying: Optional output in BuildProjectExpectFailure
Applying: Capture output logging in new tests
Applying: working through the review. Some test improvements. Changewave used. Comments.
error: sha1 information is lacking or useless (src/Build/BackEnd/Components/RequestBuilder/RequestBuilder.cs).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0004 working through the review. Some test improvements. Changewave used. Comments.
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

Copy link
Contributor

@rainersigwald an error occurred while backporting to vs17.12, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

rainersigwald added a commit that referenced this pull request Nov 20, 2024
#10942)

* add WarningsAsMessages, WarningsAsErrors, WarningsNotAsErrors and TreatWarningsAsErrors to the engine (e.g. variant without prefix). test those so that nothing breaks

* Optional output in BuildProjectExpectFailure

Optionally capture output in BuildProjectExpectFailure for better test
diagnosability.

* Capture output logging in new tests

* working through the review. Some test improvements. Changewave used. Comments.

* addressing review comments

* final review round, minor test update

---------

Co-authored-by: Rainer Sigwald <raines@microsoft.com>
rainersigwald added a commit that referenced this pull request Nov 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
#10942)

* add WarningsAsMessages, WarningsAsErrors, WarningsNotAsErrors and TreatWarningsAsErrors to the engine (e.g. variant without prefix). test those so that nothing breaks

* Optional output in BuildProjectExpectFailure

Optionally capture output in BuildProjectExpectFailure for better test
diagnosability.

* Capture output logging in new tests

* working through the review. Some test improvements. Changewave used. Comments.

* addressing review comments

* final review round, minor test update

---------

Co-authored-by: Rainer Sigwald <raines@microsoft.com>
rainersigwald added a commit that referenced this pull request Nov 21, 2024
…rning properties (#11007)

Backports #10942 to vs17.12

* add WarningsAsMessages, WarningsAsErrors, WarningsNotAsErrors and TreatWarningsAsErrors to the engine (e.g. variant without prefix). test those so that nothing breaks

* Backport changwave 17.14 to 17.12

Normally we wouldn't have this changewave in this release, but because
we want to have a consistent changewave for behavior changed after
release, we're backporting it.

* Bump version

---------

Co-authored-by: Rainer Sigwald <raines@microsoft.com>
@SimaTian
Copy link
Member Author

I will revert this one temporarily to unblock msbuild-> sdk merging.

However from the discussion we've had about this, we still want this change. Unfortunately it might require some additional ground work before we can push it through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Solution doesn't respect WarningsNotAsErrors
5 participants