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

dotnet-watch needs to be updated to newer analyzers #30786

Open
crummel opened this issue Feb 22, 2023 · 6 comments
Open

dotnet-watch needs to be updated to newer analyzers #30786

crummel opened this issue Feb 22, 2023 · 6 comments

Comments

@crummel
Copy link
Contributor

crummel commented Feb 22, 2023

It appears the DoNotCallToImmutableCollectionOnAnImmutableCollectionValueAnalyzer has updated its return type and this is causing an error in the 8.0.0 preview1 source-build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=179384&view=logs&jobId=61a52f3a-cec1-5bff-8c02-d8ba2c8bed99&j=61a52f3a-cec1-5bff-8c02-d8ba2c8bed99&t=53e46d9d-cfbd-5072-889d-e51560a71252

In some cases we just disable analyzers entirely for source-build so if that's an option in this case we could also do that.

@tmat @nagilson

Error:

   CSC : error AD0001: Analyzer 'Microsoft.NetCore.Analyzers.ImmutableCollections.DoNotCallToImmutableCollectionOnAnImmutableCollectionValueAnalyzer' threw an exception of type 'System.InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.ArrayTypeSymbol' to type 'Microsoft.CodeAnalysis.INamedTypeSymbol'.'. [/vmr/src/sdk/artifacts/source-build/self/src/src/BuiltInTools/dotnet-watch/dotnet-watch.csproj]
##[error]CSC(0,0): error AD0001: (NETCORE_ENGINEERING_TELEMETRY=Build) Analyzer 'Microsoft.NetCore.Analyzers.ImmutableCollections.DoNotCallToImmutableCollectionOnAnImmutableCollectionValueAnalyzer' threw an exception of type 'System.InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.ArrayTypeSymbol' to type 'Microsoft.CodeAnalysis.INamedTypeSymbol'.'.
    CSC : error AD0001: Analyzer 'Microsoft.NetCore.Analyzers.ImmutableCollections.DoNotCallToImmutableCollectionOnAnImmutableCollectionValueAnalyzer' threw an exception of type 'System.InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.ArrayTypeSymbol' to type 'Microsoft.CodeAnalysis.INamedTypeSymbol'.'. [/vmr/src/sdk/artifacts/source-build/self/src/src/BuiltInTools/dotnet-watch/dotnet-watch.csproj]
##[error]CSC(0,0): error AD0001: (NETCORE_ENGINEERING_TELEMETRY=Build) Analyzer 'Microsoft.NetCore.Analyzers.ImmutableCollections.DoNotCallToImmutableCollectionOnAnImmutableCollectionValueAnalyzer' threw an exception of type 'System.InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.ArrayTypeSymbol' to type 'Microsoft.CodeAnalysis.INamedTypeSymbol'.'.
   
@tmat
Copy link
Member

tmat commented Feb 22, 2023

@sharwell @mavasani

@crummel
Copy link
Contributor Author

crummel commented Feb 23, 2023

We think this will block any update of the SDK in installer as well as the source-build PR I linked - let me know if there's any wa yI can help to move it along.

@nagilson
Copy link
Member

nagilson commented Feb 23, 2023

I am not privy to the release schedule for 8.0, but I thought that most components were already in the middle of being flowed for the final builds.

IMO we should disable the analyzer now, but I don't know how much time there is left. Marc is OOF but I'd imagine he'd say the same thing if we are within the end of the timeframe.
@crummel are Matt / other involved parties aware of this?

Maybe it's something the watch team would want to take to servicing. It may be too late for that.

@sharwell
Copy link
Member

The .binlog will contain the full exception and stack trace. I couldn't find the one for this build though.

@sharwell
Copy link
Member

This issue was fixed by dotnet/roslyn-analyzers#6476

@marcpopMSFT marcpopMSFT added the untriaged Request triage from a team member label Mar 8, 2023
@marcpopMSFT marcpopMSFT self-assigned this Mar 8, 2023
@marcpopMSFT marcpopMSFT added Area-Watch and removed untriaged Request triage from a team member labels Mar 8, 2023
@marcpopMSFT marcpopMSFT removed their assignment Mar 8, 2023
@crummel
Copy link
Contributor Author

crummel commented Mar 8, 2023

Opened a PR to disable the analyzers in dotnet-watch for source-build at #31076. Once the roslyn-analyzers fix above is taken this won't be necessary but it also won't hurt anything to not run this analyzer in source-build.

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

No branches or pull requests

5 participants