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
MSBuild occasionally succeeds despite /WarnAsError:MSB3270 #5689
Comments
Note to self: Might need to lean on Mihai for this one. |
Related: #9825 |
Related: #3295 |
Related: #4842 |
This was likely resolved by #6174 and I can't repro this on 16.10 msbuild. Are you still seeing this on an updated MSBuild? To be specific, this should be available in vs16.10 preview 1 |
Closing this as resolved. |
I'm seeing this still in 17.0 with the repro I provided here in at least some cases. |
The reason this was reopened: There seems to be a difference between Versions: |
Can confirm this still happens.
Investigation NotesAfter quite a bit of digging I don't see anything wrong with the way that the SDK logs the error. It correctly gets all the way to logging an error into the logging service here, which goes into
It's worth noting that the first warning getting logged (the one that should error) hits line 1191, whereas the second (the one that doesn't fail) hits line 1198. It's worth noting because msbuild/src/Build/BackEnd/Components/Logging/LoggingService.cs Lines 1178 to 1201 in d14b74d
|
This issue resurfaced again: dotnet/installer#8735 |
Fixes #8735, possibly #5689, #2845 Context There were race condition when ProjectFinished log message has been processed after BuildResult event. Even though ProjectFinished log message event is always send before BuildResult event from Node, because ProjectFinished is asyncronously routed by LoggingService reversing order can and do often happen. Changes Made Updating _overallBuildSuccess in one place when submission is considered to be done and assumed its final state. Testing Can't local repro.
Issue Description
When running MSBuild with /WarnAsError:MSB3270, MSBuild will occasionally succeed, despite warnings being promoted into an errors.
I do not observe this behavior with /graph:true
Steps to Reproduce
I notice there are many other issues similar to this one, so I took it upon myself to construct a reliable reproduction of the issue.
WarnAsErrorTest.zip
The code attached contains a really simple C# solution (.NET Framework 4.7.2 console application) which deliberately has misaligned platforms.
I have included a powershell script, test.ps1, which can be run with /graph:false
or with /graph:true
Expected Behavior
Regardless of whether or not I am using /graph:true, MSBuild should fail in a deterministic manner
Actual Behavior
MSBuild fails most of the time, but occasionally succeeds.
Versions & Configurations
pwsh v7.0.3
I recommend /graph:true to anyone experiencing this problem.
I understand the historic justification for having /graph:false be default, but /graph:true seems much more sane now.
The text was updated successfully, but these errors were encountered: