diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b539c60c115..af53701955a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -578,7 +578,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - dotnet-version: [8, 9, 10, 11] + dotnet-version: [10, 11] fail-fast: false steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/.github/workflows/dotnet-tool.yml b/.github/workflows/dotnet-tool.yml index 51abe119f9d..aef89896bff 100644 --- a/.github/workflows/dotnet-tool.yml +++ b/.github/workflows/dotnet-tool.yml @@ -332,7 +332,7 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 with: - dotnet-version: "8.0" + dotnet-version: "10.0" # Trusted publishing, as for PyPI in pypi.yml and crates.io in # release_rust.yml: nuget.org hands back a short lived key in exchange diff --git a/LANGUAGES.md b/LANGUAGES.md index c4e9b5d24f8..685baaa41ec 100644 --- a/LANGUAGES.md +++ b/LANGUAGES.md @@ -165,7 +165,7 @@ language; it is the effective minimum the project stands behind for that release .NET 0.13.0 Yes -.NET Standard 2.x, net8, net9, net10, net11 +.NET Standard 2.x, net10, net11 Yes YesYesYesYes YesYes diff --git a/build/veralign.sh b/build/veralign.sh index d7a3c051d8d..225f18f30d7 100755 --- a/build/veralign.sh +++ b/build/veralign.sh @@ -71,8 +71,6 @@ FILES[lib/lua/Thrift.lua]=simpleReplace FILES[lib/netstd/Benchmarks/Thrift.Benchmarks/Thrift.Benchmarks.csproj]=simpleReplace FILES[lib/netstd/Tests/Thrift.Compile.Tests/Thrift.Compile.net10/Thrift.Compile.net10.csproj]=simpleReplace FILES[lib/netstd/Tests/Thrift.Compile.Tests/Thrift.Compile.net11/Thrift.Compile.net11.csproj]=simpleReplace -FILES[lib/netstd/Tests/Thrift.Compile.Tests/Thrift.Compile.net8/Thrift.Compile.net8.csproj]=simpleReplace -FILES[lib/netstd/Tests/Thrift.Compile.Tests/Thrift.Compile.net9/Thrift.Compile.net9.csproj]=simpleReplace FILES[lib/netstd/Tests/Thrift.Compile.Tests/Thrift.Compile.netstd2/Thrift.Compile.netstd2.csproj]=simpleReplace FILES[lib/netstd/Tests/Thrift.IntegrationTests/Thrift.IntegrationTests.csproj]=simpleReplace FILES[lib/netstd/Tests/Thrift.Tests/Thrift.Tests.csproj]=simpleReplace diff --git a/build/windows/README.md b/build/windows/README.md index 26bb12bf907..0a0f83ec614 100644 --- a/build/windows/README.md +++ b/build/windows/README.md @@ -185,13 +185,12 @@ to it - arguments, the standard streams and the exit code all pass straight through. .NET 10 can declare a native executable as the entry point directly, with no -managed code, but a package built that way cannot be installed by the .NET 8 or -.NET 9 SDK at all, and the MSBuild properties involved are undocumented. The +managed code, but the MSBuild properties involved are undocumented. The launcher costs one small assembly and works everywhere. -The launcher targets .NET 8 and rolls forward to a newer major version when -.NET 8 is not installed. Otherwise a machine with only .NET 9 or later would -install the tool and then refuse to start it, asking for .NET 8. +The launcher targets .NET 10 and rolls forward to a newer major version when +.NET 10 is not installed. Otherwise a machine with only .NET 11 or later would +install the tool and then refuse to start it, asking for .NET 10. The package carries the Windows compiler only. NuGet installs a tool package on any platform, so the launcher checks and reports that rather than failing to @@ -212,7 +211,7 @@ the layout can be such that the tool installs but does not run. So the test checks the package contents - including that `LICENSE` and `NOTICE` really are in there and are not empty - and then proves the installed command works. It also checks that the launcher may roll forward to a newer .NET, because -running the tool on a machine that has .NET 8 as well cannot show that. +running the tool on a machine that has .NET 10 as well cannot show that. It runs anywhere PowerShell and the .NET SDK do. Off Windows it checks the launcher's refusal instead of the compiler's output, which is the behaviour that diff --git a/build/windows/dotnet-tool/Apache.Thrift.Compiler.csproj b/build/windows/dotnet-tool/Apache.Thrift.Compiler.csproj index 09c2d00628d..f71b774580e 100644 --- a/build/windows/dotnet-tool/Apache.Thrift.Compiler.csproj +++ b/build/windows/dotnet-tool/Apache.Thrift.Compiler.csproj @@ -33,10 +33,10 @@ Exe - net8.0 - + net10.0 + Major enable disable diff --git a/build/windows/dotnet-tool/test-dotnet-tool.ps1 b/build/windows/dotnet-tool/test-dotnet-tool.ps1 index 2c27fcb5994..cae709f9260 100644 --- a/build/windows/dotnet-tool/test-dotnet-tool.ps1 +++ b/build/windows/dotnet-tool/test-dotnet-tool.ps1 @@ -66,7 +66,7 @@ param( $ErrorActionPreference = 'Stop' $PackageId = 'Apache.Thrift.Compiler' -$Tfm = 'net8.0' +$Tfm = 'net10.0' $failures = [System.Collections.Generic.List[string]]::new() $passed = 0 @@ -156,9 +156,9 @@ try { ($settings -match "EntryPoint\s*=\s*`"$([regex]::Escape($PackageId)).dll`"") $settings # The launcher targets the oldest .NET the tool has to install on. Unless it - # may roll forward to a newer major version, a machine with only .NET 9 or - # later installs the tool and then refuses to start it, asking for .NET 8. - # Runners that also have .NET 8 never show that, so check the setting. + # may roll forward to a newer major version, a machine with only .NET 11 or + # later installs the tool and then refuses to start it, asking for .NET 10. + # Runners that also have .NET 10 never show that, so check the setting. $runtimeConfig = Read-Entry "$toolDir/$PackageId.runtimeconfig.json" $rollForward = '' if ($runtimeConfig) { diff --git a/compiler/cpp/src/thrift/generate/t_netstd_generator.cc b/compiler/cpp/src/thrift/generate/t_netstd_generator.cc index c9e1c7c633d..9c7c4f9b90c 100644 --- a/compiler/cpp/src/thrift/generate/t_netstd_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_netstd_generator.cc @@ -89,12 +89,6 @@ t_netstd_generator::t_netstd_generator(t_program* program, const mapfirst.compare("net10") == 0) { target_net_version = 10; } - else if (iter->first.compare("net9") == 0) { - target_net_version = 9; - } - else if (iter->first.compare("net8") == 0) { - target_net_version = 8; - } else if (iter->first.compare("async_postfix") == 0) { add_async_postfix = true; } @@ -221,12 +215,6 @@ void t_netstd_generator::pragmas_and_directives(ostream& out) } else if( target_net_version >= 10) { out << "// targeting net 10" << '\n'; out << "#if( NET11_0_OR_GREATER || !NET10_0_OR_GREATER)" << '\n'; - } else if( target_net_version >= 9) { - out << "// targeting net 9" << '\n'; - out << "#if( NET10_0_OR_GREATER || !NET9_0_OR_GREATER)" << '\n'; - } else if( target_net_version >= 8) { - out << "// targeting net 8" << '\n'; - out << "#if( NET9_0_OR_GREATER || !NET8_0_OR_GREATER)" << '\n'; } else { out << "// targeting netstandard 2.x" << '\n'; out << "#if(! NETSTANDARD2_0_OR_GREATER)" << '\n'; @@ -4346,8 +4334,6 @@ THRIFT_REGISTER_GENERATOR( " serial: Add serialization support to generated classes.\n" " union: Use new union typing, which includes a static read function for union types.\n" " pascal: Generate Pascal Case property names according to Microsoft naming convention.\n" - " net8: Enable features that require net8 and C# 12 or higher.\n" - " net9: Enable features that require net9 and C# 13 or higher.\n" " net10: Enable features that require net10 and C# 14 or higher.\n" " net11: Enable features that require net11 and C# 15 or higher.\n" " no_deepcopy: Suppress generation of " + DEEP_COPY_METHOD_NAME + "() method.\n" diff --git a/compiler/cpp/tests/netstd/t_netstd_generator_options_tests.cc b/compiler/cpp/tests/netstd/t_netstd_generator_options_tests.cc new file mode 100644 index 00000000000..3063ad1ce39 --- /dev/null +++ b/compiler/cpp/tests/netstd/t_netstd_generator_options_tests.cc @@ -0,0 +1,55 @@ +// Licensed to the Apache Software Foundation(ASF) under one +// or more contributor license agreements.See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership.The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "../catch/catch.hpp" +#include +#include +#include + +#include +#include + +using std::string; + +// The options are passed the way "--gen netstd: