Browse Source

Update dependencies from dotnet/roslyn (#59182)

* Update dependencies from dotnet/roslyn

* Update SourceBuildPrebuiltBaseline.xml

* Fixup

* Address new Roslyn warnings

* Rename InterceptorsPreviewNamespaces to InterceptorsNamespaces

---------

Co-authored-by: Safia Abdalla <[email protected]>
William Godbe 1 year ago
parent
commit
51a8200ba8

+ 17 - 0
.globalconfig

@@ -12,3 +12,20 @@ dotnet_diagnostic.CA1310.severity = error
 
 # TODO: remove this - https://github.com/dotnet/aspnetcore/issues/47912
 dotnet_diagnostic.EnableGenerateDocumentationFile.severity = none
+
+# Referencing types that are defined in M.CA.Workspaces is not appropriate
+# for analyzers or source generators that might be invoked from a command
+# line build because editor-specific types in M.CA.Workspaces are not
+# available in the command line. By default, Roslyn enables RS1038
+# which does a strict check and throws if a reference to M.CA.Workspaces
+# is included in the assembly. Here, we opt for a more relaxed check that
+# validates if M.CA.Workspace type references are included in the specific
+# Roslyn components that might be loaded in command line builds. We do this
+# because we ship editor-specific components, like the routing completion
+# providers, in the shared framework and want to avoid the analyzers warning
+# on the M.CA.Workspaces reference required for their components even though
+# they are never loaded in command line builds. Note: the "relaxed" check that is
+# enabled here will actually examine the types loaded by each individually analyzer
+# to see if they are from a Workspaces assembly so it will take longer than the
+# greedier (and stricter) check for references overall.
+roslyn_correctness.assembly_reference_validation = relaxed

+ 10 - 10
eng/Version.Details.xml

@@ -345,26 +345,26 @@
       <SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
     </Dependency>
     <!-- Not updated automatically -->
-    <Dependency Name="Microsoft.CodeAnalysis.Common" Version="4.11.0-1.24218.5">
+    <Dependency Name="Microsoft.CodeAnalysis.Common" Version="4.13.0-3.24576.5">
       <Uri>https://github.com/dotnet/roslyn</Uri>
-      <Sha>afa1eb6821f62183651ab017b2f5c3fbeb934904</Sha>
+      <Sha>175121c035a6f057b9388737bb9b8755fb6dba7e</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.AspNetCore" Version="4.11.0-1.24218.5">
+    <Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.AspNetCore" Version="4.13.0-3.24576.5">
       <Uri>https://github.com/dotnet/roslyn</Uri>
-      <Sha>afa1eb6821f62183651ab017b2f5c3fbeb934904</Sha>
+      <Sha>175121c035a6f057b9388737bb9b8755fb6dba7e</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.11.0-1.24218.5">
+    <Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.13.0-3.24576.5">
       <Uri>https://github.com/dotnet/roslyn</Uri>
-      <Sha>afa1eb6821f62183651ab017b2f5c3fbeb934904</Sha>
+      <Sha>175121c035a6f057b9388737bb9b8755fb6dba7e</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.11.0-1.24218.5">
+    <Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.13.0-3.24576.5">
       <Uri>https://github.com/dotnet/roslyn</Uri>
-      <Sha>afa1eb6821f62183651ab017b2f5c3fbeb934904</Sha>
+      <Sha>175121c035a6f057b9388737bb9b8755fb6dba7e</Sha>
     </Dependency>
     <!-- Intermediate is necessary for source build. -->
-    <Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.11.0-1.24218.5">
+    <Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.13.0-3.24576.5">
       <Uri>https://github.com/dotnet/roslyn</Uri>
-      <Sha>afa1eb6821f62183651ab017b2f5c3fbeb934904</Sha>
+      <Sha>175121c035a6f057b9388737bb9b8755fb6dba7e</Sha>
       <SourceBuild RepoName="roslyn" ManagedOnly="true" />
     </Dependency>
     <Dependency Name="System.Composition" Version="10.0.0-alpha.1.24576.1">

+ 10 - 10
eng/Versions.props

@@ -154,11 +154,11 @@
     <MicrosoftEntityFrameworkCoreVersion>10.0.0-alpha.1.24576.4</MicrosoftEntityFrameworkCoreVersion>
     <MicrosoftEntityFrameworkCoreDesignVersion>10.0.0-alpha.1.24576.4</MicrosoftEntityFrameworkCoreDesignVersion>
     <!-- Packages from dotnet/roslyn -->
-    <MicrosoftCodeAnalysisCommonVersion>4.11.0-1.24218.5</MicrosoftCodeAnalysisCommonVersion>
-    <MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.11.0-1.24218.5</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
-    <MicrosoftCodeAnalysisCSharpVersion>4.11.0-1.24218.5</MicrosoftCodeAnalysisCSharpVersion>
-    <MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.11.0-1.24218.5</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
-    <MicrosoftSourceBuildIntermediateroslynVersion>4.11.0-1.24218.5</MicrosoftSourceBuildIntermediateroslynVersion>
+    <MicrosoftCodeAnalysisCommonVersion>4.13.0-3.24576.5</MicrosoftCodeAnalysisCommonVersion>
+    <MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.13.0-3.24576.5</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
+    <MicrosoftCodeAnalysisCSharpVersion>4.13.0-3.24576.5</MicrosoftCodeAnalysisCSharpVersion>
+    <MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.13.0-3.24576.5</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
+    <MicrosoftSourceBuildIntermediateroslynVersion>4.13.0-3.24576.5</MicrosoftSourceBuildIntermediateroslynVersion>
     <!-- Packages from NuGet/Nuget.client -->
     <!-- If you update these versions, make sure to also update https://github.com/dotnet/aspnetcore/blob/main/eng/SourceBuildPrebuiltBaseline.xml -->
     <NuGetPackagingVersion>6.2.4</NuGetPackagingVersion>
@@ -251,11 +251,11 @@
     <Analyzer_MicrosoftCodeAnalysisCSharpWorkspacesVersion>3.3.1</Analyzer_MicrosoftCodeAnalysisCSharpWorkspacesVersion>
     <!-- Pin the version of the M.CA dependencies that we utilize with a cutom version property $(MicrosoftCodeAnalysisVersion_LatestVS) to avoid automatically
     consuming the newest version of the packages when using the $(MicrosoftCodeAnalysisCSharpVersion) properties in source-build. -->
-    <MicrosoftCodeAnalysisVersion_LatestVS>4.11.0-1.24218.5</MicrosoftCodeAnalysisVersion_LatestVS>
-    <MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.11.0-1.24218.5</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
-    <MicrosoftCodeAnalysisCommonVersion>4.11.0-1.24218.5</MicrosoftCodeAnalysisCommonVersion>
-    <MicrosoftCodeAnalysisCSharpVersion>4.11.0-1.24218.5</MicrosoftCodeAnalysisCSharpVersion>
-    <MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.11.0-1.24218.5</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
+    <MicrosoftCodeAnalysisVersion_LatestVS>4.13.0-3.24576.5</MicrosoftCodeAnalysisVersion_LatestVS>
+    <MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.13.0-3.24576.5</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
+    <MicrosoftCodeAnalysisCommonVersion>4.13.0-3.24576.5</MicrosoftCodeAnalysisCommonVersion>
+    <MicrosoftCodeAnalysisCSharpVersion>4.13.0-3.24576.5</MicrosoftCodeAnalysisCSharpVersion>
+    <MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.13.0-3.24576.5</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
     <MicrosoftCodeAnalysisPublicApiAnalyzersVersion>3.3.3</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
     <MicrosoftCodeAnalysisCSharpAnalyzerTestingXUnitVersion>1.1.2-beta1.24121.1</MicrosoftCodeAnalysisCSharpAnalyzerTestingXUnitVersion>
     <MicrosoftCodeAnalysisCSharpCodeFixTestingXUnitVersion>1.1.2-beta1.24121.1</MicrosoftCodeAnalysisCSharpCodeFixTestingXUnitVersion>

+ 2 - 0
src/Framework/AspNetCoreAnalyzers/test/Infrastructure/WellKnownTypesTests.cs

@@ -82,7 +82,9 @@ class Program
         return stream;
     }
 
