From 8a0eb58a5a825e10ea2bf06a892dd441355818c8 Mon Sep 17 00:00:00 2001 From: Michael Simons Date: Tue, 13 Sep 2022 15:55:40 -0500 Subject: [PATCH] Eliminate 7.0 source-build prebuilts (#14167) * Add runtime patch to fully qualify conflicting runtime and roslyn APIs * Add aspnetcore patch for lifetime scope * Add prebuilt removal patches for fixes that haven't flowed * Use repo name for git-info version number special cases * Delete aspnetcore patches * Update Microsoft.Deployment.DotNet.Releases Versions.Details.xml dependency * Remove backported sdk patch * Add runtime patch to disable analyzers * Add patch to remove app host prebuilt * Add source-build patch for jwt prebuilt * Add patches for command-line-api and msbuild net7.0 TFM * Update aspnetcore patch * Update source-build-externals * Update aspnetcore patch * Add source-build-externals patch * Update SBRP version * Revert tfm patches * Revert "Revert tfm patches" This reverts commit 9cf3f5f6230c0f88e0a9955dbeb545495bc3e855. * Revert msbuild net70 tfm patch * misc updates * Add linker patch * Add linker patch * Add patch for retargeting fsharp * Add patch for retargeting sdk * Resolve patch conflict from latest merge * Remove failing patches * Remove unnecessary patch * Re-add msbuild patch for net7.0 TFM * Revert "Remove failing patches" This reverts commit 9ca3256e9b670d2fc23aeebb785fa8b5c5cca6a4. * Fix fsharp patch * Fix msbuild patch typo * Update fsharp patch * Clean up SDK patch * Resolve patch conflicts from last merge * Fix discrepancy between versions of DotNetDeltaApplier TFM version * Update SDK patch * Fix fsharp patch * Fix msbuild build error * Update nuget-client to net7.0 * Update order of projects in known-good * Fix fsharp xml doc path for net7.0 * Add missing change in msbuild patch * Fix SDK patch * Add runtime patch for targeting net7.0 * Fix runtime-portable build * Add patch for roslyn-analyzers net7.0 TFM * Fix runtime patches * Add patch for targeting net7.0 in roslyn * Fix Microsoft.CSharp.Core.targets location * Update patches * Update roslyn patch * Update prebuilts version * Update roslyn patch again * Add vstest patch for targeting net7.0 * Change minimum supported TFM in runtime * Revert "Add vstest patch for targeting net7.0" This reverts commit 9049c9f585e52194312118ad8e5d15c0d19296b2. * Add patch to update compatibility suppressions in runtime * Use dev/haplois/net67 branch of vstest for validation. PR: https://github.com/microsoft/vstest/pull/3944 * Get rid of 2.0.X prebuilts from xliff * Disable targeting windows in roslyn for source-build * Delete backported runtime patches * Fix xliff patch * Remove backported roslyn patch * Remove backported fsharp patch * Update SDK patch * Remove backported source build patches * Update patches * Remove roslyn patch for net7.0 TFM * Update SDK patch roslyn bits location Co-authored-by: Logan Bussell --- .../tarball/content/repos/known-good.proj | 4 +- ...s-to-net7.0-TFM-with-shared-property.patch | 268 +++++++++++++++ ...001-Change-TargetFramework-to-net7.0.patch | 313 ++++++++++++++++++ ...ref-struct-in-Enumerator-constructor.patch | 31 ++ ...pdate-TFM-to-net7.0-for-source-build.patch | 129 ++++++++ ...Microsoft.CodeAnalysis.Common-depend.patch | 4 +- ...h-out-native-sourcelink-file-check-i.patch | 2 +- ...conflicting-runtime-and-roslyn-APIs.patch} | 4 +- ...Target-net7.0-in-additional-projects.patch | 65 ++++ .../patches/sdk/0001-Disable-CA1420.patch | 4 +- ...002-Change-TargetFramework-to-net7.0.patch | 143 ++++++++ ...-Look-for-VSTest-in-net7.0-directory.patch | 23 -- 12 files changed, 958 insertions(+), 32 deletions(-) create mode 100644 src/SourceBuild/tarball/patches/command-line-api/0001-Update-projects-to-net7.0-TFM-with-shared-property.patch create mode 100644 src/SourceBuild/tarball/patches/msbuild/0001-Change-TargetFramework-to-net7.0.patch create mode 100644 src/SourceBuild/tarball/patches/msbuild/0002-Don-t-use-ref-struct-in-Enumerator-constructor.patch create mode 100644 src/SourceBuild/tarball/patches/nuget-client/0003-Update-TFM-to-net7.0-for-source-build.patch rename src/SourceBuild/tarball/patches/runtime/{0003-Fully-qualify-conflicting-runtime-and-roslyn-APIs.patch => 0002-Fully-qualify-conflicting-runtime-and-roslyn-APIs.patch} (95%) create mode 100644 src/SourceBuild/tarball/patches/runtime/0003-Target-net7.0-in-additional-projects.patch create mode 100644 src/SourceBuild/tarball/patches/sdk/0002-Change-TargetFramework-to-net7.0.patch delete mode 100644 src/SourceBuild/tarball/patches/sdk/0002-Look-for-VSTest-in-net7.0-directory.patch diff --git a/src/SourceBuild/tarball/content/repos/known-good.proj b/src/SourceBuild/tarball/content/repos/known-good.proj index 7d907a9f1..937ab8f54 100644 --- a/src/SourceBuild/tarball/content/repos/known-good.proj +++ b/src/SourceBuild/tarball/content/repos/known-good.proj @@ -35,17 +35,17 @@ + - - + diff --git a/src/SourceBuild/tarball/patches/command-line-api/0001-Update-projects-to-net7.0-TFM-with-shared-property.patch b/src/SourceBuild/tarball/patches/command-line-api/0001-Update-projects-to-net7.0-TFM-with-shared-property.patch new file mode 100644 index 000000000..d875d0aeb --- /dev/null +++ b/src/SourceBuild/tarball/patches/command-line-api/0001-Update-projects-to-net7.0-TFM-with-shared-property.patch @@ -0,0 +1,268 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Logan Bussell +Date: Tue, 19 Jul 2022 14:47:28 -0700 +Subject: [PATCH] Update projects to net7.0 TFM with shared property, Only enable trimming for .NET Core + +Backport PR: https://github.com/dotnet/command-line-api/pull/1803 +--- + Directory.Build.props | 1 + + global.json | 7 ++++--- + .../System.CommandLine.ApiCompatibility.Tests.csproj | 2 +- + .../System.CommandLine.Benchmarks.csproj | 4 ++-- + .../System.CommandLine.DragonFruit.Tests.csproj | 2 +- + .../System.CommandLine.Generator.Tests.csproj | 2 +- + .../System.CommandLine.Hosting.Tests.csproj | 2 +- + .../System.CommandLine.NamingConventionBinder.Tests.csproj | 2 +- + .../System.CommandLine.Rendering.Tests.csproj | 2 +- + .../EndToEndTestApp/EndToEndTestApp.csproj | 2 +- + .../dotnet-suggest.Tests.csproj | 2 +- + src/System.CommandLine.Suggest/dotnet-suggest.csproj | 2 +- + .../System.CommandLine.Tests.csproj | 2 +- + .../TestApps/NativeAOT/NativeAOT.csproj | 4 ++-- + .../TestApps/Trimming/Trimming.csproj | 4 ++-- + src/System.CommandLine/System.CommandLine.csproj | 7 +++++-- + 16 files changed, 26 insertions(+), 21 deletions(-) + +diff --git a/Directory.Build.props b/Directory.Build.props +index c0c5f79a..901c57c7 100644 +--- a/Directory.Build.props ++++ b/Directory.Build.props +@@ -9,6 +9,7 @@ + $(NoWarn);CS8714;CS8765;CS8600;CS8601;CS8602;CS8603;CS8604 + MIT + 10.0 ++ net7.0 + + + +diff --git a/global.json b/global.json +index 1c6fd268..f5bec611 100644 +--- a/global.json ++++ b/global.json +@@ -1,12 +1,13 @@ + { + "tools": { +- "dotnet": "6.0.100", ++ "dotnet": "7.0.100-preview.6.22352.1", + "runtimes": { + "dotnet": [ +- "5.0.10" ++ "5.0.17", ++ "6.0.7" + ] + }, +- "xcopy-msbuild": "16.10.0-preview2" ++ "xcopy-msbuild": "17.1.0" + }, + "msbuild-sdks": { + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22168.2" +diff --git a/src/System.CommandLine.ApiCompatibility.Tests/System.CommandLine.ApiCompatibility.Tests.csproj b/src/System.CommandLine.ApiCompatibility.Tests/System.CommandLine.ApiCompatibility.Tests.csproj +index 30bcd139..4cc48fde 100644 +--- a/src/System.CommandLine.ApiCompatibility.Tests/System.CommandLine.ApiCompatibility.Tests.csproj ++++ b/src/System.CommandLine.ApiCompatibility.Tests/System.CommandLine.ApiCompatibility.Tests.csproj +@@ -1,7 +1,7 @@ + + + +- net6.0 ++ $(TargetFrameworkForNETSDK) + false + + +diff --git a/src/System.CommandLine.Benchmarks/System.CommandLine.Benchmarks.csproj b/src/System.CommandLine.Benchmarks/System.CommandLine.Benchmarks.csproj +index e54aabc4..185ba62a 100644 +--- a/src/System.CommandLine.Benchmarks/System.CommandLine.Benchmarks.csproj ++++ b/src/System.CommandLine.Benchmarks/System.CommandLine.Benchmarks.csproj +@@ -9,8 +9,8 @@ + false + + +- net461;net5.0;net6.0; +- net5.0;net6.0; ++ net461;net5.0;net6.0;net7.0 ++ net5.0;net6.0;net7.0 + + + False +diff --git a/src/System.CommandLine.DragonFruit.Tests/System.CommandLine.DragonFruit.Tests.csproj b/src/System.CommandLine.DragonFruit.Tests/System.CommandLine.DragonFruit.Tests.csproj +index 7eee0b38..e504f7e8 100644 +--- a/src/System.CommandLine.DragonFruit.Tests/System.CommandLine.DragonFruit.Tests.csproj ++++ b/src/System.CommandLine.DragonFruit.Tests/System.CommandLine.DragonFruit.Tests.csproj +@@ -1,6 +1,6 @@ +  + +- net6.0 ++ $(TargetFrameworkForNETSDK) + AutoGeneratedProgram + + true +diff --git a/src/System.CommandLine.Generator.Tests/System.CommandLine.Generator.Tests.csproj b/src/System.CommandLine.Generator.Tests/System.CommandLine.Generator.Tests.csproj +index a423eb1e..20f0f410 100644 +--- a/src/System.CommandLine.Generator.Tests/System.CommandLine.Generator.Tests.csproj ++++ b/src/System.CommandLine.Generator.Tests/System.CommandLine.Generator.Tests.csproj +@@ -1,6 +1,6 @@ +  + +- net6.0 ++ $(TargetFrameworkForNETSDK) + $(TargetFrameworks);net462 + true + true +diff --git a/src/System.CommandLine.Hosting.Tests/System.CommandLine.Hosting.Tests.csproj b/src/System.CommandLine.Hosting.Tests/System.CommandLine.Hosting.Tests.csproj +index 328b4e12..8e2cd6ea 100644 +--- a/src/System.CommandLine.Hosting.Tests/System.CommandLine.Hosting.Tests.csproj ++++ b/src/System.CommandLine.Hosting.Tests/System.CommandLine.Hosting.Tests.csproj +@@ -1,7 +1,7 @@ +  + + +- net6.0 ++ $(TargetFrameworkForNETSDK) + $(TargetFrameworks);net462 + false + +diff --git a/src/System.CommandLine.NamingConventionBinder.Tests/System.CommandLine.NamingConventionBinder.Tests.csproj b/src/System.CommandLine.NamingConventionBinder.Tests/System.CommandLine.NamingConventionBinder.Tests.csproj +index 43eb7c29..7bff1796 100644 +--- a/src/System.CommandLine.NamingConventionBinder.Tests/System.CommandLine.NamingConventionBinder.Tests.csproj ++++ b/src/System.CommandLine.NamingConventionBinder.Tests/System.CommandLine.NamingConventionBinder.Tests.csproj +@@ -1,6 +1,6 @@ +  + +- net6.0 ++ $(TargetFrameworkForNETSDK) + $(TargetFrameworks);net462 + 10 + +diff --git a/src/System.CommandLine.Rendering.Tests/System.CommandLine.Rendering.Tests.csproj b/src/System.CommandLine.Rendering.Tests/System.CommandLine.Rendering.Tests.csproj +index 1c116508..afd6dc6a 100644 +--- a/src/System.CommandLine.Rendering.Tests/System.CommandLine.Rendering.Tests.csproj ++++ b/src/System.CommandLine.Rendering.Tests/System.CommandLine.Rendering.Tests.csproj +@@ -1,7 +1,7 @@ + + + +- net6.0 ++ $(TargetFrameworkForNETSDK) + false + + +diff --git a/src/System.CommandLine.Suggest.Tests/EndToEndTestApp/EndToEndTestApp.csproj b/src/System.CommandLine.Suggest.Tests/EndToEndTestApp/EndToEndTestApp.csproj +index 9a3eb54d..76add0d5 100644 +--- a/src/System.CommandLine.Suggest.Tests/EndToEndTestApp/EndToEndTestApp.csproj ++++ b/src/System.CommandLine.Suggest.Tests/EndToEndTestApp/EndToEndTestApp.csproj +@@ -6,7 +6,7 @@ + + + Exe +- net6.0 ++ $(TargetFrameworkForNETSDK) + + + +diff --git a/src/System.CommandLine.Suggest.Tests/dotnet-suggest.Tests.csproj b/src/System.CommandLine.Suggest.Tests/dotnet-suggest.Tests.csproj +index da6abedf..f1711a10 100644 +--- a/src/System.CommandLine.Suggest.Tests/dotnet-suggest.Tests.csproj ++++ b/src/System.CommandLine.Suggest.Tests/dotnet-suggest.Tests.csproj +@@ -1,7 +1,7 @@ + + + +- net6.0 ++ $(TargetFrameworkForNETSDK) + + + +diff --git a/src/System.CommandLine.Suggest/dotnet-suggest.csproj b/src/System.CommandLine.Suggest/dotnet-suggest.csproj +index fd825008..ce4bda1d 100644 +--- a/src/System.CommandLine.Suggest/dotnet-suggest.csproj ++++ b/src/System.CommandLine.Suggest/dotnet-suggest.csproj +@@ -1,7 +1,7 @@ +  + + Exe +- net6.0 ++ $(TargetFrameworkForNETSDK) + true + true + dotnet-suggest +diff --git a/src/System.CommandLine.Tests/System.CommandLine.Tests.csproj b/src/System.CommandLine.Tests/System.CommandLine.Tests.csproj +index c1988ec4..44b5c9fc 100644 +--- a/src/System.CommandLine.Tests/System.CommandLine.Tests.csproj ++++ b/src/System.CommandLine.Tests/System.CommandLine.Tests.csproj +@@ -1,6 +1,6 @@ +  + +- net6.0 ++ $(TargetFrameworkForNETSDK) + $(TargetFrameworks);net462 + false + +diff --git a/src/System.CommandLine.Tests/TestApps/NativeAOT/NativeAOT.csproj b/src/System.CommandLine.Tests/TestApps/NativeAOT/NativeAOT.csproj +index b0036ed0..cc306fea 100644 +--- a/src/System.CommandLine.Tests/TestApps/NativeAOT/NativeAOT.csproj ++++ b/src/System.CommandLine.Tests/TestApps/NativeAOT/NativeAOT.csproj +@@ -2,13 +2,13 @@ + + + Exe +- net6.0 ++ $(TargetFrameworkForNETSDK) + + false + + + +- ..\..\..\System.CommandLine\bin\Release\net6.0\System.CommandLine.dll ++ ..\..\..\System.CommandLine\bin\Release\$(TargetFrameworkForNETSDK)\System.CommandLine.dll + + + +diff --git a/src/System.CommandLine.Tests/TestApps/Trimming/Trimming.csproj b/src/System.CommandLine.Tests/TestApps/Trimming/Trimming.csproj +index 6dcf8892..615b0764 100644 +--- a/src/System.CommandLine.Tests/TestApps/Trimming/Trimming.csproj ++++ b/src/System.CommandLine.Tests/TestApps/Trimming/Trimming.csproj +@@ -2,7 +2,7 @@ + + + Exe +- net6.0 ++ $(TargetFrameworkForNETSDK) + enable + enable + true +@@ -10,7 +10,7 @@ + + + +- ..\..\..\System.CommandLine\bin\Release\net6.0\System.CommandLine.dll ++ ..\..\..\System.CommandLine\bin\Release\$(TargetFrameworkForNETSDK)\System.CommandLine.dll + + + +diff --git a/src/System.CommandLine/System.CommandLine.csproj b/src/System.CommandLine/System.CommandLine.csproj +index 424053a6..37115d70 100644 +--- a/src/System.CommandLine/System.CommandLine.csproj ++++ b/src/System.CommandLine/System.CommandLine.csproj +@@ -3,7 +3,7 @@ + + true + System.CommandLine +- net6.0;netstandard2.0 ++ $(TargetFrameworkForNETSDK);netstandard2.0 + enable + true + 10 +@@ -15,9 +15,12 @@ + * Test and debug support + + true ++ true ++ ++ ++ + true + true +- true + + + diff --git a/src/SourceBuild/tarball/patches/msbuild/0001-Change-TargetFramework-to-net7.0.patch b/src/SourceBuild/tarball/patches/msbuild/0001-Change-TargetFramework-to-net7.0.patch new file mode 100644 index 000000000..bf87a65d5 --- /dev/null +++ b/src/SourceBuild/tarball/patches/msbuild/0001-Change-TargetFramework-to-net7.0.patch @@ -0,0 +1,313 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ben Villalobos <4691428+BenVillalobos@users.noreply.github.com> +Date: Tue, 5 Jul 2022 16:33:56 -0500 +Subject: [PATCH] Change TargetFramework to net7.0 + +Add nowarn for SYSLIB warnings +Resolve CS8981: lowercase preserved types + +Backport PR: https://github.com/dotnet/msbuild/pull/7790 +--- + Directory.Build.props | 2 +- + eng/BootStrapMSBuild.targets | 2 +- + eng/cibuild_bootstrapped_msbuild.ps1 | 2 +- + eng/cibuild_bootstrapped_msbuild.sh | 2 +- + global.json | 2 +- + scripts/Deploy-MSBuild.ps1 | 2 +- + .../RemoteProjectsProviderMock/CollectionsHelpers.cs | 8 ++++---- + .../Microsoft.Build.Engine.UnitTests.csproj | 4 ++-- + src/Build/Definition/ToolsetReader.cs | 4 ++-- + src/Build/Microsoft.Build.csproj | 2 +- + src/Directory.BeforeCommon.targets | 2 +- + src/Directory.Build.props | 6 +++--- + src/Framework/README.md | 2 +- + src/MSBuild.Bootstrap/MSBuild.Bootstrap.csproj | 2 +- + src/Package/Localization/Localization.csproj | 2 +- + src/Samples/ProjectCachePlugin/ProjectCachePlugin.csproj | 4 ++-- + src/Tasks/Microsoft.Build.Tasks.csproj | 2 +- + src/Utilities/README.md | 2 +- + 18 files changed, 26 insertions(+), 26 deletions(-) + +diff --git a/Directory.Build.props b/Directory.Build.props +index 0df28a5b8..3a959f894 100644 +--- a/Directory.Build.props ++++ b/Directory.Build.props +@@ -38,7 +38,7 @@ + SYSLIB0011: Removing binary formatter will happen as part of a larger .NET-wide effort. + --> + +- $(NoWarn);NU1603;NU5105;1701;1702;SYSLIB0011 ++ $(NoWarn);NU1603;NU5105;1701;1702;SYSLIB0011;SYSLIB0037;SYSLIB0044 + + + +diff --git a/eng/BootStrapMSBuild.targets b/eng/BootStrapMSBuild.targets +index 288c062da..4ba21444d 100644 +--- a/eng/BootStrapMSBuild.targets ++++ b/eng/BootStrapMSBuild.targets +@@ -210,7 +210,7 @@ + Copy it from "next to MSBuild" in the pre-bootstrap SDK to our little weirdo bootstrap + layout next to the SDK tasks, so it can get loaded by the SDK tasks that need it. --> + ++ DestinationFolder="$(BootstrapDestination)Sdks\Microsoft.NET.Sdk\tools\net7.0" /> + + +diff --git a/eng/cibuild_bootstrapped_msbuild.ps1 b/eng/cibuild_bootstrapped_msbuild.ps1 +index b9c1cf4fe..906a33dc1 100644 +--- a/eng/cibuild_bootstrapped_msbuild.ps1 ++++ b/eng/cibuild_bootstrapped_msbuild.ps1 +@@ -91,7 +91,7 @@ try { + else + { + $buildToolPath = $dotnetExePath +- $buildToolCommand = Join-Path $bootstrapRoot "net6.0\MSBuild\MSBuild.dll" ++ $buildToolCommand = Join-Path $bootstrapRoot "net7.0\MSBuild\MSBuild.dll" + $buildToolFramework = "netcoreapp3.1" + } + +diff --git a/eng/cibuild_bootstrapped_msbuild.sh b/eng/cibuild_bootstrapped_msbuild.sh +index e5425507f..b4404b7e4 100755 +--- a/eng/cibuild_bootstrapped_msbuild.sh ++++ b/eng/cibuild_bootstrapped_msbuild.sh +@@ -63,7 +63,7 @@ bootstrapRoot="$Stage1Dir/bin/bootstrap" + if [ $host_type = "core" ] + then + _InitializeBuildTool="$_InitializeDotNetCli/dotnet" +- _InitializeBuildToolCommand="$bootstrapRoot/net6.0/MSBuild/MSBuild.dll" ++ _InitializeBuildToolCommand="$bootstrapRoot/net7.0/MSBuild/MSBuild.dll" + _InitializeBuildToolFramework="netcoreapp3.1" + elif [ $host_type = "mono" ] + then +diff --git a/global.json b/global.json +index 471f88dbc..efd25efd1 100644 +--- a/global.json ++++ b/global.json +@@ -3,7 +3,7 @@ + "allowPrerelease": true + }, + "tools": { +- "dotnet": "6.0.200", ++ "dotnet": "7.0.100-preview.5.22307.18", + "vs": { + "version": "17.0" + } +diff --git a/scripts/Deploy-MSBuild.ps1 b/scripts/Deploy-MSBuild.ps1 +index ef1959fc3..8cfecb6a0 100644 +--- a/scripts/Deploy-MSBuild.ps1 ++++ b/scripts/Deploy-MSBuild.ps1 +@@ -69,7 +69,7 @@ else { + if ($runtime -eq "Desktop") { + $targetFramework = "net472" + } else { +- $targetFramework = "net6.0" ++ $targetFramework = "net7.0" + } + + $bootstrapBinDirectory = "artifacts\bin\MSBuild.Bootstrap\$configuration\$targetFramework" +diff --git a/src/Build.OM.UnitTests/ObjectModelRemoting/RemoteProjectsProviderMock/CollectionsHelpers.cs b/src/Build.OM.UnitTests/ObjectModelRemoting/RemoteProjectsProviderMock/CollectionsHelpers.cs +index b6d935f41..83035cd50 100644 +--- a/src/Build.OM.UnitTests/ObjectModelRemoting/RemoteProjectsProviderMock/CollectionsHelpers.cs ++++ b/src/Build.OM.UnitTests/ObjectModelRemoting/RemoteProjectsProviderMock/CollectionsHelpers.cs +@@ -85,13 +85,13 @@ namespace Microsoft.Build.UnitTests.OM.ObjectModelRemoting + } + + +- public static IDictionary ImportDictionary(this ProjectCollectionLinker importer, IDictionary source) ++ public static IDictionary ImportDictionary(this ProjectCollectionLinker importer, IDictionary source) + where T : class + where RMock : MockLinkRemoter, new() + { + if (source == null) return null; + // Just copy ... +- Dictionary result = new Dictionary(); ++ Dictionary result = new Dictionary(); + foreach (var sRemoter in source) + { + var value = importer.Import(sRemoter.Value); +@@ -101,13 +101,13 @@ namespace Microsoft.Build.UnitTests.OM.ObjectModelRemoting + return result; + } + +- public static IDictionary ExportDictionary(this ProjectCollectionLinker exporter, IDictionary source) ++ public static IDictionary ExportDictionary(this ProjectCollectionLinker exporter, IDictionary source) + where T : class + where RMock : MockLinkRemoter, new() + { + if (source == null) return null; + // Just copy ... +- Dictionary result = new Dictionary(); ++ Dictionary result = new Dictionary(); + foreach (var s in source) + { + var valueRemoter = exporter.Export(s.Value); +diff --git a/src/Build.UnitTests/Microsoft.Build.Engine.UnitTests.csproj b/src/Build.UnitTests/Microsoft.Build.Engine.UnitTests.csproj +index 8ddca6108..83a4382d8 100644 +--- a/src/Build.UnitTests/Microsoft.Build.Engine.UnitTests.csproj ++++ b/src/Build.UnitTests/Microsoft.Build.Engine.UnitTests.csproj +@@ -36,14 +36,14 @@ + + TargetFramework=$(FullFrameworkTFM) + TargetFramework=$(FullFrameworkTFM) +- TargetFramework=net6.0 ++ TargetFramework=net7.0 + + + + + TargetFramework=$(FullFrameworkTFM) + TargetFramework=$(FullFrameworkTFM) +- TargetFramework=net6.0 ++ TargetFramework=net7.0 + + + +diff --git a/src/Build/Definition/ToolsetReader.cs b/src/Build/Definition/ToolsetReader.cs +index 8887b9cca..ddb164cb7 100644 +--- a/src/Build/Definition/ToolsetReader.cs ++++ b/src/Build/Definition/ToolsetReader.cs +@@ -12,7 +12,7 @@ using Microsoft.Build.Execution; + using Microsoft.Build.Framework; + using Microsoft.Build.Internal; + using Microsoft.Build.Shared.FileSystem; +-using error = Microsoft.Build.Shared.ErrorUtilities; ++using ErrorUtils = Microsoft.Build.Shared.ErrorUtilities; + using InvalidProjectFileException = Microsoft.Build.Exceptions.InvalidProjectFileException; + using InvalidToolsetDefinitionException = Microsoft.Build.Exceptions.InvalidToolsetDefinitionException; + using ReservedPropertyNames = Microsoft.Build.Internal.ReservedPropertyNames; +@@ -366,7 +366,7 @@ namespace Microsoft.Build.Evaluation + out string defaultOverrideToolsVersion + ) + { +- error.VerifyThrowArgumentNull(toolsets, "Toolsets"); ++ ErrorUtils.VerifyThrowArgumentNull(toolsets, "Toolsets"); + + ReadEachToolset(toolsets, globalProperties, initialProperties, accumulateProperties); + +diff --git a/src/Build/Microsoft.Build.csproj b/src/Build/Microsoft.Build.csproj +index 309d14bdc..c4eb0bce6 100644 +--- a/src/Build/Microsoft.Build.csproj ++++ b/src/Build/Microsoft.Build.csproj +@@ -4,7 +4,7 @@ + + + +- $(FullFrameworkTFM);net6.0 ++ $(FullFrameworkTFM);net7.0 + $(RuntimeOutputTargetFrameworks) + Microsoft.Build + Microsoft.Build +diff --git a/src/Directory.BeforeCommon.targets b/src/Directory.BeforeCommon.targets +index 6696e3861..40bc57ecb 100644 +--- a/src/Directory.BeforeCommon.targets ++++ b/src/Directory.BeforeCommon.targets +@@ -92,7 +92,7 @@ + $(DefineConstants);FEATURE_SYMLINK_TARGET + + +- ++ + $(DefineConstants);FEATURE_PIPEOPTIONS_CURRENTUSERONLY + $(DefineConstants);FEATURE_NODE_REUSE + +diff --git a/src/Directory.Build.props b/src/Directory.Build.props +index ccffd9b5c..6e12f1557 100644 +--- a/src/Directory.Build.props ++++ b/src/Directory.Build.props +@@ -30,13 +30,13 @@ + AnyCPU;x64;arm64 + + +- $(FullFrameworkTFM);net6.0;netstandard2.0 +- net6.0;netstandard2.0 ++ $(FullFrameworkTFM);net7.0;netstandard2.0 ++ net7.0;netstandard2.0 + $(FullFrameworkTFM);netstandard2.0 + AnyCPU + + +- net6.0 ++ net7.0 + $(FullFrameworkTFM);$(RuntimeOutputTargetFrameworks) + $(FullFrameworkTFM) + +diff --git a/src/Framework/README.md b/src/Framework/README.md +index 1b72454f5..8a86bc21c 100644 +--- a/src/Framework/README.md ++++ b/src/Framework/README.md +@@ -6,6 +6,6 @@ The items in this namespace are primarily base-level classes and interfaces shar + [`ITask`](https://docs.microsoft.com/dotnet/api/microsoft.build.framework.itask), and [`ILogger`](https://docs.microsoft.com/dotnet/api/microsoft.build.framework.ilogger). + + ### netstandard2.0 target +-The `netstandard2.0` target of this build is configured only to output reference assemblies; at runtime MSBuild will be `net6.0` or `net472`. Please use the `net6.0`-targeted assemblies for .NET Core 6+ scenarios. ++The `netstandard2.0` target of this build is configured only to output reference assemblies; at runtime MSBuild will be `net7.0` or `net472`. Please use the `net7.0`-targeted assemblies for .NET Core 6+ scenarios. + + For context, see https://github.com/dotnet/msbuild/pull/6148 +\ No newline at end of file +diff --git a/src/MSBuild.Bootstrap/MSBuild.Bootstrap.csproj b/src/MSBuild.Bootstrap/MSBuild.Bootstrap.csproj +index 9bb2da049..4766c0418 100644 +--- a/src/MSBuild.Bootstrap/MSBuild.Bootstrap.csproj ++++ b/src/MSBuild.Bootstrap/MSBuild.Bootstrap.csproj +@@ -43,7 +43,7 @@ + + + +- ++ + + + +diff --git a/src/Package/Localization/Localization.csproj b/src/Package/Localization/Localization.csproj +index e15af6ed0..e6c8a82ee 100644 +--- a/src/Package/Localization/Localization.csproj ++++ b/src/Package/Localization/Localization.csproj +@@ -1,6 +1,6 @@ +  + +- net6.0 ++ net7.0 + net472 + Microsoft.Build.Localization.nuspec + false +diff --git a/src/Samples/ProjectCachePlugin/ProjectCachePlugin.csproj b/src/Samples/ProjectCachePlugin/ProjectCachePlugin.csproj +index 6972b5e9a..0e37d41d9 100644 +--- a/src/Samples/ProjectCachePlugin/ProjectCachePlugin.csproj ++++ b/src/Samples/ProjectCachePlugin/ProjectCachePlugin.csproj +@@ -4,8 +4,8 @@ + false + false + +- net6.0 +- $(FullFrameworkTFM);net6.0 ++ net7.0 ++ $(FullFrameworkTFM);net7.0 + $(RuntimeOutputTargetFrameworks) + + +diff --git a/src/Tasks/Microsoft.Build.Tasks.csproj b/src/Tasks/Microsoft.Build.Tasks.csproj +index 5bd98bfbe..547075939 100644 +--- a/src/Tasks/Microsoft.Build.Tasks.csproj ++++ b/src/Tasks/Microsoft.Build.Tasks.csproj +@@ -1013,7 +1013,7 @@ + + + +- ++ + + + +diff --git a/src/Utilities/README.md b/src/Utilities/README.md +index a85d56e11..99a1651b5 100644 +--- a/src/Utilities/README.md ++++ b/src/Utilities/README.md +@@ -7,6 +7,6 @@ This package contains `Microsoft.Build.Utilities.Core.dll`, which defines helper + * [`Logger`](https://docs.microsoft.com/dotnet/api/microsoft.build.utilities.logger), a base class for custom logging functionality. + + ### netstandard2.0 target +-The `netstandard2.0` target of this build is configured only to output reference assemblies; at runtime MSBuild will be `net6.0` or `net472`. Please use the `net6.0`-targeted assemblies for .NET Core 6+ scenarios. ++The `netstandard2.0` target of this build is configured only to output reference assemblies; at runtime MSBuild will be `net7.0` or `net472`. Please use the `net7.0`-targeted assemblies for .NET Core 6+ scenarios. + + For context, see https://github.com/dotnet/msbuild/pull/6148 +\ No newline at end of file diff --git a/src/SourceBuild/tarball/patches/msbuild/0002-Don-t-use-ref-struct-in-Enumerator-constructor.patch b/src/SourceBuild/tarball/patches/msbuild/0002-Don-t-use-ref-struct-in-Enumerator-constructor.patch new file mode 100644 index 000000000..7a7d5bf8f --- /dev/null +++ b/src/SourceBuild/tarball/patches/msbuild/0002-Don-t-use-ref-struct-in-Enumerator-constructor.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Logan Bussell +Date: Wed, 3 Aug 2022 10:37:03 -0700 +Subject: [PATCH] Don't use ref struct in Enumerator constructor + +--- + src/StringTools/InternableString.cs | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/StringTools/InternableString.cs b/src/StringTools/InternableString.cs +index f04d2a9e9..dc788767a 100644 +--- a/src/StringTools/InternableString.cs ++++ b/src/StringTools/InternableString.cs +@@ -33,7 +33,7 @@ namespace Microsoft.NET.StringTools + /// + private int _charIndex; + +- internal Enumerator(ref InternableString str) ++ internal Enumerator(InternableString str) + { + _string = str; + _spanIndex = -1; +@@ -170,7 +170,7 @@ namespace Microsoft.NET.StringTools + /// The enumerator. + public Enumerator GetEnumerator() + { +- return new Enumerator(ref this); ++ return new Enumerator(this); + } + + /// diff --git a/src/SourceBuild/tarball/patches/nuget-client/0003-Update-TFM-to-net7.0-for-source-build.patch b/src/SourceBuild/tarball/patches/nuget-client/0003-Update-TFM-to-net7.0-for-source-build.patch new file mode 100644 index 000000000..054c48eb5 --- /dev/null +++ b/src/SourceBuild/tarball/patches/nuget-client/0003-Update-TFM-to-net7.0-for-source-build.patch @@ -0,0 +1,129 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Logan Bussell +Date: Mon, 1 Aug 2022 15:31:27 -0700 +Subject: [PATCH] Update TFM to net7.0 for source-build + +--- + build/common.project.props | 6 +++--- + build/common.targets | 2 +- + eng/source-build/global.json | 2 +- + .../NuGet.Configuration/NuGet.Configuration.csproj | 2 +- + src/NuGet.Core/NuGet.Frameworks/FrameworkConstants.cs | 2 ++ + src/NuGet.Core/NuGet.Frameworks/NuGetFrameworkFactory.cs | 6 ++++++ + .../NuGet.PackageManagement/NuGet.PackageManagement.csproj | 2 +- + 7 files changed, 15 insertions(+), 7 deletions(-) + +diff --git a/build/common.project.props b/build/common.project.props +index 93287fdde..059adfa51 100644 +--- a/build/common.project.props ++++ b/build/common.project.props +@@ -14,18 +14,18 @@ + v4.7.2 + net472 + netcoreapp3.1 +- net6.0 ++ net7.0 + net6.0 + netstandard2.0 + $(NETFXTargetFramework);$(NETCoreTargetFramework) + $(NETCoreTargetFramework) + $(TargetFrameworksExe);netcoreapp5.0 + $(NETCoreTargetFramework);netcoreapp5.0 +- $(TargetFrameworksExe);net6.0 ++ $(TargetFrameworksExe);net7.0 + $(NETFXTargetFramework);$(NetStandardVersion) + $(NETCoreTargetFramework);$(NETFXTargetFramework);$(NetStandardVersion) + $(TargetFrameworksLibrary);netcoreapp5.0 +- $(TargetFrameworksLibrary);net6.0 ++ $(TargetFrameworksLibrary);net7.0 + $(NETFXTargetFramework);net6.0 + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'README.md'))\ + $(RepositoryRootDirectory)build\ +diff --git a/build/common.targets b/build/common.targets +index 69c72499b..01ec1b568 100644 +--- a/build/common.targets ++++ b/build/common.targets +@@ -6,7 +6,7 @@ + true + + +- ++ + $(DefineConstants);IS_CORECLR + true + +diff --git a/eng/source-build/global.json b/eng/source-build/global.json +index 2b9604572..d4d319b20 100644 +--- a/eng/source-build/global.json ++++ b/eng/source-build/global.json +@@ -1,6 +1,6 @@ + { + "tools": { +- "dotnet": "6.0.100-preview.7.21379.14" ++ "dotnet": "7.0.100-preview.6.22352.1" + }, + "msbuild-sdks": { + "Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.21309.7" +diff --git a/src/NuGet.Core/NuGet.Configuration/NuGet.Configuration.csproj b/src/NuGet.Core/NuGet.Configuration/NuGet.Configuration.csproj +index 53e500248..5edbc8281 100644 +--- a/src/NuGet.Core/NuGet.Configuration/NuGet.Configuration.csproj ++++ b/src/NuGet.Core/NuGet.Configuration/NuGet.Configuration.csproj +@@ -29,7 +29,7 @@ + + + +- ++ + + + +diff --git a/src/NuGet.Core/NuGet.Frameworks/FrameworkConstants.cs b/src/NuGet.Core/NuGet.Frameworks/FrameworkConstants.cs +index 6ec51bdd2..4839a2952 100644 +--- a/src/NuGet.Core/NuGet.Frameworks/FrameworkConstants.cs ++++ b/src/NuGet.Core/NuGet.Frameworks/FrameworkConstants.cs +@@ -12,6 +12,7 @@ public static class FrameworkConstants + public static readonly Version MaxVersion = new Version(int.MaxValue, 0, 0, 0); + public static readonly Version Version5 = new Version(5, 0, 0, 0); + public static readonly Version Version6 = new Version(6, 0, 0, 0); ++ public static readonly Version Version7 = new Version(7, 0, 0, 0); + public static readonly Version Version10 = new Version(10, 0, 0, 0); + public static readonly FrameworkRange DotNetAll = new FrameworkRange( + new NuGetFramework(FrameworkIdentifiers.NetPlatform, FrameworkConstants.EmptyVersion), +@@ -186,6 +187,7 @@ public static class CommonFrameworks + // .NET 5.0 and later has NetCoreApp identifier + public static readonly NuGetFramework Net50 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version5); + public static readonly NuGetFramework Net60 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version6); ++ public static readonly NuGetFramework Net70 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version7); + + public static readonly NuGetFramework Native = new NuGetFramework(FrameworkIdentifiers.Native, new Version(0, 0, 0, 0)); + } +diff --git a/src/NuGet.Core/NuGet.Frameworks/NuGetFrameworkFactory.cs b/src/NuGet.Core/NuGet.Frameworks/NuGetFrameworkFactory.cs +index cbbb3af0c..67a355cc8 100644 +--- a/src/NuGet.Core/NuGet.Frameworks/NuGetFrameworkFactory.cs ++++ b/src/NuGet.Core/NuGet.Frameworks/NuGetFrameworkFactory.cs +@@ -686,6 +686,12 @@ private static bool TryParseCommonFramework(string frameworkString, out NuGetFra + case "net60": + framework = FrameworkConstants.CommonFrameworks.Net60; + break; ++ case "netcoreapp7.0": ++ case "netcoreapp70": ++ case "net7.0": ++ case "net70": ++ framework = FrameworkConstants.CommonFrameworks.Net70; ++ break; + } + + return framework != null; +diff --git a/src/NuGet.Core/NuGet.PackageManagement/NuGet.PackageManagement.csproj b/src/NuGet.Core/NuGet.PackageManagement/NuGet.PackageManagement.csproj +index 8a9bc1778..01e0a0221 100644 +--- a/src/NuGet.Core/NuGet.PackageManagement/NuGet.PackageManagement.csproj ++++ b/src/NuGet.Core/NuGet.PackageManagement/NuGet.PackageManagement.csproj +@@ -35,7 +35,7 @@ + + + +- ++ + + + diff --git a/src/SourceBuild/tarball/patches/roslyn/0001-lift-version-of-Microsoft.CodeAnalysis.Common-depend.patch b/src/SourceBuild/tarball/patches/roslyn/0001-lift-version-of-Microsoft.CodeAnalysis.Common-depend.patch index 722a34526..6096888d1 100644 --- a/src/SourceBuild/tarball/patches/roslyn/0001-lift-version-of-Microsoft.CodeAnalysis.Common-depend.patch +++ b/src/SourceBuild/tarball/patches/roslyn/0001-lift-version-of-Microsoft.CodeAnalysis.Common-depend.patch @@ -1,8 +1,8 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Logan Bussell <36081148+lbussell@users.noreply.github.com> Date: Thu, 21 Oct 2021 23:15:23 +0000 -Subject: [PATCH] lift version of Microsoft.CodeAnalysis.Common dependencies to - previously source built versions +Subject: [PATCH 1/2] lift version of Microsoft.CodeAnalysis.Common + dependencies to previously source built versions Requires https://github.com/dotnet/source-build/issues/2482 in order to eliminate this patch --- diff --git a/src/SourceBuild/tarball/patches/runtime/0001-Temporarily-patch-out-native-sourcelink-file-check-i.patch b/src/SourceBuild/tarball/patches/runtime/0001-Temporarily-patch-out-native-sourcelink-file-check-i.patch index 5611ac154..3d7ba1e1f 100644 --- a/src/SourceBuild/tarball/patches/runtime/0001-Temporarily-patch-out-native-sourcelink-file-check-i.patch +++ b/src/SourceBuild/tarball/patches/runtime/0001-Temporarily-patch-out-native-sourcelink-file-check-i.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Chris Rummel Date: Wed, 1 Jun 2022 10:10:01 -0500 -Subject: [PATCH] Temporarily patch out native sourcelink file check in +Subject: [PATCH 1/5] Temporarily patch out native sourcelink file check in source-build. This returns source-build to its old behavior. Backport: https://github.com/dotnet/source-build/issues/2883 diff --git a/src/SourceBuild/tarball/patches/runtime/0003-Fully-qualify-conflicting-runtime-and-roslyn-APIs.patch b/src/SourceBuild/tarball/patches/runtime/0002-Fully-qualify-conflicting-runtime-and-roslyn-APIs.patch similarity index 95% rename from src/SourceBuild/tarball/patches/runtime/0003-Fully-qualify-conflicting-runtime-and-roslyn-APIs.patch rename to src/SourceBuild/tarball/patches/runtime/0002-Fully-qualify-conflicting-runtime-and-roslyn-APIs.patch index 5325b7a93..f88b9fdf3 100644 --- a/src/SourceBuild/tarball/patches/runtime/0003-Fully-qualify-conflicting-runtime-and-roslyn-APIs.patch +++ b/src/SourceBuild/tarball/patches/runtime/0002-Fully-qualify-conflicting-runtime-and-roslyn-APIs.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Logan Bussell Date: Thu, 14 Jul 2022 14:53:35 -0700 -Subject: [PATCH] Fully qualify conflicting runtime and roslyn APIs +Subject: [PATCH 3/5] Fully qualify conflicting runtime and roslyn APIs --- .../System.Private.CoreLib/gen/EventSourceGenerator.Parser.cs | 2 +- @@ -22,7 +22,7 @@ index 43a498b589a..1bad8f3753c 100644 const string EventSourceAttribute = "System.Diagnostics.Tracing.EventSourceAttribute"; diff --git a/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Parser.cs b/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Parser.cs -index 33dd18fc67f..13005b9d0a9 100644 +index 7a472a994c9..36dc7500bea 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Parser.cs +++ b/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Parser.cs @@ -20,7 +20,7 @@ public partial class RegexGenerator diff --git a/src/SourceBuild/tarball/patches/runtime/0003-Target-net7.0-in-additional-projects.patch b/src/SourceBuild/tarball/patches/runtime/0003-Target-net7.0-in-additional-projects.patch new file mode 100644 index 000000000..883a61e0e --- /dev/null +++ b/src/SourceBuild/tarball/patches/runtime/0003-Target-net7.0-in-additional-projects.patch @@ -0,0 +1,65 @@ +From 01e9fdd1449324e547230530aea2532488e0b0ce Mon Sep 17 00:00:00 2001 +From: Logan Bussell +Date: Mon, 12 Sep 2022 09:50:31 -0700 +Subject: [PATCH] [release/7.0] Target only net7.0 during source-build (#75168) + +* Target net7.0 in additional projects + +Backport: https://github.com/dotnet/runtime/pull/75168 +--- + Directory.Build.props | 1 + + eng/SourceBuild.props | 1 + + .../src/System.Diagnostics.DiagnosticSource.csproj | 2 -- + .../tools/GenerateRegexCasingTable.csproj | 2 +- + 4 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Directory.Build.props b/Directory.Build.props +index 60a661e66ca44..ce67527ff8ed1 100644 +--- a/Directory.Build.props ++++ b/Directory.Build.props +@@ -54,6 +54,7 @@ + .NET $(NetCoreAppCurrentVersion) + net$(NetCoreAppCurrentVersion) + net6.0 ++ $(NetCoreAppCurrent) + + 7.0 + net$(NetCoreAppToolCurrentVersion) +diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props +index c17838918f8ce..9ca390c502f75 100644 +--- a/eng/SourceBuild.props ++++ b/eng/SourceBuild.props +@@ -39,6 +39,7 @@ + $(InnerBuildArgs) /p:PortableBuild=$(SourceBuildPortable) + $(InnerBuildArgs) /p:BuildDebPackage=false + $(InnerBuildArgs) /p:EnableNgenOptimization=false ++ $(InnerBuildArgs) /p:EnablePackageValidation=false + + + +diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj b/src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj +index 9c22bce30dae9..6d40be2f856b7 100644 +--- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj ++++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj +@@ -6,8 +6,6 @@ + $(NoWarn);SA1205;CA1845 + false + true +- +- 10 + true + Provides Classes that allow you to decouple code logging rich (unserializable) diagnostics/telemetry (e.g. framework) from code that consumes it (e.g. tools) + +diff --git a/src/libraries/System.Text.RegularExpressions/tools/GenerateRegexCasingTable.csproj b/src/libraries/System.Text.RegularExpressions/tools/GenerateRegexCasingTable.csproj +index 26b5733684c3f..4df9075220402 100644 +--- a/src/libraries/System.Text.RegularExpressions/tools/GenerateRegexCasingTable.csproj ++++ b/src/libraries/System.Text.RegularExpressions/tools/GenerateRegexCasingTable.csproj +@@ -2,7 +2,7 @@ + + + Exe +- net6.0 ++ $(NetCoreAppToolCurrent) + latest + enable + diff --git a/src/SourceBuild/tarball/patches/sdk/0001-Disable-CA1420.patch b/src/SourceBuild/tarball/patches/sdk/0001-Disable-CA1420.patch index d95cf8479..f49d2ed95 100644 --- a/src/SourceBuild/tarball/patches/sdk/0001-Disable-CA1420.patch +++ b/src/SourceBuild/tarball/patches/sdk/0001-Disable-CA1420.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: MichaelSimons Date: Mon, 25 Jul 2022 19:15:47 +0000 -Subject: [PATCH] Disable CA1420 +Subject: [PATCH 1/2] Disable CA1420 Workaround until NuGet updates to build with latest .NET toolset. --- @@ -9,7 +9,7 @@ Workaround until NuGet updates to build with latest .NET toolset. 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props -index 8ee962ab1d..ce999a306f 100644 +index 1353696a29..4e7463a453 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -13,9 +13,11 @@ diff --git a/src/SourceBuild/tarball/patches/sdk/0002-Change-TargetFramework-to-net7.0.patch b/src/SourceBuild/tarball/patches/sdk/0002-Change-TargetFramework-to-net7.0.patch new file mode 100644 index 000000000..bb3c2b80f --- /dev/null +++ b/src/SourceBuild/tarball/patches/sdk/0002-Change-TargetFramework-to-net7.0.patch @@ -0,0 +1,143 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Logan Bussell +Date: Fri, 22 Jul 2022 15:10:08 -0700 +Subject: [PATCH] Change TargetFramework to net7.0 + +--- + .../Microsoft.DotNet.ApiCompat.Task.csproj | 2 +- + .../build/Microsoft.DotNet.ApiCompat.Task.targets | 2 +- + .../Microsoft.DotNet.ApiCompat.Tool.csproj | 2 +- + .../Microsoft.DotNet.ApiCompatibility.csproj | 2 +- + .../Microsoft.DotNet.PackageValidation.csproj | 2 +- + .../Microsoft.Extensions.DotNetDeltaApplier.csproj | 2 +- + .../Microsoft.DotNet.Cli.Utils.csproj | 2 +- + src/Layout/redist/targets/GenerateLayout.targets | 4 ++-- + src/Layout/redist/targets/OverlaySdkOnLKG.targets | 2 +- + 9 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/src/ApiCompat/Microsoft.DotNet.ApiCompat.Task/Microsoft.DotNet.ApiCompat.Task.csproj b/src/ApiCompat/Microsoft.DotNet.ApiCompat.Task/Microsoft.DotNet.ApiCompat.Task.csproj +index 8177095a90..0c1f7acebf 100644 +--- a/src/ApiCompat/Microsoft.DotNet.ApiCompat.Task/Microsoft.DotNet.ApiCompat.Task.csproj ++++ b/src/ApiCompat/Microsoft.DotNet.ApiCompat.Task/Microsoft.DotNet.ApiCompat.Task.csproj +@@ -1,7 +1,7 @@ +  + + +- net6.0;net472 ++ net7.0;net472 + true + true + Open +diff --git a/src/ApiCompat/Microsoft.DotNet.ApiCompat.Task/build/Microsoft.DotNet.ApiCompat.Task.targets b/src/ApiCompat/Microsoft.DotNet.ApiCompat.Task/build/Microsoft.DotNet.ApiCompat.Task.targets +index fb49a12fb4..2ce737c75d 100644 +--- a/src/ApiCompat/Microsoft.DotNet.ApiCompat.Task/build/Microsoft.DotNet.ApiCompat.Task.targets ++++ b/src/ApiCompat/Microsoft.DotNet.ApiCompat.Task/build/Microsoft.DotNet.ApiCompat.Task.targets +@@ -2,7 +2,7 @@ + + + $(MSBuildThisFileDirectory)..\tools\net472\Microsoft.DotNet.ApiCompat.Task.dll +- $(MSBuildThisFileDirectory)..\tools\net6.0\Microsoft.DotNet.ApiCompat.Task.dll ++ $(MSBuildThisFileDirectory)..\tools\net7.0\Microsoft.DotNet.ApiCompat.Task.dll + true + + true +diff --git a/src/ApiCompat/Microsoft.DotNet.ApiCompat.Tool/Microsoft.DotNet.ApiCompat.Tool.csproj b/src/ApiCompat/Microsoft.DotNet.ApiCompat.Tool/Microsoft.DotNet.ApiCompat.Tool.csproj +index 2de17ce715..32e6580920 100644 +--- a/src/ApiCompat/Microsoft.DotNet.ApiCompat.Tool/Microsoft.DotNet.ApiCompat.Tool.csproj ++++ b/src/ApiCompat/Microsoft.DotNet.ApiCompat.Tool/Microsoft.DotNet.ApiCompat.Tool.csproj +@@ -1,7 +1,7 @@ +  + + +- net6.0 ++ net7.0 + Exe + enable + true +diff --git a/src/ApiCompat/Microsoft.DotNet.ApiCompatibility/Microsoft.DotNet.ApiCompatibility.csproj b/src/ApiCompat/Microsoft.DotNet.ApiCompatibility/Microsoft.DotNet.ApiCompatibility.csproj +index 7b8569a72b..b1e1e4d53e 100644 +--- a/src/ApiCompat/Microsoft.DotNet.ApiCompatibility/Microsoft.DotNet.ApiCompatibility.csproj ++++ b/src/ApiCompat/Microsoft.DotNet.ApiCompatibility/Microsoft.DotNet.ApiCompatibility.csproj +@@ -1,7 +1,7 @@ +  + + +- net6.0;net472 ++ net7.0;net472 + Open + enable + +diff --git a/src/ApiCompat/Microsoft.DotNet.PackageValidation/Microsoft.DotNet.PackageValidation.csproj b/src/ApiCompat/Microsoft.DotNet.PackageValidation/Microsoft.DotNet.PackageValidation.csproj +index aa6de655f5..fca12f7f67 100644 +--- a/src/ApiCompat/Microsoft.DotNet.PackageValidation/Microsoft.DotNet.PackageValidation.csproj ++++ b/src/ApiCompat/Microsoft.DotNet.PackageValidation/Microsoft.DotNet.PackageValidation.csproj +@@ -1,7 +1,7 @@ +  + + +- net6.0;net472 ++ net7.0;net472 + Open + enable + +diff --git a/src/BuiltInTools/DotNetDeltaApplier/Microsoft.Extensions.DotNetDeltaApplier.csproj b/src/BuiltInTools/DotNetDeltaApplier/Microsoft.Extensions.DotNetDeltaApplier.csproj +index 40927ae1f2..3c2236e38d 100644 +--- a/src/BuiltInTools/DotNetDeltaApplier/Microsoft.Extensions.DotNetDeltaApplier.csproj ++++ b/src/BuiltInTools/DotNetDeltaApplier/Microsoft.Extensions.DotNetDeltaApplier.csproj +@@ -1,7 +1,7 @@ +  + + +- net6.0 ++ net7.0 + MicrosoftAspNetCore + + false +diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj b/src/Cli/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj +index 006f56939d..ddcfe2e362 100644 +--- a/src/Cli/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj ++++ b/src/Cli/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj +@@ -22,7 +22,7 @@ + + + +- $(PkgMicrosoft_Build_Runtime)\contentFiles\any\net6.0\MSBuild.dll ++ $(PkgMicrosoft_Build_Runtime)\contentFiles\any\net7.0\MSBuild.dll + + + +diff --git a/src/Layout/redist/targets/GenerateLayout.targets b/src/Layout/redist/targets/GenerateLayout.targets +index 85adb4ed8a..d399fe6f29 100644 +--- a/src/Layout/redist/targets/GenerateLayout.targets ++++ b/src/Layout/redist/targets/GenerateLayout.targets +@@ -161,7 +161,7 @@ + BeforeTargets="Build"> + + netcoreapp3.1 +- net6.0 ++ net7.0 + $(NuGetPackageRoot)/microsoft.testplatform.cli/$(MicrosoftTestPlatformCLIPackageVersion)/contentFiles/any/$(TestCliNuGetDirectoryTargetFramework)/ + + +@@ -196,7 +196,7 @@ + + + +- ++ + + + +diff --git a/src/Layout/redist/targets/OverlaySdkOnLKG.targets b/src/Layout/redist/targets/OverlaySdkOnLKG.targets +index b31188d592..4052c1581b 100644 +--- a/src/Layout/redist/targets/OverlaySdkOnLKG.targets ++++ b/src/Layout/redist/targets/OverlaySdkOnLKG.targets +@@ -77,7 +77,7 @@ + + + +- ++ + + + diff --git a/src/SourceBuild/tarball/patches/sdk/0002-Look-for-VSTest-in-net7.0-directory.patch b/src/SourceBuild/tarball/patches/sdk/0002-Look-for-VSTest-in-net7.0-directory.patch deleted file mode 100644 index 98a60451a..000000000 --- a/src/SourceBuild/tarball/patches/sdk/0002-Look-for-VSTest-in-net7.0-directory.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Logan Bussell -Date: Tue, 6 Sep 2022 15:50:53 -0700 -Subject: [PATCH] Look for VSTest in net7.0 directory - -Backport: https://github.com/dotnet/sdk/pull/27716 ---- - src/Layout/redist/targets/GenerateLayout.targets | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/Layout/redist/targets/GenerateLayout.targets b/src/Layout/redist/targets/GenerateLayout.targets -index 85adb4ed8a..148464df9e 100644 ---- a/src/Layout/redist/targets/GenerateLayout.targets -+++ b/src/Layout/redist/targets/GenerateLayout.targets -@@ -161,7 +161,7 @@ - BeforeTargets="Build"> - - netcoreapp3.1 -- net6.0 -+ net7.0 - $(NuGetPackageRoot)/microsoft.testplatform.cli/$(MicrosoftTestPlatformCLIPackageVersion)/contentFiles/any/$(TestCliNuGetDirectoryTargetFramework)/ - -