-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Remove duplicate validation logic #42769
Conversation
The MSBuild task for csc / vbc compilers contained validation to detect that no duplicate source files or resources were provided. This validation is duplicated with logic in the compiler hence it's unnecessary. Further this use came during `ValidateParameters` which means that when it fails the underlying task doesn't actually execute. This means that design time builds don't process the project in the face of that type of error which blocks a number of Visual Studio based scenarios. closes dotnet#42465
@dotnet/roslyn-compiler @jasonmalinowski PTAL |
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'm OK with this if you're OK with this!
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.
LGTM Thanks
@rainersigwald is okay with this so who am I to dispute? |
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.
No pressure! 😅
@jaredpar Is there a Csc/Vbc task test? And a command line test that demonstrates our resilience? |
There are existing compiler tests:
Similar tests exist for VB. The C# tests actually demonstrate another reason for removing this check. The compiler is actually tolerant of duplicate source files, it just emits a warning. There were no Task tests. |
@jaredpar do you want to add one to http://sourceroslyn.io/#Microsoft.Build.Tasks.CodeAnalysis.UnitTests/CscTests.cs,691dd5a92870fd19? 😄 |
Tests to just verify the files are passed multiple times? |
Which case comparison was it using in that case? I was surprised this was doing case-insensitive, because you were just in trouble if you had two differently cased files on Linux. At least if it's a warning in the compiler you have some hope. (I of course pray nobody is relying on this, but alas....) |
Ah, I see, so the task unit test wouldnt' exercise the code path that was previously causing the problem. OK, in that case we can proceed, but it would be good to see how we can add a regression test for the scenario. |
The compiler is rather inconsistent in how it applies case to paths. Back when I re-joined Roslyn I tried to rationalize it but eventually gave up. I think the only rationalization we could ever really add |
That story is very familiar to me; it's basically where we've landed in MSBuild. Don't distinguish files based only on case for .NET code: that way lies pain. |
This test is testing CSC behavior. It does not test SDK code. The behaivor is also changed due to dotnet/roslyn#42769
Roslyn changed to providing an error on duplicate items in the build task to producing a warning. This change updates the test baseline to match the new Roslyn behavior from dotnet/roslyn#42769
…1560) * Update dependencies from https://github.com/dotnet/roslyn build 20200424.5 - Microsoft.Net.Compilers.Toolset: 3.6.0-2.20153.4 -> 3.6.0-4.20224.5 * Update test to match Roslyn change Roslyn changed to providing an error on duplicate items in the build task to producing a warning. This change updates the test baseline to match the new Roslyn behavior from dotnet/roslyn#42769 * Fix typo * Also assert that the build succeeds * Another typo * Disable test on Full Framework The behavior of Roslyn changed, so we need to disable this test on Full Framework because the VS we use for CI doesn't have the Roslyn change yet. Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Andy Gocke <angocke@microsoft.com> Co-authored-by: Daniel Plaisted <dsplaisted@gmail.com>
This test is testing CSC behavior. It does not test SDK code. The behaivor is also changed due to dotnet/roslyn#42769
This test is testing CSC behavior. It does not test SDK code. The behaivor is also changed due to dotnet/roslyn#42769
…1672) * Update dependencies from https://github.com/dotnet/roslyn build 20200512.2 Microsoft.Net.Compilers.Toolset From Version 3.6.0-2.20153.4 -> To Version 3.7.0-1.20262.2 * Remove unnecessary test This test is testing CSC behavior. It does not test SDK code. The behaivor is also changed due to dotnet/roslyn#42769 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: William Li <wul@microsoft.com>
This test is testing CSC behavior. It does not test SDK code. The behaivor is also changed due to dotnet/roslyn#42769
This test is testing CSC behavior. It does not test SDK code. The behaivor is also changed due to dotnet/roslyn#42769 Co-authored-by: William Li <wul@microsoft.com>
This test is testing CSC behavior. It does not test SDK code. The behaivor is also changed due to dotnet/roslyn#42769
* Add option to enable hang and crash dumps from commandline * Generate resx * Remove unnecessary test This test is testing CSC behavior. It does not test SDK code. The behaivor is also changed due to dotnet/roslyn#42769 * Remove unnecessary test This test is testing CSC behavior. It does not test SDK code. The behaivor is also changed due to dotnet/roslyn#42769 Co-authored-by: William Li <wul@microsoft.com>
This test is testing CSC behavior. It does not test SDK code. The behaivor is also changed due to dotnet/roslyn#42769
* Remove unnecessary test This test is testing CSC behavior. It does not test SDK code. The behaivor is also changed due to dotnet/roslyn#42769 * Manually update arcade dependencies * Fix Passed / Failed indicators Co-authored-by: William Li <wul@microsoft.com>
* Remove unnecessary test This test is testing CSC behavior. It does not test SDK code. The behaivor is also changed due to dotnet/roslyn#42769 * Update dependencies from https://github.com/microsoft/vstest build 20200728-02 Microsoft.NET.Test.Sdk From Version 16.7.0-release-20200612-02 -> To Version 16.8.0-preview-20200728-02 * Fix more strings * Revert output where normat output is used * Fix even more output Co-authored-by: William Li <wul@microsoft.com> Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
) * Remove unnecessary test This test is testing CSC behavior. It does not test SDK code. The behaivor is also changed due to dotnet/roslyn#42769 * Add --blame options to dotnet vstest and dotnet test + dll * Uncomment other test cases * Fix comma * Refactor to recude code repetition * Ensure that legacy Blame syntax still works Co-authored-by: William Li <wul@microsoft.com>
…net#12690) * Remove unnecessary test This test is testing CSC behavior. It does not test SDK code. The behaivor is also changed due to dotnet/roslyn#42769 * Add --blame options to dotnet vstest and dotnet test + dll * Uncomment other test cases * Fix comma * Refactor to recude code repetition * Ensure that legacy Blame syntax still works Co-authored-by: William Li <wul@microsoft.com>
) (#12699) * Remove unnecessary test This test is testing CSC behavior. It does not test SDK code. The behaivor is also changed due to dotnet/roslyn#42769 * Add --blame options to dotnet vstest and dotnet test + dll * Uncomment other test cases * Fix comma * Refactor to recude code repetition * Ensure that legacy Blame syntax still works Co-authored-by: William Li <wul@microsoft.com> Co-authored-by: William Li <wul@microsoft.com>
The MSBuild task for csc / vbc compilers contained validation to detect
that no duplicate source files or resources were provided. This
validation is duplicated with logic in the compiler hence it's
unnecessary.
Further this use came during
ValidateParameters
which means that whenit fails the underlying task doesn't actually execute. This means that
design time builds don't process the project in the face of that type of
error which blocks a number of Visual Studio based scenarios.
closes #42465