+#pragma warning disable RS1041 // Compiler extensions should be implemented in assemblies targeting netstandard2.0
     [DiagnosticAnalyzer(LanguageNames.CSharp)]
+#pragma warning restore RS1041 // Compiler extensions should be implemented in assemblies targeting netstandard2.0
     private class TestAnalyzer : DiagnosticAnalyzer
     {
         internal static readonly DiagnosticDescriptor SuccessDescriptor = new(

+ 1 - 1
src/Http/Http.Extensions/test/RequestDelegateGenerator/RequestDelegateCreationTestBase.cs

@@ -35,7 +35,7 @@ public abstract class RequestDelegateCreationTestBase : LoggedTest
 
     protected abstract bool IsGeneratorEnabled { get; }
 
-    internal static readonly CSharpParseOptions ParseOptions = new CSharpParseOptions(LanguageVersion.Preview).WithFeatures(new[] { new KeyValuePair<string, string>("InterceptorsPreviewNamespaces", "Microsoft.AspNetCore.Http.Generated") });
+    internal static readonly CSharpParseOptions ParseOptions = new CSharpParseOptions(LanguageVersion.Preview).WithFeatures(new[] { new KeyValuePair<string, string>("InterceptorsNamespaces", "Microsoft.AspNetCore.Http.Generated") });
     private static readonly Project _baseProject = CreateProject();
     private static readonly string _interceptsLocationAttributeRegex = @"\[global::System\.Runtime\.CompilerServices\.InterceptsLocationAttribute\(\d+, "".*""\)\]";