From 12e403f047dd447e960adc8d5dea0804141eae2a Mon Sep 17 00:00:00 2001 From: Davis Goodin Date: Fri, 22 Jan 2021 13:18:55 -0600 Subject: [PATCH] Add local build infra for arcade-powered source-build (stage 1) (#6837) * Initial source-build config * Exclude unneeded project. * Reassign MsbuildTaskMicrosoftCodeAnalysisCSharpVersion in offline build Arcade has a special version prop for CodeAnalysis.CSharp in GenFacades to try to match the version loaded by msbuild. In the offline build, this is simply the source-built version. * Disable ILRewrite step - this isn't built in source-build so it fails. * Override Microsoft.CodeAnalysis.CSharp pkg deps Microsoft.CodeAnalysis.CSharp brings in System.Collections.Immutable and System.Reflection.Metadata dependencies with prebuilt versions. We can override them to the version that we built. dotnet/arcade already defines SystemCollectionsImmutableVersion and SystemReflectionMetadataVersion, and it seems safe to use their values. See https://github.com/dotnet/source-build/pull/1881 Co-authored-by: Chris Rummel Co-authored-by: dseefeld --- eng/SourceBuild.props | 23 +++ eng/SourceBuildPrebuiltBaseline.xml | 5 + eng/Version.Details.xml | 6 + ...-arcade-remove-netcoreapp2.x-targets.patch | 195 ++++++++++++++++++ .../Microsoft.DotNet.AsmDiff.csproj | 1 + .../Microsoft.DotNet.CodeAnalysis.csproj | 10 + .../Microsoft.DotNet.GenFacades.csproj | 10 + ...rosoft.DotNet.GenFacadesILRewriter.targets | 2 +- 8 files changed, 251 insertions(+), 1 deletion(-) create mode 100644 eng/SourceBuild.props create mode 100644 eng/SourceBuildPrebuiltBaseline.xml create mode 100644 eng/source-build-patches/0001-arcade-remove-netcoreapp2.x-targets.patch diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props new file mode 100644 index 00000000000..db450605689 --- /dev/null +++ b/eng/SourceBuild.props @@ -0,0 +1,23 @@ + + + + arcade + true + + + + + + + + + + + diff --git a/eng/SourceBuildPrebuiltBaseline.xml b/eng/SourceBuildPrebuiltBaseline.xml new file mode 100644 index 00000000000..c1b6dfbf053 --- /dev/null +++ b/eng/SourceBuildPrebuiltBaseline.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7563d8e8eeb..34e747114f6 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -50,6 +50,7 @@ https://github.com/dotnet/sourcelink 0f3cb283e81fbdc930f0c7f7e52e5bc396d06a86 + https://github.com/dotnet/sourcelink @@ -67,5 +68,10 @@ https://github.com/dotnet/xliff-tasks e1e91c0934e46e11b87574e619905c090213761b + + https://github.com/dotnet/source-build-reference-packages + def2e2c6dc5064319250e2868a041a3dc07f9579 + + diff --git a/eng/source-build-patches/0001-arcade-remove-netcoreapp2.x-targets.patch b/eng/source-build-patches/0001-arcade-remove-netcoreapp2.x-targets.patch new file mode 100644 index 00000000000..5d230aee05e --- /dev/null +++ b/eng/source-build-patches/0001-arcade-remove-netcoreapp2.x-targets.patch @@ -0,0 +1,195 @@ +From da84f9fea3a1e7f8357b50036c707f29998f5e44 Mon Sep 17 00:00:00 2001 +From: Tom Deseyn +Date: Wed, 18 Nov 2020 20:22:19 +0100 +Subject: [PATCH] arcade: remove netcoreapp2.x targets + +--- + .../Microsoft.DotNet.Arcade.Sdk.csproj | 2 +- + src/Microsoft.DotNet.Arcade.Sdk/tools/BuildTasks.props | 2 +- + .../Microsoft.DotNet.Build.Tasks.Installers.csproj | 2 +- + .../build/Microsoft.DotNet.Build.Tasks.Installers.props | 2 +- + .../src/Microsoft.DotNet.Build.Tasks.Packaging.csproj | 4 ++-- + .../src/build/Packaging.common.targets | 2 +- + .../Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.csproj | 4 ++-- + .../Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.props | 2 +- + .../Microsoft.DotNet.CMake.Sdk.csproj | 2 +- + .../Microsoft.DotNet.GenFacades.csproj | 2 +- + .../build/Microsoft.DotNet.GenFacades.targets | 2 +- + .../tasks/Microsoft.DotNet.SourceBuild.Tasks.csproj | 2 +- + .../tasks/build/Microsoft.DotNet.SourceBuild.Tasks.props | 2 +- + 13 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/src/Microsoft.DotNet.Arcade.Sdk/Microsoft.DotNet.Arcade.Sdk.csproj b/src/Microsoft.DotNet.Arcade.Sdk/Microsoft.DotNet.Arcade.Sdk.csproj +index 69aaf16c..3419bc9c 100644 +--- a/src/Microsoft.DotNet.Arcade.Sdk/Microsoft.DotNet.Arcade.Sdk.csproj ++++ b/src/Microsoft.DotNet.Arcade.Sdk/Microsoft.DotNet.Arcade.Sdk.csproj +@@ -2,7 +2,7 @@ + + + net472;netcoreapp2.1 +- netcoreapp2.1 ++ net5.0 + preview + true + false +diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/BuildTasks.props b/src/Microsoft.DotNet.Arcade.Sdk/tools/BuildTasks.props +index a0c5dbc9..49cb86be 100644 +--- a/src/Microsoft.DotNet.Arcade.Sdk/tools/BuildTasks.props ++++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/BuildTasks.props +@@ -3,6 +3,6 @@ + + + $(MSBuildThisFileDirectory)net472\Microsoft.DotNet.Arcade.Sdk.dll +- $(MSBuildThisFileDirectory)netcoreapp2.1\Microsoft.DotNet.Arcade.Sdk.dll ++ $(MSBuildThisFileDirectory)net5.0\Microsoft.DotNet.Arcade.Sdk.dll + + +diff --git a/src/Microsoft.DotNet.Build.Tasks.Installers/Microsoft.DotNet.Build.Tasks.Installers.csproj b/src/Microsoft.DotNet.Build.Tasks.Installers/Microsoft.DotNet.Build.Tasks.Installers.csproj +index 3d3b0008..ecb95981 100644 +--- a/src/Microsoft.DotNet.Build.Tasks.Installers/Microsoft.DotNet.Build.Tasks.Installers.csproj ++++ b/src/Microsoft.DotNet.Build.Tasks.Installers/Microsoft.DotNet.Build.Tasks.Installers.csproj +@@ -2,7 +2,7 @@ + + + net472;netcoreapp2.1 +- netcoreapp2.1 ++ net5.0 + true + Latest + true +diff --git a/src/Microsoft.DotNet.Build.Tasks.Installers/build/Microsoft.DotNet.Build.Tasks.Installers.props b/src/Microsoft.DotNet.Build.Tasks.Installers/build/Microsoft.DotNet.Build.Tasks.Installers.props +index dde94af7..928a4ea7 100644 +--- a/src/Microsoft.DotNet.Build.Tasks.Installers/build/Microsoft.DotNet.Build.Tasks.Installers.props ++++ b/src/Microsoft.DotNet.Build.Tasks.Installers/build/Microsoft.DotNet.Build.Tasks.Installers.props +@@ -1,6 +1,6 @@ + + +- $(MSBuildThisFileDirectory)..\tools\netcoreapp2.1\Microsoft.DotNet.Build.Tasks.Installers.dll ++ $(MSBuildThisFileDirectory)..\tools\net5.0\Microsoft.DotNet.Build.Tasks.Installers.dll + $(MSBuildThisFileDirectory)..\tools\net472\Microsoft.DotNet.Build.Tasks.Installers.dll + $(MSBuildThisFileDirectory) + +diff --git a/src/Microsoft.DotNet.Build.Tasks.Packaging/src/Microsoft.DotNet.Build.Tasks.Packaging.csproj b/src/Microsoft.DotNet.Build.Tasks.Packaging/src/Microsoft.DotNet.Build.Tasks.Packaging.csproj +index 4a453ac5..dd42150e 100644 +--- a/src/Microsoft.DotNet.Build.Tasks.Packaging/src/Microsoft.DotNet.Build.Tasks.Packaging.csproj ++++ b/src/Microsoft.DotNet.Build.Tasks.Packaging/src/Microsoft.DotNet.Build.Tasks.Packaging.csproj +@@ -2,8 +2,8 @@ + + + netcoreapp2.1;net472 +- netcoreapp2.1 +- true ++ net5.0 ++ true + MSBuildSdk + false + true +diff --git a/src/Microsoft.DotNet.Build.Tasks.Packaging/src/build/Packaging.common.targets b/src/Microsoft.DotNet.Build.Tasks.Packaging/src/build/Packaging.common.targets +index d0430d9a..a7494f4e 100644 +--- a/src/Microsoft.DotNet.Build.Tasks.Packaging/src/build/Packaging.common.targets ++++ b/src/Microsoft.DotNet.Build.Tasks.Packaging/src/build/Packaging.common.targets +@@ -5,7 +5,7 @@ + + + +- $(MSBuildThisFileDirectory)../tools/netcoreapp2.1/ ++ $(MSBuildThisFileDirectory)../tools/net5.0/ + $(MSBuildThisFileDirectory)../tools/net472/ + $(MSBuildThisFileDirectory)runtime.json + +diff --git a/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.csproj b/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.csproj +index fe2bcdff..c37772d7 100644 +--- a/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.csproj ++++ b/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.csproj +@@ -2,8 +2,8 @@ + + + netcoreapp2.1;net472 +- netcoreapp2.1 +- true ++ net5.0 ++ true + false + true + Configuration system for cross-targeting projects. +diff --git a/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk/src/build/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.props b/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk/src/build/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.props +index 20423668..d10efa12 100644 +--- a/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk/src/build/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.props ++++ b/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk/src/build/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.props +@@ -8,7 +8,7 @@ + + + +- ..\tools\netcoreapp2.1\Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.dll ++ ..\tools\net5.0\Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.dll + ..\tools\net472\Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.dll + <_OriginalTargetFramework>$(TargetFramework) + (((netstandard|netcoreapp)[0-9\.]+)|(net[1-4][1-9\.]+))(-[^;]+) +diff --git a/src/Microsoft.DotNet.CMake.Sdk/Microsoft.DotNet.CMake.Sdk.csproj b/src/Microsoft.DotNet.CMake.Sdk/Microsoft.DotNet.CMake.Sdk.csproj +index 752679e0..bc50bcb1 100644 +--- a/src/Microsoft.DotNet.CMake.Sdk/Microsoft.DotNet.CMake.Sdk.csproj ++++ b/src/Microsoft.DotNet.CMake.Sdk/Microsoft.DotNet.CMake.Sdk.csproj +@@ -1,7 +1,7 @@ +  + + +- netcoreapp2.1 ++ net5.0 + false + + true +diff --git a/src/Microsoft.DotNet.GenFacades/Microsoft.DotNet.GenFacades.csproj b/src/Microsoft.DotNet.GenFacades/Microsoft.DotNet.GenFacades.csproj +index e5453014..e551f673 100644 +--- a/src/Microsoft.DotNet.GenFacades/Microsoft.DotNet.GenFacades.csproj ++++ b/src/Microsoft.DotNet.GenFacades/Microsoft.DotNet.GenFacades.csproj +@@ -2,7 +2,7 @@ + + + net472;netcoreapp2.1 +- netcoreapp2.1 ++ net5.0 + false + MSBuildSdk + false +diff --git a/src/Microsoft.DotNet.GenFacades/build/Microsoft.DotNet.GenFacades.targets b/src/Microsoft.DotNet.GenFacades/build/Microsoft.DotNet.GenFacades.targets +index 45c20f9f..b54fe253 100644 +--- a/src/Microsoft.DotNet.GenFacades/build/Microsoft.DotNet.GenFacades.targets ++++ b/src/Microsoft.DotNet.GenFacades/build/Microsoft.DotNet.GenFacades.targets +@@ -2,7 +2,7 @@ + + + +- <_MicrosoftDotNetGenFacadesTaskDir Condition="'$(MSBuildRuntimeType)' == 'core'">$(MSBuildThisFileDirectory)../tools/netcoreapp2.1/ ++ <_MicrosoftDotNetGenFacadesTaskDir Condition="'$(MSBuildRuntimeType)' == 'core'">$(MSBuildThisFileDirectory)../tools/net5.0/ + <_MicrosoftDotNetGenFacadesTaskDir Condition="'$(MSBuildRuntimeType)' != 'core'">$(MSBuildThisFileDirectory)../tools/net472/ + + +diff --git a/src/Microsoft.DotNet.SourceBuild/tasks/Microsoft.DotNet.SourceBuild.Tasks.csproj b/src/Microsoft.DotNet.SourceBuild/tasks/Microsoft.DotNet.SourceBuild.Tasks.csproj +index 64cb3c7e..b73becc7 100644 +--- a/src/Microsoft.DotNet.SourceBuild/tasks/Microsoft.DotNet.SourceBuild.Tasks.csproj ++++ b/src/Microsoft.DotNet.SourceBuild/tasks/Microsoft.DotNet.SourceBuild.Tasks.csproj +@@ -1,7 +1,7 @@ + + + +- net472;netcoreapp2.1 ++ net5.0 + MSBuildSdk + + +diff --git a/src/Microsoft.DotNet.SourceBuild/tasks/build/Microsoft.DotNet.SourceBuild.Tasks.props b/src/Microsoft.DotNet.SourceBuild/tasks/build/Microsoft.DotNet.SourceBuild.Tasks.props +index 83e15d39..65a68722 100644 +--- a/src/Microsoft.DotNet.SourceBuild/tasks/build/Microsoft.DotNet.SourceBuild.Tasks.props ++++ b/src/Microsoft.DotNet.SourceBuild/tasks/build/Microsoft.DotNet.SourceBuild.Tasks.props +@@ -1,7 +1,7 @@ + + + +- $(MSBuildThisFileDirectory)..\tools\netcoreapp2.1\$(MSBuildThisFileName).dll ++ $(MSBuildThisFileDirectory)..\tools\net5.0\$(MSBuildThisFileName).dll + $(MSBuildThisFileDirectory)..\tools\net472\$(MSBuildThisFileName).dll + + +-- +2.25.4 + diff --git a/src/Microsoft.DotNet.AsmDiff/Microsoft.DotNet.AsmDiff.csproj b/src/Microsoft.DotNet.AsmDiff/Microsoft.DotNet.AsmDiff.csproj index 57b042fc04e..0bd77580ca2 100644 --- a/src/Microsoft.DotNet.AsmDiff/Microsoft.DotNet.AsmDiff.csproj +++ b/src/Microsoft.DotNet.AsmDiff/Microsoft.DotNet.AsmDiff.csproj @@ -8,6 +8,7 @@ true true dotnet-asmdiff + true diff --git a/src/Microsoft.DotNet.CodeAnalysis/Microsoft.DotNet.CodeAnalysis.csproj b/src/Microsoft.DotNet.CodeAnalysis/Microsoft.DotNet.CodeAnalysis.csproj index 5cdfd539c11..d1ac5ccbb96 100644 --- a/src/Microsoft.DotNet.CodeAnalysis/Microsoft.DotNet.CodeAnalysis.csproj +++ b/src/Microsoft.DotNet.CodeAnalysis/Microsoft.DotNet.CodeAnalysis.csproj @@ -12,6 +12,16 @@ + + + + + + diff --git a/src/Microsoft.DotNet.GenFacades/Microsoft.DotNet.GenFacades.csproj b/src/Microsoft.DotNet.GenFacades/Microsoft.DotNet.GenFacades.csproj index da7f337a132..e54530146ca 100644 --- a/src/Microsoft.DotNet.GenFacades/Microsoft.DotNet.GenFacades.csproj +++ b/src/Microsoft.DotNet.GenFacades/Microsoft.DotNet.GenFacades.csproj @@ -7,6 +7,7 @@ MSBuildSdk false true + $(MicrosoftCodeAnalysisCSharpVersion) @@ -27,6 +28,15 @@ + + + + + diff --git a/src/Microsoft.DotNet.GenFacades/build/Microsoft.DotNet.GenFacadesILRewriter.targets b/src/Microsoft.DotNet.GenFacades/build/Microsoft.DotNet.GenFacadesILRewriter.targets index 467e5a8c967..b8d3f388405 100644 --- a/src/Microsoft.DotNet.GenFacades/build/Microsoft.DotNet.GenFacadesILRewriter.targets +++ b/src/Microsoft.DotNet.GenFacades/build/Microsoft.DotNet.GenFacadesILRewriter.targets @@ -21,7 +21,7 @@ of the assembly compilation process. --> - + $(TargetsTriggeredByCompilation);FillPartialFacadeUsingTask