From ddc64e8d8f8254a172e320b46794b5740c404780 Mon Sep 17 00:00:00 2001 From: Eirik Tsarpalis Date: Fri, 17 Nov 2023 23:32:17 +0000 Subject: [PATCH] Upgrade sdk to .NET 8 (#55) * Update project to .NET 8 * Update paket to v8 * Use correct base image name. --- .config/dotnet-tools.json | 2 +- .github/workflows/build.yml | 5 +- Dockerfile | 2 +- paket.dependencies | 6 +- paket.lock | 150 ++++++++---------- samples/Helpers/Helpers.csproj | 2 +- .../TypeShape.Samples.fsproj | 2 +- samples/TypeShape.Samples/test.fsx | 2 +- tests/TypeShape.Benchmarks/MemberAccessors.fs | 4 +- .../TypeShape.Benchmarks.fsproj | 5 +- .../TypeShape.CSharp.Tests.csproj | 2 +- tests/TypeShape.Tests/StagedClone.fs | 2 + tests/TypeShape.Tests/TypeShape.Tests.fsproj | 2 +- 13 files changed, 87 insertions(+), 99 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index a970cc5..cf35463 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "paket": { - "version": "7.1.5", + "version": "8.0.0", "commands": [ "paket" ] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f585c9..f791a2e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,8 +15,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 7.0.x - include-prerelease: true + dotnet-version: 8.0.x - name: Build run: .\build.cmd -t Bundle @@ -36,7 +35,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x include-prerelease: true - name: Build run: ./build.sh -t Bundle diff --git a/Dockerfile b/Dockerfile index 3d6d004..3720039 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0-bullseye-slim +FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim # allow pushing docs & tags using docker builds: # pass git credentials using $GITHUB_TOKEN environment variable diff --git a/paket.dependencies b/paket.dependencies index 5a7768d..9909579 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -8,9 +8,9 @@ nuget Microsoft.SourceLink.GitHub ~> 1.0.0 copy_local:true group Test source https://api.nuget.org/v3/index.json - framework: net7.0 + framework: net8.0 - nuget FSharp.Core >= 6.0.0 + nuget FSharp.Core >= 7.0.0 nuget Microsoft.NET.Test.Sdk ~> 17.0 nuget xunit ~> 2.4.0 nuget xunit.runner.visualstudio ~> 2.4.0 version_in_path: true @@ -20,7 +20,7 @@ group Test nuget BenchmarkDotNet ~> 0.13.0 nuget BenchmarkDotNet.Diagnostics.Windows ~> 0.13.0 nuget Newtonsoft.Json ~> 13.0 - nuget System.Formats.Cbor ~> 6.0 + nuget System.Formats.Cbor ~> 7.0 nuget FSharp.Data ~> 3.0 nuget DotNext ~> 3.0 diff --git a/paket.lock b/paket.lock index e00bd5b..b9a2c59 100644 --- a/paket.lock +++ b/paket.lock @@ -3,8 +3,8 @@ RESTRICTION: || (== netcoreapp3.1) (== netstandard2.0) NUGET remote: https://api.nuget.org/v3/index.json FSharp.Core (4.5.4) - Microsoft.Build.Tasks.Git (1.1.1) - copy_local: true - Microsoft.SourceLink.Common (1.1.1) - copy_local: true + Microsoft.Build.Tasks.Git (8.0) - copy_local: true + Microsoft.SourceLink.Common (8.0) - copy_local: true Microsoft.SourceLink.GitHub (1.0) - copy_local: true Microsoft.Build.Tasks.Git (>= 1.0) Microsoft.SourceLink.Common (>= 1.0) @@ -13,25 +13,23 @@ NUGET System.Reflection.Emit.ILGeneration (>= 4.7) - restriction: || (&& (== netcoreapp3.1) (< netcoreapp2.0) (< netstandard2.1)) (&& (== netcoreapp3.1) (< netstandard2.0)) (&& (== netcoreapp3.1) (< portable-net45+wp8)) (&& (== netcoreapp3.1) (>= uap10.1)) (== netstandard2.0) GROUP Test -RESTRICTION: == net7.0 +RESTRICTION: == net8.0 NUGET remote: https://api.nuget.org/v3/index.json - BenchmarkDotNet (0.13.2) - BenchmarkDotNet.Annotations (>= 0.13.2) - CommandLineParser (>= 2.4.3) + BenchmarkDotNet (0.13.10) + BenchmarkDotNet.Annotations (>= 0.13.10) + CommandLineParser (>= 2.9.1) + Gee.External.Capstone (>= 2.3) Iced (>= 1.17) - Microsoft.CodeAnalysis.CSharp (>= 3.0) + Microsoft.CodeAnalysis.CSharp (>= 4.1) Microsoft.Diagnostics.Runtime (>= 2.2.332302) Microsoft.Diagnostics.Tracing.TraceEvent (>= 3.0.2) Microsoft.DotNet.PlatformAbstractions (>= 3.1.6) - Perfolizer (>= 0.2.1) - System.Management (>= 6.0) - System.Reflection.Emit (>= 4.7) - System.Reflection.Emit.Lightweight (>= 4.7) - System.Threading.Tasks.Extensions (>= 4.5.4) - BenchmarkDotNet.Annotations (0.13.2) - BenchmarkDotNet.Diagnostics.Windows (0.13.2) - BenchmarkDotNet (>= 0.13.2) + Perfolizer (0.2.1) + System.Management (>= 5.0) + BenchmarkDotNet.Annotations (0.13.10) + BenchmarkDotNet.Diagnostics.Windows (0.13.10) + BenchmarkDotNet (>= 0.13.10) Microsoft.Diagnostics.Tracing.TraceEvent (>= 3.0.2) CommandLineParser (2.9.1) DotNext (3.3.1) @@ -49,84 +47,75 @@ NUGET System.ValueTuple (>= 4.5) xunit.abstractions (>= 2.0.1) xunit.core (>= 2.2) - FSharp.Core (6.0.6) + FSharp.Core (8.0.100) FSharp.Data (3.3.3) FSharp.Core (>= 4.3.4) FSharp.Quotations.Evaluator (2.1) FSharp.Core (>= 4.3.1) - Iced (1.17) - Microsoft.Bcl.AsyncInterfaces (6.0) - Microsoft.CodeAnalysis.Analyzers (3.3.3) - Microsoft.CodeAnalysis.Common (4.3.1) - Microsoft.CodeAnalysis.Analyzers (>= 3.3.3) + Gee.External.Capstone (2.3) + Iced (1.20) + Microsoft.CodeAnalysis.Analyzers (3.3.4) + Microsoft.CodeAnalysis.Common (4.7) + Microsoft.CodeAnalysis.Analyzers (>= 3.3.4) + System.Collections.Immutable (>= 7.0) + System.Reflection.Metadata (>= 7.0) + System.Runtime.CompilerServices.Unsafe (>= 6.0) + Microsoft.CodeAnalysis.CSharp (4.7) + Microsoft.CodeAnalysis.Common (4.7) + Microsoft.CodeCoverage (17.8) + Microsoft.Diagnostics.NETCore.Client (0.2.452401) + Microsoft.Extensions.Logging (>= 6.0) + Microsoft.Diagnostics.Runtime (3.1.456101) + Microsoft.Diagnostics.NETCore.Client (>= 0.2.410101) System.Collections.Immutable (>= 6.0) - System.Memory (>= 4.5.4) - System.Reflection.Metadata (>= 5.0) System.Runtime.CompilerServices.Unsafe (>= 6.0) - System.Text.Encoding.CodePages (>= 6.0) - System.Threading.Tasks.Extensions (>= 4.5.4) - Microsoft.CodeAnalysis.CSharp (4.3.1) - Microsoft.CodeAnalysis.Common (4.3.1) - Microsoft.CodeCoverage (17.3.2) - Microsoft.Diagnostics.NETCore.Client (0.2.328102) - Microsoft.Bcl.AsyncInterfaces (>= 1.1) - Microsoft.Extensions.Logging (>= 2.1.1) - Microsoft.Diagnostics.Runtime (2.2.332302) - Microsoft.Diagnostics.NETCore.Client (>= 0.2.251802) - System.Collections.Immutable (>= 5.0) - System.Runtime.CompilerServices.Unsafe (>= 5.0) - Microsoft.Diagnostics.Tracing.TraceEvent (3.0.5) + Microsoft.Diagnostics.Tracing.TraceEvent (3.1.6) + Microsoft.Win32.Registry (>= 4.4) System.Runtime.CompilerServices.Unsafe (>= 5.0) Microsoft.DotNet.PlatformAbstractions (3.1.6) - Microsoft.Extensions.DependencyInjection (6.0) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0) - System.Runtime.CompilerServices.Unsafe (>= 6.0) - Microsoft.Extensions.DependencyInjection.Abstractions (6.0) - Microsoft.Extensions.Logging (6.0) - Microsoft.Extensions.DependencyInjection (>= 6.0) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0) - Microsoft.Extensions.Logging.Abstractions (>= 6.0) - Microsoft.Extensions.Options (>= 6.0) - System.Diagnostics.DiagnosticSource (>= 6.0) - Microsoft.Extensions.Logging.Abstractions (6.0.2) - Microsoft.Extensions.Options (6.0) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0) - Microsoft.Extensions.Primitives (>= 6.0) - Microsoft.Extensions.Primitives (6.0) - System.Runtime.CompilerServices.Unsafe (>= 6.0) - Microsoft.NET.Test.Sdk (17.3.2) - Microsoft.CodeCoverage (>= 17.3.2) - Microsoft.TestPlatform.TestHost (>= 17.3.2) - Microsoft.NETCore.Platforms (6.0.5) - Microsoft.TestPlatform.ObjectModel (17.3.2) - NuGet.Frameworks (>= 5.11) + Microsoft.Extensions.DependencyInjection (8.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0) + Microsoft.Extensions.DependencyInjection.Abstractions (8.0) + Microsoft.Extensions.Logging (8.0) + Microsoft.Extensions.DependencyInjection (>= 8.0) + Microsoft.Extensions.Logging.Abstractions (>= 8.0) + Microsoft.Extensions.Options (>= 8.0) + Microsoft.Extensions.Logging.Abstractions (8.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0) + Microsoft.Extensions.Options (8.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0) + Microsoft.Extensions.Primitives (>= 8.0) + Microsoft.Extensions.Primitives (8.0) + Microsoft.NET.Test.Sdk (17.8) + Microsoft.CodeCoverage (>= 17.8) + Microsoft.TestPlatform.TestHost (>= 17.8) + Microsoft.NETCore.Platforms (7.0.4) + Microsoft.TestPlatform.ObjectModel (17.8) + NuGet.Frameworks (>= 6.5) System.Reflection.Metadata (>= 1.6) - Microsoft.TestPlatform.TestHost (17.3.2) - Microsoft.TestPlatform.ObjectModel (>= 17.3.2) - Newtonsoft.Json (>= 9.0.1) + Microsoft.TestPlatform.TestHost (17.8) + Microsoft.TestPlatform.ObjectModel (>= 17.8) + Newtonsoft.Json (>= 13.0.1) + Microsoft.Win32.Registry (5.0) + System.Security.AccessControl (>= 5.0) + System.Security.Principal.Windows (>= 5.0) NETStandard.Library (2.0.3) Microsoft.NETCore.Platforms (>= 1.1) - Newtonsoft.Json (13.0.1) - NuGet.Frameworks (6.3) + Newtonsoft.Json (13.0.3) + NuGet.Frameworks (6.8) Perfolizer (0.2.1) System.Memory (>= 4.5.3) - System.CodeDom (6.0) - System.Collections.Immutable (6.0) - System.Runtime.CompilerServices.Unsafe (>= 6.0) - System.Diagnostics.DiagnosticSource (6.0) - System.Runtime.CompilerServices.Unsafe (>= 6.0) - System.Formats.Cbor (6.0) - System.Management (6.0) - System.CodeDom (>= 6.0) + System.CodeDom (8.0) + System.Collections.Immutable (8.0) + System.Formats.Cbor (7.0) + System.Management (8.0) + System.CodeDom (>= 8.0) System.Memory (4.5.5) - System.Reflection.Emit (4.7) - System.Reflection.Emit.Lightweight (4.7) - System.Reflection.Metadata (6.0.1) - System.Collections.Immutable (>= 6.0) + System.Reflection.Metadata (8.0) + System.Collections.Immutable (>= 8.0) System.Runtime.CompilerServices.Unsafe (6.0) - System.Text.Encoding.CodePages (6.0) - System.Runtime.CompilerServices.Unsafe (>= 6.0) - System.Threading.Tasks.Extensions (4.5.4) + System.Security.AccessControl (6.0) + System.Security.Principal.Windows (5.0) System.ValueTuple (4.5) Unquote (6.1) FSharp.Core (>= 4.7.2) @@ -135,9 +124,8 @@ NUGET xunit.assert (>= 2.4.2) xunit.core (2.4.2) xunit.abstractions (2.0.3) - xunit.analyzers (1.0) - xunit.assert (2.4.2) - NETStandard.Library (>= 1.6.1) + xunit.analyzers (1.5) + xunit.assert (2.6.1) xunit.core (2.4.2) xunit.extensibility.core (2.4.2) xunit.extensibility.execution (2.4.2) diff --git a/samples/Helpers/Helpers.csproj b/samples/Helpers/Helpers.csproj index 9f73924..e8cd599 100644 --- a/samples/Helpers/Helpers.csproj +++ b/samples/Helpers/Helpers.csproj @@ -1,6 +1,6 @@ - net7.0 + net8.0 enable enable diff --git a/samples/TypeShape.Samples/TypeShape.Samples.fsproj b/samples/TypeShape.Samples/TypeShape.Samples.fsproj index a1fd8b9..ca98c20 100644 --- a/samples/TypeShape.Samples/TypeShape.Samples.fsproj +++ b/samples/TypeShape.Samples/TypeShape.Samples.fsproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 FS0020 diff --git a/samples/TypeShape.Samples/test.fsx b/samples/TypeShape.Samples/test.fsx index 87fe4b2..baeaa04 100644 --- a/samples/TypeShape.Samples/test.fsx +++ b/samples/TypeShape.Samples/test.fsx @@ -1,4 +1,4 @@ -#I "bin/Debug/net7.0" +#I "bin/Debug/net8.0" #r "TypeShape.dll" #r "Helpers.dll" #r "TypeShape.Samples.dll" diff --git a/tests/TypeShape.Benchmarks/MemberAccessors.fs b/tests/TypeShape.Benchmarks/MemberAccessors.fs index 0de4d71..4bff9a8 100644 --- a/tests/TypeShape.Benchmarks/MemberAccessors.fs +++ b/tests/TypeShape.Benchmarks/MemberAccessors.fs @@ -19,14 +19,14 @@ with match u with | A _ -> 0 | B _ -> 1 - | C _ -> 2 + | C -> 2 [] member u.GetTag_NoInlining() = match u with | A _ -> 0 | B _ -> 1 - | C _ -> 2 + | C -> 2 type TupleType = int * int * int * int * int * int * int * int * int * int type StructTupleType = (struct(int * int * int * int * int * int * int * int * int * int)) diff --git a/tests/TypeShape.Benchmarks/TypeShape.Benchmarks.fsproj b/tests/TypeShape.Benchmarks/TypeShape.Benchmarks.fsproj index aa87661..d6c89e7 100644 --- a/tests/TypeShape.Benchmarks/TypeShape.Benchmarks.fsproj +++ b/tests/TypeShape.Benchmarks/TypeShape.Benchmarks.fsproj @@ -2,10 +2,9 @@ Exe - net7.0 + net8.0 Debug;Release;Debug-NoEmit;Release-NoEmit - true - true + true diff --git a/tests/TypeShape.CSharp.Tests/TypeShape.CSharp.Tests.csproj b/tests/TypeShape.CSharp.Tests/TypeShape.CSharp.Tests.csproj index e0c7462..bcaa063 100644 --- a/tests/TypeShape.CSharp.Tests/TypeShape.CSharp.Tests.csproj +++ b/tests/TypeShape.CSharp.Tests/TypeShape.CSharp.Tests.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 true diff --git a/tests/TypeShape.Tests/StagedClone.fs b/tests/TypeShape.Tests/StagedClone.fs index e6e81c3..53c0669 100644 --- a/tests/TypeShape.Tests/StagedClone.fs +++ b/tests/TypeShape.Tests/StagedClone.fs @@ -1,6 +1,8 @@ [] module TypeShape.Tests.StagedClone +#nowarn "44" // SerializationInfo is obsolete + open System open System.Runtime.Serialization open FSharp.Quotations diff --git a/tests/TypeShape.Tests/TypeShape.Tests.fsproj b/tests/TypeShape.Tests/TypeShape.Tests.fsproj index 7b0882e..253cf42 100644 --- a/tests/TypeShape.Tests/TypeShape.Tests.fsproj +++ b/tests/TypeShape.Tests/TypeShape.Tests.fsproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false Debug;Release;Debug-NoEmit;Release-NoEmit