From f4058821a953940932c2b99371a271e5867ceb53 Mon Sep 17 00:00:00 2001 From: Daniel Marbach Date: Mon, 21 Oct 2024 22:26:48 +0200 Subject: [PATCH 1/7] Upgrade NET6.0 to NET8.0 since NET6.0 is EOL --- .github/workflows/build-test.yaml | 2 +- .github/workflows/oauth2.yaml | 2 +- projects/Benchmarks/Benchmarks.csproj | 4 ++-- projects/RabbitMQ.Client.OAuth2/RabbitMQ.Client.OAuth2.csproj | 2 +- .../RabbitMQ.Client.OpenTelemetry.csproj | 2 +- projects/RabbitMQ.Client/Impl/SessionBase.cs | 4 ++-- projects/RabbitMQ.Client/RabbitMQ.Client.csproj | 4 ++-- projects/RabbitMQ.Client/TypeExtensions.cs | 2 +- projects/Test/Applications/CreateChannel/CreateChannel.csproj | 4 ++-- projects/Test/Applications/GH-1647/GH-1647.csproj | 2 +- projects/Test/Applications/MassPublish/MassPublish.csproj | 4 ++-- .../Applications/PublisherConfirms/PublisherConfirms.csproj | 2 +- projects/Test/Common/Common.csproj | 4 ++-- projects/Test/Integration/Integration.csproj | 4 ++-- projects/Test/OAuth2/OAuth2.csproj | 4 ++-- .../Test/SequentialIntegration/SequentialIntegration.csproj | 4 ++-- projects/Test/Unit/Unit.csproj | 4 ++-- 17 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 07d13d90ef..cab3d66b3a 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -218,7 +218,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 6.x + dotnet-version: 8.x - name: Download Build (Debug) uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/oauth2.yaml b/.github/workflows/oauth2.yaml index efbe4ffee4..556826014c 100644 --- a/.github/workflows/oauth2.yaml +++ b/.github/workflows/oauth2.yaml @@ -19,7 +19,7 @@ jobs: submodules: true - uses: actions/setup-dotnet@v4 with: - dotnet-version: 6.x + dotnet-version: 8.x - uses: actions/cache@v4 with: path: | diff --git a/projects/Benchmarks/Benchmarks.csproj b/projects/Benchmarks/Benchmarks.csproj index 1501125875..deae254f20 100644 --- a/projects/Benchmarks/Benchmarks.csproj +++ b/projects/Benchmarks/Benchmarks.csproj @@ -1,13 +1,13 @@ - net6.0;net472 + net8.0;net472 $(NoWarn);CA2007 true - net6.0 + net8.0 $(NoWarn);CA2007 true diff --git a/projects/RabbitMQ.Client.OAuth2/RabbitMQ.Client.OAuth2.csproj b/projects/RabbitMQ.Client.OAuth2/RabbitMQ.Client.OAuth2.csproj index 9504ead771..f2a1d75abc 100644 --- a/projects/RabbitMQ.Client.OAuth2/RabbitMQ.Client.OAuth2.csproj +++ b/projects/RabbitMQ.Client.OAuth2/RabbitMQ.Client.OAuth2.csproj @@ -1,7 +1,7 @@  - net6.0;netstandard2.0 + net8.0;netstandard2.0 $(NoWarn);CS1591 true RabbitMQ OAuth2 Client Library for .NET diff --git a/projects/RabbitMQ.Client.OpenTelemetry/RabbitMQ.Client.OpenTelemetry.csproj b/projects/RabbitMQ.Client.OpenTelemetry/RabbitMQ.Client.OpenTelemetry.csproj index 06fa5696f4..1b334ef77d 100644 --- a/projects/RabbitMQ.Client.OpenTelemetry/RabbitMQ.Client.OpenTelemetry.csproj +++ b/projects/RabbitMQ.Client.OpenTelemetry/RabbitMQ.Client.OpenTelemetry.csproj @@ -1,7 +1,7 @@  - net6.0;netstandard2.0 + net8.0;netstandard2.0 $(NoWarn);CS1591 true RabbitMQ OpenTelemetry Integration Package for .NET diff --git a/projects/RabbitMQ.Client/Impl/SessionBase.cs b/projects/RabbitMQ.Client/Impl/SessionBase.cs index 863881efd5..0e0c363eda 100644 --- a/projects/RabbitMQ.Client/Impl/SessionBase.cs +++ b/projects/RabbitMQ.Client/Impl/SessionBase.cs @@ -128,7 +128,7 @@ public virtual ValueTask TransmitAsync(in T cmd, CancellationToken cancellati ThrowAlreadyClosedException(); } - RentedMemory bytes = Framing.SerializeToFrames(ref Unsafe.AsRef(cmd), ChannelNumber); + RentedMemory bytes = Framing.SerializeToFrames(ref Unsafe.AsRef(in cmd), ChannelNumber); RabbitMQActivitySource.PopulateMessageEnvelopeSize(Activity.Current, bytes.Size); return Connection.WriteAsync(bytes, cancellationToken); } @@ -142,7 +142,7 @@ public ValueTask TransmitAsync(in TMethod cmd, in THeader head ThrowAlreadyClosedException(); } - RentedMemory bytes = Framing.SerializeToFrames(ref Unsafe.AsRef(cmd), ref Unsafe.AsRef(header), body, ChannelNumber, Connection.MaxPayloadSize); + RentedMemory bytes = Framing.SerializeToFrames(ref Unsafe.AsRef(in cmd), ref Unsafe.AsRef(in header), body, ChannelNumber, Connection.MaxPayloadSize); RabbitMQActivitySource.PopulateMessageEnvelopeSize(Activity.Current, bytes.Size); return Connection.WriteAsync(bytes, cancellationToken); } diff --git a/projects/RabbitMQ.Client/RabbitMQ.Client.csproj b/projects/RabbitMQ.Client/RabbitMQ.Client.csproj index fbcdd21226..37a7d0e8e2 100644 --- a/projects/RabbitMQ.Client/RabbitMQ.Client.csproj +++ b/projects/RabbitMQ.Client/RabbitMQ.Client.csproj @@ -1,7 +1,7 @@ - net6.0;netstandard2.0 + net8.0;netstandard2.0 $(NoWarn);CS1591 true true @@ -33,7 +33,7 @@ https://learn.microsoft.com/en-us/answers/questions/1371494/for-net-standard-2-0-library-why-add-net-core-3-1 https://devblogs.microsoft.com/dotnet/embracing-nullable-reference-types/#what-should-library-authors-do --> - 9.0 + 12.0 enable diff --git a/projects/RabbitMQ.Client/TypeExtensions.cs b/projects/RabbitMQ.Client/TypeExtensions.cs index ee1e4f916e..97f913911b 100644 --- a/projects/RabbitMQ.Client/TypeExtensions.cs +++ b/projects/RabbitMQ.Client/TypeExtensions.cs @@ -46,7 +46,7 @@ public static ref byte GetStart(this ReadOnlySpan span) [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ref byte GetStart(this byte[] array) { - return ref Unsafe.AsRef(array[0]); + return ref Unsafe.AsRef(in array[0]); } [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/projects/Test/Applications/CreateChannel/CreateChannel.csproj b/projects/Test/Applications/CreateChannel/CreateChannel.csproj index 2ff780b2a3..82fe5c3fe4 100644 --- a/projects/Test/Applications/CreateChannel/CreateChannel.csproj +++ b/projects/Test/Applications/CreateChannel/CreateChannel.csproj @@ -1,13 +1,13 @@ - net6.0;net472 + net8.0;net472 $(NoWarn);CA2007 true - net6.0 + net8.0 $(NoWarn);CA2007 true diff --git a/projects/Test/Applications/GH-1647/GH-1647.csproj b/projects/Test/Applications/GH-1647/GH-1647.csproj index 022441c0e1..e068a1961c 100644 --- a/projects/Test/Applications/GH-1647/GH-1647.csproj +++ b/projects/Test/Applications/GH-1647/GH-1647.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 GH_1647 enable enable diff --git a/projects/Test/Applications/MassPublish/MassPublish.csproj b/projects/Test/Applications/MassPublish/MassPublish.csproj index 2ff780b2a3..82fe5c3fe4 100644 --- a/projects/Test/Applications/MassPublish/MassPublish.csproj +++ b/projects/Test/Applications/MassPublish/MassPublish.csproj @@ -1,13 +1,13 @@ - net6.0;net472 + net8.0;net472 $(NoWarn);CA2007 true - net6.0 + net8.0 $(NoWarn);CA2007 true diff --git a/projects/Test/Applications/PublisherConfirms/PublisherConfirms.csproj b/projects/Test/Applications/PublisherConfirms/PublisherConfirms.csproj index 9e089be82f..35cb61e005 100644 --- a/projects/Test/Applications/PublisherConfirms/PublisherConfirms.csproj +++ b/projects/Test/Applications/PublisherConfirms/PublisherConfirms.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 $(NoWarn);CA2007 true diff --git a/projects/Test/Common/Common.csproj b/projects/Test/Common/Common.csproj index 3c283cef8d..1bbd691b79 100644 --- a/projects/Test/Common/Common.csproj +++ b/projects/Test/Common/Common.csproj @@ -1,13 +1,13 @@  - net6.0;net472 + net8.0;net472 $(NoWarn);CA2007 true - net6.0 + net8.0 $(NoWarn);CA2007 true diff --git a/projects/Test/Integration/Integration.csproj b/projects/Test/Integration/Integration.csproj index 64ff8776b5..483b52932d 100644 --- a/projects/Test/Integration/Integration.csproj +++ b/projects/Test/Integration/Integration.csproj @@ -1,13 +1,13 @@ - net6.0;net472 + net8.0;net472 $(NoWarn);CA2007 true - net6.0 + net8.0 $(NoWarn);CA2007 true diff --git a/projects/Test/OAuth2/OAuth2.csproj b/projects/Test/OAuth2/OAuth2.csproj index 11e1123a74..8dd9b28f5b 100644 --- a/projects/Test/OAuth2/OAuth2.csproj +++ b/projects/Test/OAuth2/OAuth2.csproj @@ -1,13 +1,13 @@  - net6.0;net472 + net8.0;net472 $(NoWarn);CA2007 true - net6.0 + net8.0 $(NoWarn);CA2007 true diff --git a/projects/Test/SequentialIntegration/SequentialIntegration.csproj b/projects/Test/SequentialIntegration/SequentialIntegration.csproj index 9664afe2b1..474768133b 100644 --- a/projects/Test/SequentialIntegration/SequentialIntegration.csproj +++ b/projects/Test/SequentialIntegration/SequentialIntegration.csproj @@ -1,13 +1,13 @@  - net6.0;net472 + net8.0;net472 $(NoWarn);CA2007 true - net6.0 + net8.0 $(NoWarn);CA2007 true diff --git a/projects/Test/Unit/Unit.csproj b/projects/Test/Unit/Unit.csproj index 0a0286a4bd..9b5deb7107 100644 --- a/projects/Test/Unit/Unit.csproj +++ b/projects/Test/Unit/Unit.csproj @@ -1,13 +1,13 @@ - net6.0;net472 + net8.0;net472 $(NoWarn);CA2007 true - net6.0 + net8.0 $(NoWarn);CA2007 true From 20dadd012b28000db79cf817ee01398abc28f00f Mon Sep 17 00:00:00 2001 From: Daniel Marbach Date: Mon, 21 Oct 2024 22:32:59 +0200 Subject: [PATCH 2/7] Bump packages --- projects/Directory.Packages.props | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/projects/Directory.Packages.props b/projects/Directory.Packages.props index e859bc9238..e29716df81 100644 --- a/projects/Directory.Packages.props +++ b/projects/Directory.Packages.props @@ -14,7 +14,7 @@ Note: do NOT upgrade the System.IO.Pipelines dependency unless necessary See https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/1481#pullrequestreview-1847905299 --> - + @@ -29,18 +29,12 @@ * https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/1481#pullrequestreview-1847905299 * https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/1594 --> - + - - - - - - - - - - + + + + From a5306263b4b25d80c0cb59f4e49f73a2fbb377af Mon Sep 17 00:00:00 2001 From: Daniel Marbach Date: Mon, 21 Oct 2024 22:40:25 +0200 Subject: [PATCH 3/7] Condition trimming --- projects/RabbitMQ.Client/RabbitMQ.Client.csproj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/RabbitMQ.Client/RabbitMQ.Client.csproj b/projects/RabbitMQ.Client/RabbitMQ.Client.csproj index 37a7d0e8e2..1e7d59b922 100644 --- a/projects/RabbitMQ.Client/RabbitMQ.Client.csproj +++ b/projects/RabbitMQ.Client/RabbitMQ.Client.csproj @@ -3,8 +3,9 @@ net8.0;netstandard2.0 $(NoWarn);CS1591 - true - true + + true + true RabbitMQ Client Library for .NET Broadcom Broadcom, Inc. or its subsidiaries. From 908b26cf23ac3bda1b6fd435f7edb8b6ccf7e42c Mon Sep 17 00:00:00 2001 From: Daniel Marbach Date: Mon, 21 Oct 2024 22:46:47 +0200 Subject: [PATCH 4/7] LangVersion bump --- projects/RabbitMQ.Client.OAuth2/RabbitMQ.Client.OAuth2.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/RabbitMQ.Client.OAuth2/RabbitMQ.Client.OAuth2.csproj b/projects/RabbitMQ.Client.OAuth2/RabbitMQ.Client.OAuth2.csproj index f2a1d75abc..3059350139 100644 --- a/projects/RabbitMQ.Client.OAuth2/RabbitMQ.Client.OAuth2.csproj +++ b/projects/RabbitMQ.Client.OAuth2/RabbitMQ.Client.OAuth2.csproj @@ -31,7 +31,7 @@ https://learn.microsoft.com/en-us/answers/questions/1371494/for-net-standard-2-0-library-why-add-net-core-3-1 https://devblogs.microsoft.com/dotnet/embracing-nullable-reference-types/#what-should-library-authors-do --> - 9.0 + 12.0 enable From 1d0c37a6eb107cafeaeaf7b9f0c7dc2cba869f04 Mon Sep 17 00:00:00 2001 From: Daniel Marbach Date: Mon, 21 Oct 2024 22:51:32 +0200 Subject: [PATCH 5/7] Fix props --- projects/Directory.Packages.props | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/Directory.Packages.props b/projects/Directory.Packages.props index e29716df81..1d76dcea9c 100644 --- a/projects/Directory.Packages.props +++ b/projects/Directory.Packages.props @@ -36,6 +36,12 @@ + + + + + + From 4dd2a652cbf9cd6c4763f15056d6c7b5c3a45893 Mon Sep 17 00:00:00 2001 From: Daniel Marbach Date: Mon, 21 Oct 2024 22:52:30 +0200 Subject: [PATCH 6/7] More langversion --- .../RabbitMQ.Client.OpenTelemetry.csproj | 2 +- projects/Test/Applications/CreateChannel/CreateChannel.csproj | 2 +- projects/Test/Applications/MassPublish/MassPublish.csproj | 2 +- .../Applications/PublisherConfirms/PublisherConfirms.csproj | 2 +- projects/Test/Common/Common.csproj | 2 +- projects/Test/Integration/Integration.csproj | 2 +- projects/Test/OAuth2/OAuth2.csproj | 2 +- .../Test/SequentialIntegration/SequentialIntegration.csproj | 2 +- projects/Test/Unit/Unit.csproj | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/projects/RabbitMQ.Client.OpenTelemetry/RabbitMQ.Client.OpenTelemetry.csproj b/projects/RabbitMQ.Client.OpenTelemetry/RabbitMQ.Client.OpenTelemetry.csproj index 1b334ef77d..10efe3c889 100644 --- a/projects/RabbitMQ.Client.OpenTelemetry/RabbitMQ.Client.OpenTelemetry.csproj +++ b/projects/RabbitMQ.Client.OpenTelemetry/RabbitMQ.Client.OpenTelemetry.csproj @@ -27,7 +27,7 @@ true ../../packages README.md - 9.0 + 12.0 diff --git a/projects/Test/Applications/CreateChannel/CreateChannel.csproj b/projects/Test/Applications/CreateChannel/CreateChannel.csproj index 82fe5c3fe4..ba23a90dfe 100644 --- a/projects/Test/Applications/CreateChannel/CreateChannel.csproj +++ b/projects/Test/Applications/CreateChannel/CreateChannel.csproj @@ -14,7 +14,7 @@ Exe - 9.0 + 12.0 diff --git a/projects/Test/Applications/MassPublish/MassPublish.csproj b/projects/Test/Applications/MassPublish/MassPublish.csproj index 82fe5c3fe4..ba23a90dfe 100644 --- a/projects/Test/Applications/MassPublish/MassPublish.csproj +++ b/projects/Test/Applications/MassPublish/MassPublish.csproj @@ -14,7 +14,7 @@ Exe - 9.0 + 12.0 diff --git a/projects/Test/Applications/PublisherConfirms/PublisherConfirms.csproj b/projects/Test/Applications/PublisherConfirms/PublisherConfirms.csproj index 35cb61e005..0b0de7dd03 100644 --- a/projects/Test/Applications/PublisherConfirms/PublisherConfirms.csproj +++ b/projects/Test/Applications/PublisherConfirms/PublisherConfirms.csproj @@ -9,7 +9,7 @@ Exe enable - 9.0 + 12.0 diff --git a/projects/Test/Common/Common.csproj b/projects/Test/Common/Common.csproj index 1bbd691b79..cc5869ceeb 100644 --- a/projects/Test/Common/Common.csproj +++ b/projects/Test/Common/Common.csproj @@ -16,7 +16,7 @@ ../../rabbit.snk true false - 9.0 + 12.0 diff --git a/projects/Test/Integration/Integration.csproj b/projects/Test/Integration/Integration.csproj index 483b52932d..585302a85e 100644 --- a/projects/Test/Integration/Integration.csproj +++ b/projects/Test/Integration/Integration.csproj @@ -16,7 +16,7 @@ ../../rabbit.snk true true - 9.0 + 12.0 diff --git a/projects/Test/OAuth2/OAuth2.csproj b/projects/Test/OAuth2/OAuth2.csproj index 8dd9b28f5b..6710e5d211 100644 --- a/projects/Test/OAuth2/OAuth2.csproj +++ b/projects/Test/OAuth2/OAuth2.csproj @@ -16,7 +16,7 @@ ../../rabbit.snk true true - 9.0 + 12.0 enable diff --git a/projects/Test/SequentialIntegration/SequentialIntegration.csproj b/projects/Test/SequentialIntegration/SequentialIntegration.csproj index 474768133b..dff8ad5fb0 100644 --- a/projects/Test/SequentialIntegration/SequentialIntegration.csproj +++ b/projects/Test/SequentialIntegration/SequentialIntegration.csproj @@ -16,7 +16,7 @@ ../../rabbit.snk true true - 9.0 + 12.0 diff --git a/projects/Test/Unit/Unit.csproj b/projects/Test/Unit/Unit.csproj index 9b5deb7107..fc23c107ac 100644 --- a/projects/Test/Unit/Unit.csproj +++ b/projects/Test/Unit/Unit.csproj @@ -16,7 +16,7 @@ ../../rabbit.snk true true - 9.0 + 12.0 From 690e110d5ff2fa831ae898d8eb8684c15998391c Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Mon, 21 Oct 2024 14:32:23 -0700 Subject: [PATCH 7/7] No need for setup-dotnet on Ubuntu these days (https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#net-tools) --- .github/workflows/build-test.yaml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index cab3d66b3a..e6d1eb194a 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -136,10 +136,6 @@ jobs: uses: actions/checkout@v4 with: submodules: true - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 6.x - name: Cache NuGet packages uses: actions/cache@v4 with: @@ -174,10 +170,6 @@ jobs: uses: actions/checkout@v4 with: submodules: true - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 6.x - name: Download Build (Debug) uses: actions/download-artifact@v4 with: @@ -215,10 +207,6 @@ jobs: uses: actions/checkout@v4 with: submodules: true - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 8.x - name: Download Build (Debug) uses: actions/download-artifact@v4 with: