From 326da4fa0553d78c51f9350da331dde30f56e450 Mon Sep 17 00:00:00 2001 From: Andy Jordan Date: Mon, 7 Nov 2022 18:21:14 -0800 Subject: [PATCH 1/4] Update `nuke.globaltool` to fix macOS CI --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index e1a1594e1..2bdbbbe4c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "nuke.globaltool": { - "version": "6.0.3", + "version": "6.2.1", "commands": [ "nuke" ] From 8fcfd509c7f71c9e92f8cfc49e4721ee70a57e44 Mon Sep 17 00:00:00 2001 From: Andy Jordan Date: Mon, 7 Nov 2022 18:21:31 -0800 Subject: [PATCH 2/4] Revert "disable macos builds for now" This reverts commit 82934b6ebd417cd875c81c9b639c5b58b8866175 and commit 9b583ba8319534b1d704b7d3ba2d63fb8d67b6ce. --- .azure-pipelines.yml | 6 +++--- .github/workflows/ci.yml | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 2854ab770..a8652a9ce 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -63,9 +63,9 @@ jobs: Linux: BuildName: 'Linux' ImageName: 'ubuntu-latest' - # macOS: - # BuildName: 'macOS' - # ImageName: 'macOS-latest' + macOS: + BuildName: 'macOS' + ImageName: 'macOS-latest' pool: vmImage: $(ImageName) steps: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f36ecefe5..40913842c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,10 +75,7 @@ jobs: strategy: fail-fast: false matrix: - os: - # - macOS-latest - - windows-latest - - ubuntu-latest + os: [macOS-latest, windows-latest, ubuntu-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout From 62a94921deaa214ba01e14ae28b1f0b48fa3c080 Mon Sep 17 00:00:00 2001 From: Andy Jordan Date: Mon, 7 Nov 2022 15:46:20 -0800 Subject: [PATCH 3/4] Fix type forwarding for `init` and `record` workaround --- src/JsonRpc.Generators/Records.cs | 13 +++++-------- src/JsonRpc/Nullable/Records.cs | 13 +++++-------- test/Dap.Tests/Records.cs | 23 ----------------------- test/Generation.Tests/Records.cs | 23 ----------------------- test/Lsp.Integration.Tests/Records.cs | 23 ----------------------- test/Lsp.Tests/Records.cs | 23 ----------------------- 6 files changed, 10 insertions(+), 108 deletions(-) delete mode 100644 test/Dap.Tests/Records.cs delete mode 100644 test/Generation.Tests/Records.cs delete mode 100644 test/Lsp.Integration.Tests/Records.cs delete mode 100644 test/Lsp.Tests/Records.cs diff --git a/src/JsonRpc.Generators/Records.cs b/src/JsonRpc.Generators/Records.cs index 66cef4915..8682d81e7 100644 --- a/src/JsonRpc.Generators/Records.cs +++ b/src/JsonRpc.Generators/Records.cs @@ -1,6 +1,8 @@ #pragma warning disable MA0048 // File name must match type name -#define INTERNAL_RECORD_ATTRIBUTES -#if NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2 || NET45 || NET451 || NET452 || NET6 || NET461 || NET462 || NET47 || NET471 || NET472 || NET48 +#if NET5_0_OR_GREATER +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.IsExternalInit))] +#else + using System.ComponentModel; // ReSharper disable once CheckNamespace @@ -11,12 +13,7 @@ namespace System.Runtime.CompilerServices /// This class should not be used by developers in source code. /// [EditorBrowsable(EditorBrowsableState.Never)] -#if INTERNAL_RECORD_ATTRIBUTES - internal -#else - public -#endif - static class IsExternalInit + internal static class IsExternalInit { } } diff --git a/src/JsonRpc/Nullable/Records.cs b/src/JsonRpc/Nullable/Records.cs index 207d2246e..8682d81e7 100644 --- a/src/JsonRpc/Nullable/Records.cs +++ b/src/JsonRpc/Nullable/Records.cs @@ -1,6 +1,8 @@ #pragma warning disable MA0048 // File name must match type name -#define INTERNAL_RECORD_ATTRIBUTES -#if NETSTANDARD || NETCOREAPP +#if NET5_0_OR_GREATER +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.IsExternalInit))] +#else + using System.ComponentModel; // ReSharper disable once CheckNamespace @@ -11,12 +13,7 @@ namespace System.Runtime.CompilerServices /// This class should not be used by developers in source code. /// [EditorBrowsable(EditorBrowsableState.Never)] -#if INTERNAL_RECORD_ATTRIBUTES - internal -#else - public -#endif - static class IsExternalInit + internal static class IsExternalInit { } } diff --git a/test/Dap.Tests/Records.cs b/test/Dap.Tests/Records.cs deleted file mode 100644 index 207d2246e..000000000 --- a/test/Dap.Tests/Records.cs +++ /dev/null @@ -1,23 +0,0 @@ -#pragma warning disable MA0048 // File name must match type name -#define INTERNAL_RECORD_ATTRIBUTES -#if NETSTANDARD || NETCOREAPP -using System.ComponentModel; - -// ReSharper disable once CheckNamespace -namespace System.Runtime.CompilerServices -{ - /// - /// Reserved to be used by the compiler for tracking metadata. - /// This class should not be used by developers in source code. - /// - [EditorBrowsable(EditorBrowsableState.Never)] -#if INTERNAL_RECORD_ATTRIBUTES - internal -#else - public -#endif - static class IsExternalInit - { - } -} -#endif diff --git a/test/Generation.Tests/Records.cs b/test/Generation.Tests/Records.cs deleted file mode 100644 index 207d2246e..000000000 --- a/test/Generation.Tests/Records.cs +++ /dev/null @@ -1,23 +0,0 @@ -#pragma warning disable MA0048 // File name must match type name -#define INTERNAL_RECORD_ATTRIBUTES -#if NETSTANDARD || NETCOREAPP -using System.ComponentModel; - -// ReSharper disable once CheckNamespace -namespace System.Runtime.CompilerServices -{ - /// - /// Reserved to be used by the compiler for tracking metadata. - /// This class should not be used by developers in source code. - /// - [EditorBrowsable(EditorBrowsableState.Never)] -#if INTERNAL_RECORD_ATTRIBUTES - internal -#else - public -#endif - static class IsExternalInit - { - } -} -#endif diff --git a/test/Lsp.Integration.Tests/Records.cs b/test/Lsp.Integration.Tests/Records.cs deleted file mode 100644 index 207d2246e..000000000 --- a/test/Lsp.Integration.Tests/Records.cs +++ /dev/null @@ -1,23 +0,0 @@ -#pragma warning disable MA0048 // File name must match type name -#define INTERNAL_RECORD_ATTRIBUTES -#if NETSTANDARD || NETCOREAPP -using System.ComponentModel; - -// ReSharper disable once CheckNamespace -namespace System.Runtime.CompilerServices -{ - /// - /// Reserved to be used by the compiler for tracking metadata. - /// This class should not be used by developers in source code. - /// - [EditorBrowsable(EditorBrowsableState.Never)] -#if INTERNAL_RECORD_ATTRIBUTES - internal -#else - public -#endif - static class IsExternalInit - { - } -} -#endif diff --git a/test/Lsp.Tests/Records.cs b/test/Lsp.Tests/Records.cs deleted file mode 100644 index 207d2246e..000000000 --- a/test/Lsp.Tests/Records.cs +++ /dev/null @@ -1,23 +0,0 @@ -#pragma warning disable MA0048 // File name must match type name -#define INTERNAL_RECORD_ATTRIBUTES -#if NETSTANDARD || NETCOREAPP -using System.ComponentModel; - -// ReSharper disable once CheckNamespace -namespace System.Runtime.CompilerServices -{ - /// - /// Reserved to be used by the compiler for tracking metadata. - /// This class should not be used by developers in source code. - /// - [EditorBrowsable(EditorBrowsableState.Never)] -#if INTERNAL_RECORD_ATTRIBUTES - internal -#else - public -#endif - static class IsExternalInit - { - } -} -#endif From 37d75947a9bfbc3444a7e0ab5793a9f446be5000 Mon Sep 17 00:00:00 2001 From: Andy Jordan Date: Mon, 7 Nov 2022 18:30:12 -0800 Subject: [PATCH 4/4] Only target `net6.0` for tests So they don't need `IsExternalInit` defined too. --- sample/SampleServer/SampleServer.csproj | 2 +- test/Client.Tests/Client.Tests.csproj | 2 +- test/Dap.Tests/Dap.Tests.csproj | 4 ++-- test/Generation.Tests/Generation.Tests.csproj | 2 +- test/JsonRpc.Tests/JsonRpc.Tests.csproj | 2 +- test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj | 2 +- test/Lsp.Tests/Lsp.Tests.csproj | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sample/SampleServer/SampleServer.csproj b/sample/SampleServer/SampleServer.csproj index c53281cd5..c7a131ab7 100644 --- a/sample/SampleServer/SampleServer.csproj +++ b/sample/SampleServer/SampleServer.csproj @@ -3,7 +3,7 @@ Exe false - netcoreapp3.1 + net6.0 win7-x64 latest diff --git a/test/Client.Tests/Client.Tests.csproj b/test/Client.Tests/Client.Tests.csproj index 07ae8a6c0..190ea9ba0 100644 --- a/test/Client.Tests/Client.Tests.csproj +++ b/test/Client.Tests/Client.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1;net6.0 + net6.0 OmniSharp.Extensions.LanguageClient.Tests OmniSharp.Extensions.LanguageServer.Client.Tests diff --git a/test/Dap.Tests/Dap.Tests.csproj b/test/Dap.Tests/Dap.Tests.csproj index e61abe1ff..68e5f8284 100644 --- a/test/Dap.Tests/Dap.Tests.csproj +++ b/test/Dap.Tests/Dap.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp3.1;net6.0 + net6.0 true AnyCPU @@ -16,6 +16,6 @@ - + diff --git a/test/Generation.Tests/Generation.Tests.csproj b/test/Generation.Tests/Generation.Tests.csproj index 8f8f18ef0..eef43b102 100644 --- a/test/Generation.Tests/Generation.Tests.csproj +++ b/test/Generation.Tests/Generation.Tests.csproj @@ -1,6 +1,6 @@ - netcoreapp3.1;net6.0 + net6.0 true AnyCPU diff --git a/test/JsonRpc.Tests/JsonRpc.Tests.csproj b/test/JsonRpc.Tests/JsonRpc.Tests.csproj index 163f47307..315c78b25 100644 --- a/test/JsonRpc.Tests/JsonRpc.Tests.csproj +++ b/test/JsonRpc.Tests/JsonRpc.Tests.csproj @@ -1,6 +1,6 @@ - netcoreapp3.1;net6.0 + net6.0 true AnyCPU diff --git a/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj b/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj index fcb489822..4d655de2e 100644 --- a/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj +++ b/test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj @@ -1,6 +1,6 @@  - net6.0;netcoreapp3.1;net6.0 + net6.0 true AnyCPU diff --git a/test/Lsp.Tests/Lsp.Tests.csproj b/test/Lsp.Tests/Lsp.Tests.csproj index fcb489822..4d655de2e 100644 --- a/test/Lsp.Tests/Lsp.Tests.csproj +++ b/test/Lsp.Tests/Lsp.Tests.csproj @@ -1,6 +1,6 @@  - net6.0;netcoreapp3.1;net6.0 + net6.0 true AnyCPU