dotnet-installer/src/SourceBuild/tarball/patches/nuget-client/0006-Upgrade-to-.NET-6-SDK.patch

125 lines
6.2 KiB
Diff
Raw Normal View History

[ArPow] Add NuGet.Client (#11489) * [main] Update dependencies from dotnet/sdk (#11565) [main] Update dependencies from dotnet/sdk - Coherency Updates: - Microsoft.AspNetCore.App.Ref: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk) - Microsoft.AspNetCore.App.Ref.Internal: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk) - Microsoft.AspNetCore.App.Runtime.win-x64: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk) - VS.Redist.Common.AspNetCore.SharedFramework.x64.6.0: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk) - dotnet-dev-certs: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk) - dotnet-user-secrets: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk) * Update dependencies from https://github.com/dotnet/sdk build 20210817.21 (#11569) [main] Update dependencies from dotnet/sdk - Coherency Updates: - Microsoft.NET.Test.Sdk: from 17.0.0-preview-20210817-01 to 17.0.0-preview-20210817-02 (parent: Microsoft.NET.Sdk) * Update dependencies from https://github.com/dotnet/arcade build 20210817.1 (#11570) [main] Update dependencies from dotnet/arcade - Coherency Updates: - Microsoft.SourceLink.GitHub: from 1.1.0-beta-21309-01 to 1.1.0-beta-21416-05 (parent: Microsoft.DotNet.Arcade.Sdk) - Microsoft.DotNet.XliffTasks: from 1.0.0-beta.21412.1 to 1.0.0-beta.21414.1 (parent: Microsoft.DotNet.Arcade.Sdk) * [ArPow] Add runtime repo to tarball (#11506) * Add runtime repo / update runtime project * Update runtime-portable logs and properties * Create runtime-portable git-info * Fix unpack of IntermediatePackages * Re-enable references to runtime * Pass TargetRid and NonPortable to runtime build * Only build allconfigurations in non-portable build * Add SDK patch to disable new CA warning * Increase built tarball timeout * Update prebuilt version * Remove 5.0.3xx and preview 7 Add rc1, 6.0 daily, and move main to 7.0 * Removing 7.0 for now as there aren't builds yet. * Update dependencies from https://github.com/dotnet/arcade build 20210818.12 (#11594) [main] Update dependencies from dotnet/arcade - Coherency Updates: - Microsoft.SourceLink.GitHub: from 1.1.0-beta-21416-05 to 1.1.0-beta-21417-01 (parent: Microsoft.DotNet.Arcade.Sdk) - Microsoft.DotNet.XliffTasks: from 1.0.0-beta.21414.1 to 1.0.0-beta.21417.1 (parent: Microsoft.DotNet.Arcade.Sdk) * [ArPow] Add installer repo to tarball (#11483) * Fix the rc2 aka.ms links * Add NuGet * Make safe repo name safer. * some more props filename stuff * Patches to get the repo to build * Use NuGet build script instead of manually calling msbuild. * Add patch for source-build in build.sh in nuget. * Use existing 5.0 nuget patch. * Fixes for build scripts and .NET 6 SDK upgrade. * Remove obsolete patch - this was caused by not using the correct source-build SDK. * Address code review comment for source-build build script. * Restore reference from installer to NuGet. * Fix patch not applying. * Don't try to pass Arcade build args to MSBuild. * Fix script typo. * Patch NuGet.Frameworks to produce netstandard2.0 for VSTest. * Did this patch the wrong way around. * Ignore failure in no-network case * UPdate prebuilts version. Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Dan Seefeldt <dseefeld@microsoft.com> Co-authored-by: Marc Paine <marcpop@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Galbraith <mattgal@microsoft.com>
2021-08-24 15:01:06 -05:00
From d3c633ad00408b2b6122b70d9a152d1ab79c8378 Mon Sep 17 00:00:00 2001
From: Chris Rummel <crummel@microsoft.com>
Date: Thu, 19 Aug 2021 11:01:04 -0500
Subject: [PATCH 2/2] Upgrade to .NET 6 SDK.
---
.../NuGet.Commands/SignCommand/CertificateProvider.cs | 4 ++--
.../NuGet.Packaging/Signing/Authoring/SignPackageRequest.cs | 2 ++
src/NuGet.Core/NuGet.Packaging/Signing/Cms/NativeUtility.cs | 2 ++
.../HttpSource/HttpRequestMessageExtensions.cs | 6 +++---
.../NuGet.Protocol/HttpSource/HttpRetryHandler.cs | 2 +-
.../HttpSource/HttpSourceAuthenticationHandler.cs | 2 +-
6 files changed, 11 insertions(+), 7 deletions(-)
[ArPow] Add NuGet.Client (#11489) * [main] Update dependencies from dotnet/sdk (#11565) [main] Update dependencies from dotnet/sdk - Coherency Updates: - Microsoft.AspNetCore.App.Ref: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk) - Microsoft.AspNetCore.App.Ref.Internal: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk) - Microsoft.AspNetCore.App.Runtime.win-x64: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk) - VS.Redist.Common.AspNetCore.SharedFramework.x64.6.0: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk) - dotnet-dev-certs: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk) - dotnet-user-secrets: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk) * Update dependencies from https://github.com/dotnet/sdk build 20210817.21 (#11569) [main] Update dependencies from dotnet/sdk - Coherency Updates: - Microsoft.NET.Test.Sdk: from 17.0.0-preview-20210817-01 to 17.0.0-preview-20210817-02 (parent: Microsoft.NET.Sdk) * Update dependencies from https://github.com/dotnet/arcade build 20210817.1 (#11570) [main] Update dependencies from dotnet/arcade - Coherency Updates: - Microsoft.SourceLink.GitHub: from 1.1.0-beta-21309-01 to 1.1.0-beta-21416-05 (parent: Microsoft.DotNet.Arcade.Sdk) - Microsoft.DotNet.XliffTasks: from 1.0.0-beta.21412.1 to 1.0.0-beta.21414.1 (parent: Microsoft.DotNet.Arcade.Sdk) * [ArPow] Add runtime repo to tarball (#11506) * Add runtime repo / update runtime project * Update runtime-portable logs and properties * Create runtime-portable git-info * Fix unpack of IntermediatePackages * Re-enable references to runtime * Pass TargetRid and NonPortable to runtime build * Only build allconfigurations in non-portable build * Add SDK patch to disable new CA warning * Increase built tarball timeout * Update prebuilt version * Remove 5.0.3xx and preview 7 Add rc1, 6.0 daily, and move main to 7.0 * Removing 7.0 for now as there aren't builds yet. * Update dependencies from https://github.com/dotnet/arcade build 20210818.12 (#11594) [main] Update dependencies from dotnet/arcade - Coherency Updates: - Microsoft.SourceLink.GitHub: from 1.1.0-beta-21416-05 to 1.1.0-beta-21417-01 (parent: Microsoft.DotNet.Arcade.Sdk) - Microsoft.DotNet.XliffTasks: from 1.0.0-beta.21414.1 to 1.0.0-beta.21417.1 (parent: Microsoft.DotNet.Arcade.Sdk) * [ArPow] Add installer repo to tarball (#11483) * Fix the rc2 aka.ms links * Add NuGet * Make safe repo name safer. * some more props filename stuff * Patches to get the repo to build * Use NuGet build script instead of manually calling msbuild. * Add patch for source-build in build.sh in nuget. * Use existing 5.0 nuget patch. * Fixes for build scripts and .NET 6 SDK upgrade. * Remove obsolete patch - this was caused by not using the correct source-build SDK. * Address code review comment for source-build build script. * Restore reference from installer to NuGet. * Fix patch not applying. * Don't try to pass Arcade build args to MSBuild. * Fix script typo. * Patch NuGet.Frameworks to produce netstandard2.0 for VSTest. * Did this patch the wrong way around. * Ignore failure in no-network case * UPdate prebuilts version. Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Dan Seefeldt <dseefeld@microsoft.com> Co-authored-by: Marc Paine <marcpop@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Galbraith <mattgal@microsoft.com>
2021-08-24 15:01:06 -05:00
diff --git a/src/NuGet.Core/NuGet.Commands/SignCommand/CertificateProvider.cs b/src/NuGet.Core/NuGet.Commands/SignCommand/CertificateProvider.cs
index c6ea71243..beac41889 100644
--- a/src/NuGet.Core/NuGet.Commands/SignCommand/CertificateProvider.cs
+++ b/src/NuGet.Core/NuGet.Commands/SignCommand/CertificateProvider.cs
@@ -115,7 +115,7 @@ public static async Task<X509Certificate2Collection> GetCertificatesAsync(Certif
return resultCollection;
}
-
+#pragma warning disable CS1998
private static async Task<X509Certificate2> LoadCertificateFromFileAsync(CertificateSourceOptions options)
{
X509Certificate2 cert;
@@ -154,7 +154,7 @@ private static async Task<X509Certificate2> LoadCertificateFromFileAsync(Certifi
return cert;
}
-
+#pragma warning restore CS1998
private static X509Certificate2Collection LoadCertificateFromStore(CertificateSourceOptions options)
{
X509Certificate2Collection resultCollection = null;
diff --git a/src/NuGet.Core/NuGet.Packaging/Signing/Authoring/SignPackageRequest.cs b/src/NuGet.Core/NuGet.Packaging/Signing/Authoring/SignPackageRequest.cs
index e0cfae99f..ce19f2d6e 100644
--- a/src/NuGet.Core/NuGet.Packaging/Signing/Authoring/SignPackageRequest.cs
+++ b/src/NuGet.Core/NuGet.Packaging/Signing/Authoring/SignPackageRequest.cs
@@ -98,7 +98,9 @@ protected virtual void Dispose(bool disposing)
Chain?.Dispose();
#if IS_SIGNING_SUPPORTED
+#pragma warning disable CA1416
PrivateKey?.Dispose();
+#pragma warning restore CA1416
#endif
}
diff --git a/src/NuGet.Core/NuGet.Packaging/Signing/Cms/NativeUtility.cs b/src/NuGet.Core/NuGet.Packaging/Signing/Cms/NativeUtility.cs
index 565ac60b7..d57e38a65 100644
--- a/src/NuGet.Core/NuGet.Packaging/Signing/Cms/NativeUtility.cs
+++ b/src/NuGet.Core/NuGet.Packaging/Signing/Cms/NativeUtility.cs
@@ -120,7 +120,9 @@ internal static SignedCms NativeSign(CmsSigner cmsSigner, byte[] data, CngKey pr
signerInfo.cbSize = (uint)Marshal.SizeOf(signerInfo);
signerInfo.pCertInfo = MarshalUtility.PtrToStructure<CERT_CONTEXT>(cmsSigner.Certificate.Handle).pCertInfo;
+#pragma warning disable CA1416
signerInfo.hCryptProvOrhNCryptKey = privateKey.Handle.DangerousGetHandle();
+#pragma warning restore CA1416
signerInfo.HashAlgorithm.pszObjId = cmsSigner.DigestAlgorithm.Value;
if (cmsSigner.SignerIdentifierType == SubjectIdentifierType.SubjectKeyIdentifier)
diff --git a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRequestMessageExtensions.cs b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRequestMessageExtensions.cs
index 7c9595268..1ca751850 100644
--- a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRequestMessageExtensions.cs
+++ b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRequestMessageExtensions.cs
@@ -34,7 +34,7 @@ internal static HttpRequestMessage Clone(this HttpRequestMessage request)
clone.Headers.TryAddWithoutValidation(header.Key, header.Value);
}
-#if NET5_0
+#if NET5_0 || NET6_0
var clonedOptions = (IDictionary<string, object>)clone.Options;
foreach (var option in request.Options)
{
@@ -118,7 +118,7 @@ public static void SetConfiguration(this HttpRequestMessage request, HttpRequest
throw new ArgumentNullException(nameof(configuration));
}
-#if NET5_0
+#if NET5_0 || NET6_0
request.Options.Set(new HttpRequestOptionsKey<HttpRequestMessageConfiguration>(NuGetConfigurationKey), configuration);
#else
request.Properties[NuGetConfigurationKey] = configuration;
@@ -128,7 +128,7 @@ public static void SetConfiguration(this HttpRequestMessage request, HttpRequest
private static T GetProperty<T>(this HttpRequestMessage request, string key)
{
-#if NET5_0
+#if NET5_0 || NET6_0
if (request.Options.TryGetValue<T>(new HttpRequestOptionsKey<T>(key), out T result))
#else
object result;
diff --git a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRetryHandler.cs b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRetryHandler.cs
index 67a1726b6..0534e936e 100644
--- a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRetryHandler.cs
+++ b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRetryHandler.cs
@@ -81,7 +81,7 @@ public class HttpRetryHandler : IHttpRetryHandler
headerStopwatch = new Stopwatch();
stopwatches.Add(headerStopwatch);
}
-#if NET5_0
+#if NET5_0 || NET6_0
requestMessage.Options.Set(new HttpRequestOptionsKey<List<Stopwatch>>(StopwatchPropertyName), stopwatches);
#else
requestMessage.Properties[StopwatchPropertyName] = stopwatches;
diff --git a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpSourceAuthenticationHandler.cs b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpSourceAuthenticationHandler.cs
index b9ab58ce7..ebf738e52 100644
--- a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpSourceAuthenticationHandler.cs
+++ b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpSourceAuthenticationHandler.cs
@@ -98,7 +98,7 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
{
List<Stopwatch> stopwatches = null;
-#if NET5_0
+#if NET5_0 || NET6_0
if (request.Options.TryGetValue(
new HttpRequestOptionsKey<List<Stopwatch>>(HttpRetryHandler.StopwatchPropertyName),
out stopwatches))
--
2.18.0