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

Snap to Roslyn 4.4 #4194

Merged
merged 1 commit into from
Jul 20, 2023
Merged

Snap to Roslyn 4.4 #4194

merged 1 commit into from
Jul 20, 2023

Conversation

geeknoid
Copy link
Member

@geeknoid geeknoid commented Jul 20, 2023

This means folks trying to use the generators and analyzers will need to be using at minimum the .NET 7 SDK.

Resolves #4127
Closes #4183 as superseded.

Microsoft Reviewers: Open in CodeFlow

@ghost ghost assigned geeknoid Jul 20, 2023
@xakep139
Copy link
Contributor

This change essentially means that we will force folks to use .NET 8 toolchain even if they are targeting netcoreapp3.1

@geeknoid
Copy link
Member Author

geeknoid commented Jul 20, 2023

No, this forces the .NET 7 toolchain, not .NET 8.

The option code generator, which is now in dotnet/runtime also requires the .NET 7 toolchain, so we're being consistent.

Note that code generators were introduced in .NET 5, so anybody using the code generators would at least be on .NET 5 SDK

@danmoseley
Copy link
Member

As noted offline this also forces newer Visual Studio as well. @marcpopMSFT exactly which VS version would be the minimum after this change?

Comment on lines +29 to +30
<ProjectReference Condition="'$(SkipExtraAnalyzers)' != 'true'" Include="$(MSBuildThisFileDirectory)\..\..\src\Analyzers\Microsoft.Analyzers.Extra\Microsoft.Analyzers.Extra.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" Private="false" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<ProjectReference Condition="'$(SkipLocalAnalyzers)' != 'true'" Include="$(MSBuildThisFileDirectory)\..\..\src\Analyzers\Microsoft.Analyzers.Local\Microsoft.Analyzers.Local.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" Private="false" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
Copy link
Member

Choose a reason for hiding this comment

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

❤️ the change of the names

We should rename the other analyzers and generators too. /ducks

Comment on lines +8 to +11
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.4.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.4.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.4.0" />
Copy link
Member

Choose a reason for hiding this comment

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

If all of these packages should be on the same version then it's worth considering introducing a variable (put it in /eng/Versions.props) and use the variable here.

^^^^^^^^^^
SEE NOTE ABOVE.
Versions above this comment are updated automatically. Don't change them manually.
Versions below this comment are not managed by automation and can be changed as needed.
-->
<PropertyGroup Label="Manual">
</PropertyGroup>

Comment on lines 8 to +11

<PropertyGroup>
<SkipLocalAnalyzers>true</SkipLocalAnalyzers>
<AnalyzerLanguage>cs</AnalyzerLanguage>
<AnalyzerRoslynVersion>4.0</AnalyzerRoslynVersion>
<DefineConstants>$(DefineConstants);ROSLYN_4_0_OR_GREATER</DefineConstants>
<AnalyzerLanguage>cs</AnalyzerLanguage>
Copy link
Member

Choose a reason for hiding this comment

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

There's an established naming convention in the SDK to suffix assemblies with the language. E.g.,

  • Microsoft.Analyzers.Local.dll implies a language agnostic analyzers,
  • Microsoft.Analyzers.Local.CSharp.dll implies C#-specific analyzers.

It'd worth considering adapting to the same convention.

</PropertyGroup>

<PropertyGroup>
<AnalyzerLanguage>cs</AnalyzerLanguage>
Copy link
Member

Choose a reason for hiding this comment

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

Are we applies this property explicitly to all the analyzer projects? If so, consider declaring it centrally in one of the Directory.Build.props.

@marcpopMSFT
Copy link
Member

As noted offline this also forces newer Visual Studio as well. @marcpopMSFT exactly which VS version would be the minimum after this change?

The 4.4 Roslyn matches with the 17.4 VS which ships with the 7.0.1xx SDK if that's what you're asking.

@geeknoid geeknoid merged commit 5c9ce6e into main Jul 20, 2023
6 checks passed
@geeknoid geeknoid deleted the geeknoid/roslyn branch July 20, 2023 23:54
@ghost ghost added this to the 8.0 RC1 milestone Jul 20, 2023
@danmoseley
Copy link
Member

Thanks @marcpopMSFT that was what I was asking. Essentially they need to have VS 2022 because if they're <17.4 they can presumably update.

@ScottThurlow do we have any data on the versions of VS that internal folks use when consuming these bits? Put another way, are more than a trivial proportion using VS2019?

btw I'm assuming this PR only concerns analyzers and generators that folks consuming our components need, I don't think we care about anything that's only relevant to building them themselves.

@danmoseley
Copy link
Member

eh, we can move this conversation to the original chat. I should have asked there.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resolve RS1024 suppression
6 participants