Merge branch 'release/6.0.2xx' into main

This commit is contained in:
Jason Zhai 2021-12-06 19:07:32 -08:00
commit d73606388e
7 changed files with 103 additions and 39 deletions

View file

@ -1,6 +1,6 @@
{
"tools": {
"dotnet": "6.0.100"
"dotnet": "6.0.200-preview.21603.2"
},
"msbuild-sdks": {
"Microsoft.Build.CentralPackageVersions": "2.0.1",

View file

@ -48,8 +48,7 @@ configuration="Release"
excludeNonWebTests=false
excludeWebTests=false
excludeWebNoHttpsTests=false
# Re-enable once https://github.com/dotnet/sdk/issues/22734 is fixed.
excludeWebHttpsTests=true
excludeWebHttpsTests=false
excludeLocalTests=false
excludeOnlineTests=false
devCertsVersion="$DEV_CERTS_VERSION_DEFAULT"

View file

@ -0,0 +1,43 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MichaelSimons <msimons@microsoft.com>
Date: Mon, 6 Dec 2021 18:39:25 +0000
Subject: [PATCH] WebHost delegate nullability
Addresses the following errors:
src/Hosting/Hosting/src/Internal/WebHost.cs(83,56): error CS8621: Nullability of reference types in return type of 'lambda expression' doesn't match the target delegate 'Func<IServiceProvider, IHostApplicationLifetime?>' (possibly because of nullability attributes).
src/Hosting/Hosting/src/Internal/WebHost.cs(86,56): error CS8621: Nullability of reference types in return type of 'lambda expression' doesn't match the target delegate 'Func<IServiceProvider, IApplicationLifetime?>' (possibly because of nullability attributes).
src/Hosting/Hosting/src/Internal/WebHost.cs(88,56): error CS8621: Nullability of reference types in return type of 'lambda expression' doesn't match the target delegate 'Func<IServiceProvider, IApplicationLifetime?>' (possibly because of nullability attributes).
Cherry-pick of WebHost only changes made under https://github.com/dotnet/aspnetcore/commit/13a460820e90c8f3e90eb4fdbbb3de671389bf0c#diff-6ef451f2ae3e04d73dde362bdf9de6b101aef95e3a4f5190e5c96967d683aef9
---
src/Hosting/Hosting/src/Internal/WebHost.cs | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/Hosting/Hosting/src/Internal/WebHost.cs b/src/Hosting/Hosting/src/Internal/WebHost.cs
index ca52bd1f40..643d03e8af 100644
--- a/src/Hosting/Hosting/src/Internal/WebHost.cs
+++ b/src/Hosting/Hosting/src/Internal/WebHost.cs
@@ -79,16 +79,14 @@ namespace Microsoft.AspNetCore.Hosting
_hostingServiceProvider = hostingServiceProvider;
_applicationServiceCollection.AddSingleton<ApplicationLifetime>();
// There's no way to to register multiple service types per definition. See https://github.com/aspnet/DependencyInjection/issues/360
-#pragma warning disable CS8634 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'class' constraint.
- _applicationServiceCollection.AddSingleton(services
- => services.GetService<ApplicationLifetime>() as IHostApplicationLifetime);
+ _applicationServiceCollection.AddSingleton<IHostApplicationLifetime>(services
+ => services.GetService<ApplicationLifetime>()!);
#pragma warning disable CS0618 // Type or member is obsolete
- _applicationServiceCollection.AddSingleton(services
- => services.GetService<ApplicationLifetime>() as AspNetCore.Hosting.IApplicationLifetime);
- _applicationServiceCollection.AddSingleton(services
- => services.GetService<ApplicationLifetime>() as Extensions.Hosting.IApplicationLifetime);
+ _applicationServiceCollection.AddSingleton<AspNetCore.Hosting.IApplicationLifetime>(services
+ => services.GetService<ApplicationLifetime>()!);
+ _applicationServiceCollection.AddSingleton<Extensions.Hosting.IApplicationLifetime>(services
+ => services.GetService<ApplicationLifetime>()!);
#pragma warning restore CS0618 // Type or member is obsolete
-#pragma warning restore CS8634 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'class' constraint.
_applicationServiceCollection.AddSingleton<HostedServiceExecutor>();
}

View file

@ -7,13 +7,29 @@ Removes prebuilts.
Background Issue: https://github.com/dotnet/source-build/issues/2542
---
eng/dependabot/Packages.props | 3 ---
src/Build/Microsoft.Build.csproj | 4 +++-
src/Directory.BeforeCommon.targets | 2 +-
src/Framework/Microsoft.Build.Framework.csproj | 2 +-
src/Samples/Directory.Build.props | 1 +
src/Tasks/Microsoft.Build.Tasks.csproj | 4 +++-
src/Utilities/Microsoft.Build.Utilities.csproj | 2 +-
5 files changed, 9 insertions(+), 4 deletions(-)
7 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/eng/dependabot/Packages.props b/eng/dependabot/Packages.props
index a1f21de26..ff74d6e7f 100644
--- a/eng/dependabot/Packages.props
+++ b/eng/dependabot/Packages.props
@@ -22,9 +22,6 @@
<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'">
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.2" />
- </ItemGroup>
-
- <ItemGroup>
<GlobalPackageReference Include="Microsoft.VisualStudio.SDK.EmbedInteropTypes" Version="15.0.15" PrivateAssets="All" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'" />
</ItemGroup>
diff --git a/src/Build/Microsoft.Build.csproj b/src/Build/Microsoft.Build.csproj
index d08e337c5..3b173aee5 100644
--- a/src/Build/Microsoft.Build.csproj
@ -43,6 +59,19 @@ index 913c97b12..320bffa56 100644
<DefineConstants>$(DefineConstants);FEATURE_MSCOREE</DefineConstants>
</PropertyGroup>
diff --git a/src/Framework/Microsoft.Build.Framework.csproj b/src/Framework/Microsoft.Build.Framework.csproj
index df7556447..c7edff611 100644
--- a/src/Framework/Microsoft.Build.Framework.csproj
+++ b/src/Framework/Microsoft.Build.Framework.csproj
@@ -31,7 +31,7 @@
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<!-- Promote CompilerServices.Unsafe from the old version we get from System.Memory on net472. -->
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
- <PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" />
+ <PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Condition="'$(DotNetBuildFromSource)' != 'true'" />
<Reference Include="System.Xaml" />
</ItemGroup>
diff --git a/src/Samples/Directory.Build.props b/src/Samples/Directory.Build.props
index 6b9d6cd9f..317ef14a6 100644
--- a/src/Samples/Directory.Build.props

View file

@ -0,0 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Rainer Sigwald <raines@microsoft.com>
Date: Fri, 3 Dec 2021 14:24:03 -0600
Subject: [PATCH] Don't reference PublicApiAnalyzers in sourcebuild (#7118)
This package is only super relevant at PR-build time so it should
be fine to drop it from source-build scenarios. Fixes #7115.
Patch created from https://github.com/dotnet/msbuild/pull/7118
---
src/Directory.Build.targets | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets
index 2a840bfd7..bff6cc905 100644
--- a/src/Directory.Build.targets
+++ b/src/Directory.Build.targets
@@ -85,7 +85,7 @@
<ItemGroup Condition="'$(GenerateReferenceAssemblySource)' == 'true'">
<!-- Ensure API stability for shipping packages -->
- <PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="all" />
+ <PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="all" Condition="'$(DotNetBuildFromSource)' != 'true'" />
<AdditionalFiles Include="PublicAPI/$(PublicApiTfm)/PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI/$(PublicApiTfm)/PublicAPI.Unshipped.txt" />

View file

@ -1,33 +0,0 @@
From 1a415d2019d74bcf009134326d1c25798589de64 Mon Sep 17 00:00:00 2001
From: Chris Rummel <crummel@microsoft.com>
Date: Tue, 19 Oct 2021 11:39:32 -0500
Subject: [PATCH] Apply arcade-powered source-build patches (#55823)
Don't include desktop artifacts that don't exist in source-build.
Source-build doesn't have these artifacts available, even when we eventually will
build desktop TFMs, because Roslyn is one of the first builds in source-build.
Instead Roslyn is picking up reference packages that don't have the `lib` directory
which is causing a build failure. This disables the attempt to grab these desktop
artifacts so source-build just skips them instead.
Backported to roslyn with https://github.com/dotnet/roslyn/pull/55823
---
.../DesktopCompilerArtifacts.targets | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/NuGet/Microsoft.Net.Compilers.Toolset/DesktopCompilerArtifacts.targets b/src/NuGet/Microsoft.Net.Compilers.Toolset/DesktopCompilerArtifacts.targets
index c8b87ab6958..107ff051b51 100644
--- a/src/NuGet/Microsoft.Net.Compilers.Toolset/DesktopCompilerArtifacts.targets
+++ b/src/NuGet/Microsoft.Net.Compilers.Toolset/DesktopCompilerArtifacts.targets
@@ -20,7 +20,7 @@
VS training data to the assemblies they produce.
-->
- <Target Name="InitializeDesktopCompilerArtifacts">
+ <Target Name="InitializeDesktopCompilerArtifacts" Condition="'$(DotNetBuildFromSource)' != 'true'">
<ItemGroup>
<!-- The Roslyn built binaries must be taken from these locations because this is the location where signing occurs -->
--
2.31.1

View file

@ -22,7 +22,7 @@ index 3970bb4e9ea..e96beb550d2 100644
@@ -6,6 +6,7 @@
<OutputType>Exe</OutputType>
<RootNamespace>CSharpInteractive</RootNamespace>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
+ <UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
</PropertyGroup>
<ItemGroup Label="Project References">
@ -34,7 +34,7 @@ index 5bbdf7f03a7..5f732d71534 100644
@@ -6,6 +6,7 @@
<OutputType>Exe</OutputType>
<StartupObject>Sub Main</StartupObject>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
+ <UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
<RootNamespace></RootNamespace>
</PropertyGroup>