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

Remove duplicate validation logic #42769

Merged
merged 1 commit into from
Mar 26, 2020
Merged

Conversation

jaredpar
Copy link
Member

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 #42465

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
@jaredpar jaredpar marked this pull request as ready for review March 25, 2020 19:36
@jaredpar jaredpar requested a review from a team as a code owner March 25, 2020 19:36
@jaredpar
Copy link
Member Author

@dotnet/roslyn-compiler @jasonmalinowski PTAL

Copy link
Member

@jasonmalinowski jasonmalinowski left a 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!

Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

LGTM Thanks

@jcouv jcouv self-assigned this Mar 25, 2020
@jaredpar
Copy link
Member Author

I'm OK with this if you're OK with this!

@rainersigwald is okay with this so who am I to dispute?

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.

No pressure! 😅

@agocke
Copy link
Member

agocke commented Mar 25, 2020

@jaredpar Is there a Csc/Vbc task test? And a command line test that demonstrates our resilience?

@jaredpar
Copy link
Member Author

@agocke

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.

@agocke
Copy link
Member

agocke commented Mar 25, 2020

@jaredpar
Copy link
Member Author

@agocke

Tests to just verify the files are passed multiple times?

@jasonmalinowski
Copy link
Member

The compiler is actually tolerant of duplicate source files, it just emits a warning.

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

@agocke
Copy link
Member

agocke commented Mar 26, 2020

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.

@jaredpar jaredpar merged commit 559ade0 into dotnet:master Mar 26, 2020
@ghost ghost added this to the Next milestone Mar 26, 2020
@jaredpar jaredpar deleted the dedupe-logic branch March 26, 2020 03:22
@jaredpar
Copy link
Member Author

@jasonmalinowski

Which case comparison was it using in that case?

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
without breaking compat was that the compiler always compares file paths case insensitive. I'd prefer the other but I fear that would definitely break compat.

@rainersigwald
Copy link
Member

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.

@sharwell sharwell modified the milestones: Next, temp, 16.6.P3 Apr 6, 2020
wli3 pushed a commit to dotnet/sdk that referenced this pull request Apr 10, 2020
This test is testing CSC behavior. It does not test SDK code.
The behaivor is also changed due to dotnet/roslyn#42769
agocke added a commit to dotnet/sdk that referenced this pull request May 5, 2020
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
dotnet-maestro bot added a commit to dotnet/sdk that referenced this pull request May 6, 2020
…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>
wli3 pushed a commit to dotnet/sdk that referenced this pull request May 17, 2020
This test is testing CSC behavior. It does not test SDK code.
The behaivor is also changed due to dotnet/roslyn#42769
aik-jahoda pushed a commit to dotnet/sdk that referenced this pull request May 18, 2020
This test is testing CSC behavior. It does not test SDK code.
The behaivor is also changed due to dotnet/roslyn#42769
dotnet-maestro bot added a commit to dotnet/sdk that referenced this pull request May 18, 2020
…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>
nohwnd pushed a commit to nohwnd/sdk that referenced this pull request May 18, 2020
This test is testing CSC behavior. It does not test SDK code.
The behaivor is also changed due to dotnet/roslyn#42769
ghost pushed a commit to dotnet/sdk that referenced this pull request May 18, 2020
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>
nohwnd pushed a commit to nohwnd/sdk that referenced this pull request May 19, 2020
This test is testing CSC behavior. It does not test SDK code.
The behaivor is also changed due to dotnet/roslyn#42769
ViktorHofer pushed a commit to dotnet/sdk that referenced this pull request May 19, 2020
* 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>
wli3 pushed a commit to wli3/sdk that referenced this pull request Jun 11, 2020
This test is testing CSC behavior. It does not test SDK code.
The behaivor is also changed due to dotnet/roslyn#42769
ViktorHofer pushed a commit to dotnet/sdk that referenced this pull request Jul 27, 2020
* 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>
wtgodbe pushed a commit to dotnet/sdk that referenced this pull request Jul 29, 2020
* 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>
ViktorHofer pushed a commit to dotnet/sdk that referenced this pull request Jul 29, 2020
)

* 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>
nohwnd added a commit to nohwnd/sdk that referenced this pull request Jul 29, 2020
…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>
ViktorHofer pushed a commit to dotnet/sdk that referenced this pull request Jul 30, 2020
) (#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Project.AssemblyName does not accurately report assembly name.
6 participants