From 8e988a54c3502c51171cdea2b6afb614dd2373f2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 30 Mar 2024 01:44:43 +0000 Subject: [PATCH] [main] Rebootstrap with latest changes (#19145) Co-authored-by: Nikola Milosavljevic --- .../content/eng/Version.Details.xml | 4 +- src/SourceBuild/content/eng/Versions.props | 4 +- src/SourceBuild/content/global.json | 4 +- .../arcade/0002-Disable-CA2022-error.patch | 25 ++++++++++++ .../0001-Disable-CA2022-errors.patch | 39 +++++++++++++++++++ .../sdk/0001-Disable-CA2022-errors.patch | 39 +++++++++++++++++++ .../vstest/0001-Disable-CA2022-errors.patch | 25 ++++++++++++ .../xdt/0001-Disable-CA2022-error.patch | 24 ++++++++++++ 8 files changed, 158 insertions(+), 6 deletions(-) create mode 100644 src/SourceBuild/patches/arcade/0002-Disable-CA2022-error.patch create mode 100644 src/SourceBuild/patches/nuget-client/0001-Disable-CA2022-errors.patch create mode 100644 src/SourceBuild/patches/sdk/0001-Disable-CA2022-errors.patch create mode 100644 src/SourceBuild/patches/vstest/0001-Disable-CA2022-errors.patch create mode 100644 src/SourceBuild/patches/xdt/0001-Disable-CA2022-error.patch diff --git a/src/SourceBuild/content/eng/Version.Details.xml b/src/SourceBuild/content/eng/Version.Details.xml index 94046ba35..21ca8804d 100644 --- a/src/SourceBuild/content/eng/Version.Details.xml +++ b/src/SourceBuild/content/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 2fb543a45580400a559b5ae41c96a815ea14dac5 + 689fb2d1b620a9df28c3384d9b208e3654a0f928 diff --git a/src/SourceBuild/content/eng/Versions.props b/src/SourceBuild/content/eng/Versions.props index 3bf1c64c9..74c73d7fb 100644 --- a/src/SourceBuild/content/eng/Versions.props +++ b/src/SourceBuild/content/eng/Versions.props @@ -22,8 +22,8 @@ of a .NET major or minor release, prebuilts may be needed. When the release is mature, prebuilts are not necessary, and this property is removed from the file. --> - 9.0.100-preview.2.24104.1 - 9.0.100-preview.2.24104.1 + 9.0.100-preview.4.24179.1 + 9.0.100-preview.4.24179.1 15.7.179 diff --git a/src/SourceBuild/content/global.json b/src/SourceBuild/content/global.json index 593a57a50..5ffcf53ed 100644 --- a/src/SourceBuild/content/global.json +++ b/src/SourceBuild/content/global.json @@ -1,10 +1,10 @@ { "tools": { - "dotnet": "9.0.100-preview.2.24103.2" + "dotnet": "9.0.100-preview.4.24178.10" }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", "Microsoft.Build.Traversal": "3.4.0", - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24102.4" + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24177.2" } } diff --git a/src/SourceBuild/patches/arcade/0002-Disable-CA2022-error.patch b/src/SourceBuild/patches/arcade/0002-Disable-CA2022-error.patch new file mode 100644 index 000000000..ca717d5fc --- /dev/null +++ b/src/SourceBuild/patches/arcade/0002-Disable-CA2022-error.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nikola Milosavljevic +Date: Fri, 29 Mar 2024 16:33:22 +0000 +Subject: [PATCH] Disable CA2022 error + +Backport: https://github.com/dotnet/arcade/issues/14668 +--- + src/SignCheck/Microsoft.SignCheck/Verification/LZMAUtils.cs | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/SignCheck/Microsoft.SignCheck/Verification/LZMAUtils.cs b/src/SignCheck/Microsoft.SignCheck/Verification/LZMAUtils.cs +index 764a87fa6..e20f70ff4 100644 +--- a/src/SignCheck/Microsoft.SignCheck/Verification/LZMAUtils.cs ++++ b/src/SignCheck/Microsoft.SignCheck/Verification/LZMAUtils.cs +@@ -30,8 +30,10 @@ public static void Decompress(string sourceFile, string destinationFile) + byte[] properties = new byte[5]; + byte[] fileLengthBytes = new byte[8]; + ++#pragma warning disable CA2022 // Avoid inexact read + inFile.Read(properties, 0, 5); + inFile.Read(fileLengthBytes, 0, 8); ++#pragma warning restore CA2022 + + long fileLength = BitConverter.ToInt64(fileLengthBytes, 0); + decoder.SetDecoderProperties(properties); diff --git a/src/SourceBuild/patches/nuget-client/0001-Disable-CA2022-errors.patch b/src/SourceBuild/patches/nuget-client/0001-Disable-CA2022-errors.patch new file mode 100644 index 000000000..99782bd5f --- /dev/null +++ b/src/SourceBuild/patches/nuget-client/0001-Disable-CA2022-errors.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nikola Milosavljevic +Date: Sat, 30 Mar 2024 00:25:18 +0000 +Subject: [PATCH] Disable CA2022 errors + +Backport: https://github.com/NuGet/Home/issues/13361 +--- + .../Signing/Archive/SignedPackageArchiveUtility.cs | 2 ++ + src/NuGet.Core/NuGet.ProjectModel/Utf8JsonStreamReader.cs | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/src/NuGet.Core/NuGet.Packaging/Signing/Archive/SignedPackageArchiveUtility.cs b/src/NuGet.Core/NuGet.Packaging/Signing/Archive/SignedPackageArchiveUtility.cs +index 44f3dbdc2..0d133441d 100644 +--- a/src/NuGet.Core/NuGet.Packaging/Signing/Archive/SignedPackageArchiveUtility.cs ++++ b/src/NuGet.Core/NuGet.Packaging/Signing/Archive/SignedPackageArchiveUtility.cs +@@ -104,7 +104,9 @@ public static Stream OpenPackageSignatureFileStream(BinaryReader reader) + var buffer = new byte[localFileHeader.UncompressedSize]; + + reader.BaseStream.Seek(offsetToData, SeekOrigin.Begin); ++#pragma warning disable CA2022 // Avoid inexact read + reader.BaseStream.Read(buffer, offset: 0, count: buffer.Length); ++#pragma warning restore CA2022 + + return new MemoryStream(buffer, writable: false); + } +diff --git a/src/NuGet.Core/NuGet.ProjectModel/Utf8JsonStreamReader.cs b/src/NuGet.Core/NuGet.ProjectModel/Utf8JsonStreamReader.cs +index e92a2dc0c..0fb6b35f4 100644 +--- a/src/NuGet.Core/NuGet.ProjectModel/Utf8JsonStreamReader.cs ++++ b/src/NuGet.Core/NuGet.ProjectModel/Utf8JsonStreamReader.cs +@@ -52,7 +52,9 @@ internal Utf8JsonStreamReader(Stream stream, int bufferSize = BufferSizeDefault, + _buffer = _bufferPool.Rent(bufferSize); + _disposed = false; + _stream = stream; ++#pragma warning disable CA2022 // Avoid inexact read + _stream.Read(_buffer, 0, 3); ++#pragma warning restore CA2022 + if (!Utf8Bom.AsSpan().SequenceEqual(_buffer.AsSpan(0, 3))) + { + _bufferUsed = 3; diff --git a/src/SourceBuild/patches/sdk/0001-Disable-CA2022-errors.patch b/src/SourceBuild/patches/sdk/0001-Disable-CA2022-errors.patch new file mode 100644 index 000000000..4f4de8d56 --- /dev/null +++ b/src/SourceBuild/patches/sdk/0001-Disable-CA2022-errors.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nikola Milosavljevic +Date: Fri, 29 Mar 2024 19:48:28 +0000 +Subject: [PATCH] Disable CA2022 errors + +Backport: https://github.com/dotnet/sdk/issues/39893 +--- + src/RazorSdk/Tool/Client.cs | 2 ++ + src/RazorSdk/Tool/ConnectionHost.cs | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/src/RazorSdk/Tool/Client.cs b/src/RazorSdk/Tool/Client.cs +index 3a0436aa8b..54c89bf8d6 100644 +--- a/src/RazorSdk/Tool/Client.cs ++++ b/src/RazorSdk/Tool/Client.cs +@@ -169,7 +169,9 @@ public override async Task WaitForDisconnectAsync(CancellationToken cancellation + try + { + ServerLogger.Log($"Before poking pipe {Identifier}."); ++#pragma warning disable CA2022 // Avoid inexact read + await Stream.ReadAsync(Array.Empty(), 0, 0, cancellationToken); ++#pragma warning restore CA2022 + ServerLogger.Log($"After poking pipe {Identifier}."); + } + catch (OperationCanceledException) +diff --git a/src/RazorSdk/Tool/ConnectionHost.cs b/src/RazorSdk/Tool/ConnectionHost.cs +index d1c557dea9..f92397d6e9 100644 +--- a/src/RazorSdk/Tool/ConnectionHost.cs ++++ b/src/RazorSdk/Tool/ConnectionHost.cs +@@ -107,7 +107,9 @@ public override async Task WaitForDisconnectAsync(CancellationToken cancellation + try + { + ServerLogger.Log($"Before poking pipe {Identifier}."); ++#pragma warning disable CA2022 // Avoid inexact read + await Stream.ReadAsync(Array.Empty(), 0, 0, cancellationToken); ++#pragma warning restore CA2022 + ServerLogger.Log($"After poking pipe {Identifier}."); + } + catch (OperationCanceledException) diff --git a/src/SourceBuild/patches/vstest/0001-Disable-CA2022-errors.patch b/src/SourceBuild/patches/vstest/0001-Disable-CA2022-errors.patch new file mode 100644 index 000000000..33248b7f8 --- /dev/null +++ b/src/SourceBuild/patches/vstest/0001-Disable-CA2022-errors.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nikola Milosavljevic +Date: Fri, 29 Mar 2024 18:27:34 +0000 +Subject: [PATCH] Disable CA2022 errors + +Backport: https://github.com/microsoft/vstest/issues/4955 +--- + .../Helpers/DotnetHostHelper.cs | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/DotnetHostHelper.cs b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/DotnetHostHelper.cs +index 519ee3441..3f8192014 100644 +--- a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/DotnetHostHelper.cs ++++ b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/DotnetHostHelper.cs +@@ -409,8 +409,10 @@ public class DotnetHostHelper : IDotnetHostHelper + using var headerReader = _fileHelper.GetStream(path, FileMode.Open, FileAccess.Read); + var magicBytes = new byte[4]; + var cpuInfoBytes = new byte[4]; ++#pragma warning disable CA2022 // Avoid inexact read + headerReader.Read(magicBytes, 0, magicBytes.Length); + headerReader.Read(cpuInfoBytes, 0, cpuInfoBytes.Length); ++#pragma warning restore CA2022 + + var magic = BitConverter.ToUInt32(magicBytes, 0); + var cpuInfo = BitConverter.ToUInt32(cpuInfoBytes, 0); diff --git a/src/SourceBuild/patches/xdt/0001-Disable-CA2022-error.patch b/src/SourceBuild/patches/xdt/0001-Disable-CA2022-error.patch new file mode 100644 index 000000000..5b93a52cb --- /dev/null +++ b/src/SourceBuild/patches/xdt/0001-Disable-CA2022-error.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nikola Milosavljevic +Date: Fri, 29 Mar 2024 18:22:05 +0000 +Subject: [PATCH] Disable CA2022 error + +Backport: https://github.com/dotnet/xdt/issues/583 +--- + src/Microsoft.Web.XmlTransform/XmlFileInfoDocument.cs | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/Microsoft.Web.XmlTransform/XmlFileInfoDocument.cs b/src/Microsoft.Web.XmlTransform/XmlFileInfoDocument.cs +index 5c884d7..1e86c48 100644 +--- a/src/Microsoft.Web.XmlTransform/XmlFileInfoDocument.cs ++++ b/src/Microsoft.Web.XmlTransform/XmlFileInfoDocument.cs +@@ -90,7 +90,9 @@ public class XmlFileInfoDocument : XmlDocument, IDisposable + Encoding encoding = null; + if (stream.CanSeek) { + byte[] buffer = new byte[3]; ++#pragma warning disable CA2022 // Avoid inexact read + stream.Read(buffer, 0, buffer.Length); ++#pragma warning restore CA2022 + + if (buffer[0] == 0xEF && buffer[1] == 0xBB && buffer[2] == 0xBF) + encoding = Encoding.UTF8;