diff --git a/src/SourceBuild/tarball/patches/runtime/0001-Remove-RefOnly-dependency-versions.patch b/src/SourceBuild/tarball/patches/runtime/0001-Remove-RefOnly-dependency-versions.patch new file mode 100644 index 000000000000..d11be050a976 --- /dev/null +++ b/src/SourceBuild/tarball/patches/runtime/0001-Remove-RefOnly-dependency-versions.patch @@ -0,0 +1,266 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Eric Erhardt +Date: Fri, 8 Oct 2021 19:55:43 -0500 +Subject: [PATCH 1/2] Remove RefOnly dependency versions + +This allows for source-build to replace these versions with source-built versions. + +Note: Removing unnecessary MSBuild PackageReferences rather than updating the version of these unnecessary references. + +See https://github.com/dotnet/source-build/issues/2421 for details. +Backported to runtime with https://github.com/dotnet/runtime/pull/60315. +--- + eng/Versions.props | 14 ++++---------- + ...crosoft.DotNet.CoreSetup.Packaging.Tests.csproj | 2 +- + .../src/Microsoft.NETCore.Platforms.csproj | 5 ++--- + .../AndroidAppBuilder/AndroidAppBuilder.csproj | 5 +---- + src/tasks/AotCompilerTask/MonoAOTCompiler.csproj | 6 ++---- + src/tasks/AppleAppBuilder/AppleAppBuilder.csproj | 5 +---- + src/tasks/Crossgen2Tasks/Crossgen2Tasks.csproj | 7 ++----- + src/tasks/ILStripTask/ILStrip.csproj | 5 +---- + .../JsonToItemsTaskFactory.csproj | 5 +---- + .../RuntimeConfigParser/RuntimeConfigParser.csproj | 6 ++---- + src/tasks/WasmAppBuilder/WasmAppBuilder.csproj | 5 +---- + src/tasks/WasmBuildTasks/WasmBuildTasks.csproj | 5 +---- + .../WorkloadBuildTasks/WorkloadBuildTasks.csproj | 5 +---- + src/tasks/installer.tasks/installer.tasks.csproj | 6 +++--- + 14 files changed, 23 insertions(+), 58 deletions(-) + +diff --git a/eng/Versions.props b/eng/Versions.props +index 94a3045e604..d2c0d141056 100644 +--- a/eng/Versions.props ++++ b/eng/Versions.props +@@ -146,16 +146,10 @@ + 1.0.0-beta-build0015 + 1.0.4-preview6.19326.1 + 0.2.61701 +- +- 16.10.0 +- $(RefOnlyMicrosoftBuildVersion) +- $(RefOnlyMicrosoftBuildVersion) +- $(RefOnlyMicrosoftBuildVersion) +- 5.8.0 +- 5.8.0 ++ 16.10.0 ++ $(MicrosoftBuildVersion) ++ 5.8.0 ++ 5.8.0 + + 1.0.1-prerelease-00006 + 16.9.0-preview-20201201-01 +diff --git a/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj b/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj +index 8dcef20c22d..73a3fda2b55 100644 +--- a/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj ++++ b/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj +@@ -7,7 +7,7 @@ + + + +- ++ + + + +diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj +index 3872248843d..4968a69f531 100644 +--- a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj ++++ b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj +@@ -44,9 +44,8 @@ + + + +- +- +- ++ ++ + + + +diff --git a/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj b/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj +index de6a04a95f0..139d5672ee0 100644 +--- a/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj ++++ b/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj +@@ -11,10 +11,7 @@ + + + +- +- +- +- ++ + + + +diff --git a/src/tasks/AotCompilerTask/MonoAOTCompiler.csproj b/src/tasks/AotCompilerTask/MonoAOTCompiler.csproj +index 840115ca71b..caf34787a2d 100644 +--- a/src/tasks/AotCompilerTask/MonoAOTCompiler.csproj ++++ b/src/tasks/AotCompilerTask/MonoAOTCompiler.csproj +@@ -11,10 +11,8 @@ + $(NoWarn),CS8604,CS8602 + + +- +- +- +- ++ ++ + + + +diff --git a/src/tasks/AppleAppBuilder/AppleAppBuilder.csproj b/src/tasks/AppleAppBuilder/AppleAppBuilder.csproj +index 7ceb4480e1c..e28dafef5d8 100644 +--- a/src/tasks/AppleAppBuilder/AppleAppBuilder.csproj ++++ b/src/tasks/AppleAppBuilder/AppleAppBuilder.csproj +@@ -11,10 +11,7 @@ + + + +- +- +- +- ++ + + + +diff --git a/src/tasks/Crossgen2Tasks/Crossgen2Tasks.csproj b/src/tasks/Crossgen2Tasks/Crossgen2Tasks.csproj +index fcd5b20ab2c..ddddfadb593 100644 +--- a/src/tasks/Crossgen2Tasks/Crossgen2Tasks.csproj ++++ b/src/tasks/Crossgen2Tasks/Crossgen2Tasks.csproj +@@ -9,11 +9,8 @@ + $(NoWarn),CS8604,CS8602 + + +- +- +- +- +- ++ ++ + + + +diff --git a/src/tasks/ILStripTask/ILStrip.csproj b/src/tasks/ILStripTask/ILStrip.csproj +index bb9c41f692e..91b63a8c0a6 100644 +--- a/src/tasks/ILStripTask/ILStrip.csproj ++++ b/src/tasks/ILStripTask/ILStrip.csproj +@@ -8,10 +8,7 @@ + false + + +- +- +- +- ++ + + + +diff --git a/src/tasks/JsonToItemsTaskFactory/JsonToItemsTaskFactory.csproj b/src/tasks/JsonToItemsTaskFactory/JsonToItemsTaskFactory.csproj +index 17799fbf657..579682fd84f 100644 +--- a/src/tasks/JsonToItemsTaskFactory/JsonToItemsTaskFactory.csproj ++++ b/src/tasks/JsonToItemsTaskFactory/JsonToItemsTaskFactory.csproj +@@ -9,10 +9,7 @@ + + + +- +- +- +- ++ + + + +diff --git a/src/tasks/RuntimeConfigParser/RuntimeConfigParser.csproj b/src/tasks/RuntimeConfigParser/RuntimeConfigParser.csproj +index c07e367def6..074f89c415a 100644 +--- a/src/tasks/RuntimeConfigParser/RuntimeConfigParser.csproj ++++ b/src/tasks/RuntimeConfigParser/RuntimeConfigParser.csproj +@@ -10,10 +10,8 @@ + $(NoWarn),CS8604,CS8602 + + +- +- +- +- ++ ++ + + + +diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj b/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj +index 22a530b7de3..358de5541e3 100644 +--- a/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj ++++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj +@@ -19,10 +19,7 @@ + + + +- +- +- +- ++ + + + +diff --git a/src/tasks/WasmBuildTasks/WasmBuildTasks.csproj b/src/tasks/WasmBuildTasks/WasmBuildTasks.csproj +index 0f8b6c93993..fd88116ca0a 100644 +--- a/src/tasks/WasmBuildTasks/WasmBuildTasks.csproj ++++ b/src/tasks/WasmBuildTasks/WasmBuildTasks.csproj +@@ -6,10 +6,7 @@ + $(NoWarn),CA1050 + + +- +- +- +- ++ + + + + + +- +- +- +- ++ + + + + +- ++ + + + +- +- ++ ++ + + + diff --git a/src/SourceBuild/tarball/patches/runtime/0002-Eliminate-usages-of-pre-built-packages-during-source.patch b/src/SourceBuild/tarball/patches/runtime/0002-Eliminate-usages-of-pre-built-packages-during-source.patch new file mode 100644 index 000000000000..4bcdd21a2854 --- /dev/null +++ b/src/SourceBuild/tarball/patches/runtime/0002-Eliminate-usages-of-pre-built-packages-during-source.patch @@ -0,0 +1,191 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Eric Erhardt +Date: Tue, 12 Oct 2021 19:40:56 +0000 +Subject: [PATCH 2/2] Eliminate usages of pre-built packages during + source-build + +* Don't build MSBuild tasks for netfx during source-build +* Don't build Microsoft.Windows.Compatibility during source-build +* Don't build test projects during source-build +* Don't restore Microsoft.DiaSymReader.Native +* Don't build source generators that target older Roslyn versions +* Don't build ILStripTask since it uses a Mono.Cecil "sources" NuGet package that isn't part of source-build + +See https://github.com/dotnet/source-build/issues/2421 for details. +Backported to runtime with https://github.com/dotnet/runtime/pull/60315. +--- + Directory.Build.props | 4 ++++ + eng/Subsets.props | 2 +- + .../pkg/sfx/Microsoft.NETCore.App/Directory.Build.props | 2 +- + .../src/Microsoft.Extensions.Logging.Abstractions.csproj | 3 ++- + .../src/Microsoft.NETCore.Platforms.csproj | 4 ++-- + src/libraries/System.Text.Json/src/System.Text.Json.csproj | 3 ++- + src/libraries/src.proj | 5 +++++ + src/tasks/Directory.Build.props | 3 +++ + src/tasks/installer.tasks/installer.tasks.csproj | 6 +++--- + src/tasks/tasks.proj | 5 +++++ + 10 files changed, 28 insertions(+), 9 deletions(-) + +diff --git a/Directory.Build.props b/Directory.Build.props +index 58c7f876aea..c58a9d1a047 100644 +--- a/Directory.Build.props ++++ b/Directory.Build.props +@@ -52,6 +52,10 @@ + $(NetCoreAppCurrentIdentifier),Version=v$(NetCoreAppToolCurrentVersion) + Microsoft.NETCore.App + .NET $(NetCoreAppCurrentVersion) ++ ++ net472 ++ ++ + + + +diff --git a/eng/Subsets.props b/eng/Subsets.props +index a7c5fb0e96e..b2292ac98e6 100644 +--- a/eng/Subsets.props ++++ b/eng/Subsets.props +@@ -72,7 +72,7 @@ + host.native + + packs.product +- $(DefaultPacksSubsets)+packs.tests ++ $(DefaultPacksSubsets)+packs.tests + $(DefaultPacksSubsets)+packs.installers + + +diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props +index 15d09343b05..09069935a00 100644 +--- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props ++++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props +@@ -238,7 +238,7 @@ + + + +- ++ + + + + + +- ++ + + + +diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj +index 4968a69f531..b941586e3d6 100644 +--- a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj ++++ b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj +@@ -1,6 +1,6 @@ + + +- $(NetCoreAppToolCurrent);net472 ++ $(NetCoreAppToolCurrent);$(NetFrameworkToolCurrent) + + false + $(MSBuildProjectName) +@@ -21,7 +21,7 @@ + $(AdditionalRuntimeIdentifiers);$(OutputRID) + + +- ++ + + + +diff --git a/src/libraries/System.Text.Json/src/System.Text.Json.csproj b/src/libraries/System.Text.Json/src/System.Text.Json.csproj +index 4b7f0bc75ce..bba18ce24ed 100644 +--- a/src/libraries/System.Text.Json/src/System.Text.Json.csproj ++++ b/src/libraries/System.Text.Json/src/System.Text.Json.csproj +@@ -351,7 +351,8 @@ System.Text.Json.Utf8JsonReader + + + +- ++ + + + +diff --git a/src/libraries/src.proj b/src/libraries/src.proj +index 8b38ce5b449..4e0fea066f7 100644 +--- a/src/libraries/src.proj ++++ b/src/libraries/src.proj +@@ -14,6 +14,11 @@ + Microsoft.Windows.Compatibility\src\Microsoft.Windows.Compatibility.csproj" + Condition="'$(BuildAllConfigurations)' != 'true'" /> + ++ ++ <_allSrc Remove="Microsoft.Extensions.DependencyInjection.Specification.Tests\src\Microsoft.Extensions.DependencyInjection.Specification.Tests.csproj; ++ Microsoft.Windows.Compatibility\src\Microsoft.Windows.Compatibility.csproj" ++ Condition="'$(DotNetBuildFromSource)' == 'true'" /> ++ + ++ + net6.0 + + +diff --git a/src/tasks/installer.tasks/installer.tasks.csproj b/src/tasks/installer.tasks/installer.tasks.csproj +index 5cff57cdefb..98c370fdfed 100644 +--- a/src/tasks/installer.tasks/installer.tasks.csproj ++++ b/src/tasks/installer.tasks/installer.tasks.csproj +@@ -1,6 +1,6 @@ + + +- $(TargetFrameworkForNETCoreTasks);net461 ++ $(NetCoreAppToolCurrent);$(NetFrameworkToolCurrent) + false + false + +@@ -10,12 +10,12 @@ + + + +- ++ + + + + +- ++ + + + +diff --git a/src/tasks/tasks.proj b/src/tasks/tasks.proj +index 9c62f8b76b9..03a049e1bf4 100644 +--- a/src/tasks/tasks.proj ++++ b/src/tasks/tasks.proj +@@ -1,6 +1,11 @@ + + + ++ ++ ++ ++ + + +