Skip to content

add WarningsAsMessages, WarningsAsErrors, WarningsNotAsErrors and Tre… - #10942

Merged
SimaTian merged 10 commits into
mainfrom
respect-warningsAsErrors-and-others-without-prefix
Nov 20, 2024
Merged

SimaTian merged 10 commits into
mainfrom
respect-warningsAsErrors-and-others-without-prefix

Conversation

@SimaTian

@SimaTian SimaTian commented Nov 7, 2024

Copy link
Copy Markdown
Contributor

…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

…atWarningsAsErrors to the engine (e.g. variant without prefix). test those so that nothing breaks
Comment thread src/Build/BackEnd/Components/RequestBuilder/RequestBuilder.cs Outdated
Comment thread src/Build.UnitTests/WarningsAsMessagesAndErrors_Tests.cs
Optionally capture output in BuildProjectExpectFailure for better test
diagnosability.

@rainersigwald rainersigwald left a comment

Copy link
Copy Markdown
Member

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).

@JanKrivanek JanKrivanek left a comment

Copy link
Copy Markdown
Member

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

Comment thread src/Build/BackEnd/Components/RequestBuilder/RequestBuilder.cs Outdated
Comment thread src/Build.UnitTests/WarningsAsMessagesAndErrors_Tests.cs

@JanKrivanek JanKrivanek left a comment

Copy link
Copy Markdown
Member

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

Comment thread src/Build/BackEnd/Components/RequestBuilder/RequestBuilder.cs Outdated
Comment thread src/Build/BackEnd/Components/RequestBuilder/RequestBuilder.cs Outdated
Comment thread src/Build.UnitTests/WarningsAsMessagesAndErrors_Tests.cs
Comment thread src/Build.UnitTests/WarningsAsMessagesAndErrors_Tests.cs
@ViktorHofer

Copy link
Copy Markdown
Member

Does this also fix #10871 and #10873?

@SimaTian

Copy link
Copy Markdown
Contributor 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
@SimaTian
SimaTian deleted the respect-warningsAsErrors-and-others-without-prefix branch November 20, 2024 11:09
@rainersigwald

Copy link
Copy Markdown
Member

Yes, it fixes both of those.

@rainersigwald

Copy link
Copy Markdown
Member

/backport to vs17.12

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
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!

@github-actions

Copy link
Copy Markdown
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 21, 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
…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
Copy Markdown
Contributor 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