diff --git a/src/SourceBuild/tarball/patches/roslyn/0001-Apply-arcade-powered-source-build-patches-55823.patch b/src/SourceBuild/tarball/patches/roslyn/0001-Apply-arcade-powered-source-build-patches-55823.patch new file mode 100644 index 000000000..6afcfa6db --- /dev/null +++ b/src/SourceBuild/tarball/patches/roslyn/0001-Apply-arcade-powered-source-build-patches-55823.patch @@ -0,0 +1,27 @@ +From 1a415d2019d74bcf009134326d1c25798589de64 Mon Sep 17 00:00:00 2001 +From: Chris Rummel +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. +--- + .../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. + --> + +- ++ + + + +-- +2.31.1 + diff --git a/src/SourceBuild/tarball/patches/roslyn/0001-Patch-out-version-check-for-source-build-scenarios.patch b/src/SourceBuild/tarball/patches/roslyn/0001-Patch-out-version-check-for-source-build-scenarios.patch deleted file mode 100644 index 350692304..000000000 --- a/src/SourceBuild/tarball/patches/roslyn/0001-Patch-out-version-check-for-source-build-scenarios.patch +++ /dev/null @@ -1,27 +0,0 @@ -From eb67cc234b0073d8b210c3ae42b5efe481bd0900 Mon Sep 17 00:00:00 2001 -From: Chris Rummel -Date: Tue, 20 Jul 2021 09:41:52 -0500 -Subject: [PATCH 1/2] Patch out version check for source-build scenarios. - -The immediate cause for removing this was that NuGet is not yet built at this point in the source-build process. Roslyn tries to use a reference package to run this task but fails (the usual "reference packages cannot be used at runtime" error). Additionally, this is not really a valid check in source-build - we give each repo the SDK and MSBuild that we expect it to use, and want to override its opinions about what it should be using. - ---- - eng/targets/Imports.targets | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/eng/targets/Imports.targets b/eng/targets/Imports.targets -index 15b067deb04..303b10c40cd 100644 ---- a/eng/targets/Imports.targets -+++ b/eng/targets/Imports.targets -@@ -159,7 +159,7 @@ - - - -- -+ - - - --- -2.18.0 - diff --git a/src/SourceBuild/tarball/patches/roslyn/0002-Don-t-include-desktop-artifacts-that-don-t-exist-in-.patch b/src/SourceBuild/tarball/patches/roslyn/0002-Don-t-include-desktop-artifacts-that-don-t-exist-in-.patch deleted file mode 100644 index cd22d08b5..000000000 --- a/src/SourceBuild/tarball/patches/roslyn/0002-Don-t-include-desktop-artifacts-that-don-t-exist-in-.patch +++ /dev/null @@ -1,65 +0,0 @@ -From a235579b23a9aaf3f30202a69e92b93f7c569107 Mon Sep 17 00:00:00 2001 -From: Chris Rummel -Date: Tue, 20 Jul 2021 14:20:14 -0500 -Subject: [PATCH 2/2] Don't include desktop artifacts that don't exist in - source-build. - -This fixes a bad intersection of a couple of things going on in the source-build Roslyn build. -- Roslyn.Extensions project that builds before this normally will restore a net46 version of System.Numerics.Vectors, but it sets it to CopyLocal and is building for net472, so this net46 DLL is output to the net472 folder. -- We don't build Roslyn.Extensions for net472 for other reasons, so we are missing this DLL but not the output from that project (we just get the .NET Core folders). -- DesktopCompilerArtifacts tries to specifically call out the System.Numerics.Vectors (and some other) DLLs because they are treated differently (NGEN is not supported for them). -- So the missing DLL, instead of just being ignored because of a wildcard, comes up as error trying to build these packages. -- We want full-framework Roslyn artifacts downstream but we don't ever run the fullfx Roslyn compiler, so we need these packages but not the CopyLocal fullfx DLLs. - -So we keep the net472 build for these but remove the specifically-called out artifacts that we don't need. - ---- - .../Microsoft.Net.Compilers.Toolset.Package.csproj | 4 ++-- - .../Microsoft.Net.Compilers.Package.csproj | 6 +++--- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/NuGet/Microsoft.Net.Compilers.Toolset/Microsoft.Net.Compilers.Toolset.Package.csproj b/src/NuGet/Microsoft.Net.Compilers.Toolset/Microsoft.Net.Compilers.Toolset.Package.csproj -index 9e646ebab5b..7b598978fd1 100644 ---- a/src/NuGet/Microsoft.Net.Compilers.Toolset/Microsoft.Net.Compilers.Toolset.Package.csproj -+++ b/src/NuGet/Microsoft.Net.Compilers.Toolset/Microsoft.Net.Compilers.Toolset.Package.csproj -@@ -23,7 +23,7 @@ - - $(NoWarn);NU5100;NU5128 - -- <_DependsOn Condition="'$(TargetFramework)' == 'net472'">InitializeDesktopCompilerArtifacts -+ <_DependsOn Condition="'$(TargetFramework)' == 'net472' and '$(DotNetBuildFromSource)' != 'true'">InitializeDesktopCompilerArtifacts - <_DependsOn Condition="'$(TargetFramework)' == 'netcoreapp3.1'">InitializeCoreClrCompilerArtifacts - - -@@ -57,6 +57,6 @@ - - - -- -+ - - -diff --git a/src/NuGet/Microsoft.Net.Compilers/Microsoft.Net.Compilers.Package.csproj b/src/NuGet/Microsoft.Net.Compilers/Microsoft.Net.Compilers.Package.csproj -index 05f74e26ce6..c33e557c249 100644 ---- a/src/NuGet/Microsoft.Net.Compilers/Microsoft.Net.Compilers.Package.csproj -+++ b/src/NuGet/Microsoft.Net.Compilers/Microsoft.Net.Compilers.Package.csproj -@@ -31,13 +31,13 @@ - - - -- <_File Include="@(DesktopCompilerArtifact)" TargetDir="tools"/> -- <_File Include="@(DesktopCompilerResourceArtifact)" TargetDir="tools"/> -+ <_File Include="@(DesktopCompilerArtifact)" TargetDir="tools" Condition="'$(DotNetBuildFromSource)' != 'true'" /> -+ <_File Include="@(DesktopCompilerResourceArtifact)" TargetDir="tools" Condition="'$(DotNetBuildFromSource)' != 'true'" /> - <_File Include="$(MSBuildProjectDirectory)\build\**\*.*" TargetDir="build" /> - - - - - -- -+ - --- -2.18.0 -