Skip to content

THRIFT-6382: Add net11 support - #3963

Merged
Jens-G merged 1 commit into
apache:masterfrom
Jens-G:THRIFT-6382
Nov 11, 2026
Merged

Jens-G merged 1 commit into
apache:masterfrom
Jens-G:THRIFT-6382

Conversation

@Jens-G

@Jens-G Jens-G commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Adds net11 support to netstd, along the lines of THRIFT-5902 for net10. .NET 11 has been generally available since November 10, 2026 (SDK 11.0.100, runtime 11.0.0).

  • The netstd generator gets a net11 option (C# 15). Code generated for net10 now stops with #error when built for net11, as the code for each older version does for the next one.
  • ApacheThrift and ApacheThrift.AspNetCore add net11.0 to their target frameworks.
  • A new test project, Thrift.Compile.net11, is a copy of Thrift.Compile.net10 with the version names changed. The other per-version projects stay. Thrift.Tests now references net11, so make check builds net10 explicitly.
  • These move from net10 to net11:
    • the unit, integration and fuzz tests;
    • the benchmarks;
    • the test suite (test/netstd);
    • the tutorial (tutorial/netstd).
  • The benchmarks move to BenchmarkDotNet 0.16.0-preview.2. BenchmarkDotNet 0.15.8, the latest release, still cannot run them on net11 out of process: it stops with "GetRuntimeVersion not implemented for NotRecognized". THRIFT-6382 lists the move to 0.16.0 as a follow-up.
  • CI: an older SDK cannot build the net11.0 target; 10.0.401 fails with NETSDK1045. The runners also build every codegen leg with their newest preinstalled SDK. So:
    • lib-netstd sets up 11.0.x;
    • each codegen leg installs 11.0.x next to its own SDK, and the matrix gains 11;
    • the MSVC image moves to sdk:11.0-windowsservercore-ltsc2025;
    • cross-test, which runs the netstd test client and server since THRIFT-5140, needs the .NET 11 runtime for the net11.0 build in netstd-precross, so it sets up 11.0.x as well.
  • The build/docker/ubuntu-jammy and ubuntu-noble images install the .NET 11 packages from ppa:dotnet/backports, which has carried them for both since GA. build/docker/README.md follows.

The earlier version of this PR turned the SDK's telemetry off in cross-test. With RC3, telemetry made every dotnet run 2 s or more slower, and the netstd clients ran into their 10 s. That setting is gone again: with 11.0.100, telemetry costs about 0.1 s per run, and the cross test passes with it on, see below.

Dropping net8 and net9 (end of support November 10, 2026) is THRIFT-6383, in #4168. Both PRs change the same lines: the target framework lists, the generator's version chain, the codegen matrix and the project lists. So whichever of them is merged second needs a rebase. I have prepared that rebase for both orders. Both give the same tree, and that tree is tested, see the end of the tests below.

Test, done locally with SDK 11.0.100 on this branch, rebased onto master (5d78ec1):

  • Clean Release and Debug builds of lib/netstd, test/netstd and tutorial/netstd have no errors and no warnings.
  • Thrift.Tests passes 221/221 and Thrift.IntegrationTests 57/57 on net11.0.
  • run-NetStd-Codegen-Tests.ps1 for net11, net10, net9 and net8 passes 251/251 each, with every warning an error (TreatWarningsAsErrors=true).
  • The steps of the lib-netstd job pass in the build image, with the SDK's telemetry on as in CI: configure ("Using dotnet version 11.0.100"), make, make check for lib/netstd, test/netstd and tutorial/netstd, and make precross.
  • The netstd-netstd cross test, run the way cross-test runs it (the --help warm-up, --retry-count 5 --skip-known-failures, 4 tests at a time): all 5 pass with telemetry on, json in 7.4 s and the others in 2.9 to 3.2 s. With DOTNET_CLI_TELEMETRY_OPTOUT=1 they take 7.1 s and 2.7 to 3.0 s.
  • Docker images: for each of ubuntu-jammy and ubuntu-noble, an image of its base and its .NET step, copied from the Dockerfile, installs SDK 11.0.100 and runtime 11.0.0 from the PPA and no older runtime. In it, Thrift.Tests passes 221/221 and Thrift.IntegrationTests 57/57, the Thrift.Compile projects build, and so do lib/netstd, test/netstd and tutorial/netstd, without warnings.
  • BenchmarkDotNet on net11.0: 0.15.8 out of process stops as described above, and runs with --inProcess. 0.16.0-preview.2 builds without warnings and runs out of process (--job Dry).
  • MCR serves the same image for sdk:11.0-windowsservercore-ltsc2025 and sdk:11.0.100-windowsservercore-ltsc2025, so the MSVC job builds with 11.0.100.
  • The state after both this PR and THRIFT-6383: Drop net8 and net9 support #4168, in either order (same tree), with SDK 11.0.100:
    • the compiler unit tests pass, 42 test cases;
    • --gen netstd:net8 and netstd:net9 stop with "unknown option", and net10 and net11 generate code;
    • clean Release and Debug builds of lib/netstd, test/netstd and tutorial/netstd have no errors and no warnings;
    • Thrift.Tests passes 221/221 and Thrift.IntegrationTests 57/57 on net11.0;
    • the net10 and net11 codegen legs pass 251/251 each, with every warning an error;
    • the steps of the lib-netstd job and the netstd-netstd cross test (5 of 5) pass in the build image.

The RC1, RC2 and RC3 rounds are in the edit history of this description.

JIRA: THRIFT-6382

  • Apache Jira ticket: THRIFT-6382
  • PR title follows "THRIFT-NNNN: describe my issue"
  • Single commit
  • No breaking change to the library API. For generated code, see the net10 note above.
  • Code change, so the commit carries no CI-skip marker.

🤖 Generated with Claude Code

@Jens-G Jens-G self-assigned this Sep 27, 2026
@mergeable mergeable Bot added c# Pull requests that update C# code Pull requests that update .NET code compiler build and general CI cmake, automake and build system changes github_actions Pull requests that update GitHub Actions code labels Sep 27, 2026
Client: netstd

ApacheThrift and ApacheThrift.AspNetCore also target net11.0 now, and
the netstd generator gets a net11 option. Code generated for net10 now
refuses to build for net11, as the code for each older version does
for the next one.

The unit, integration and fuzz tests, the benchmarks, the test suite
and the tutorial move from net10 to net11. The new Thrift.Compile.net11
project joins the per-version ones, and Thrift.Compile.net10 stays, so
make check now builds it explicitly. The benchmarks need
BenchmarkDotNet 0.16.0-preview.2: 0.15.8, the latest release, cannot
run them on net11 out of process.

Older SDKs cannot build the net11.0 target. The lib-netstd job and the
MSVC image therefore use the .NET 11 SDK, and each codegen leg installs
it next to its own SDK. The codegen matrix gains net11. The cross-test
job starts the netstd test client and server, now net11.0, with
`dotnet run`, so it moves to the .NET 11 SDK as well. The ubuntu-jammy
and ubuntu-noble build images install .NET 11 from ppa:dotnet/backports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jens-G Jens-G mentioned this pull request Nov 11, 2026
5 tasks done
@Jens-G
Jens-G marked this pull request as ready for review November 11, 2026 09:04
@Jens-G
Jens-G merged commit 0d38ae1 into apache:master Nov 11, 2026
95 checks passed
@Jens-G
Jens-G deleted the THRIFT-6382 branch November 11, 2026 09:16
Jens-G added a commit to birschick-bq/thrift that referenced this pull request Nov 11, 2026
Client: netstd

Brings the branch onto master 000cdb7, which now has apache#3963
(THRIFT-6382, net11) and apache#4168 (THRIFT-6383, net8 and net9 dropped).

Conflicts, resolved this way:
- Thrift.Compile.net8 and Thrift.Compile.net9 are gone on master, and
  their isolated lines go with them. Thrift.Compile.net11 gets the same
  three lines for IsolatedCall.thrift, IsolatedExceptionName.thrift and
  IsolatedNames.thrift that Thrift.Compile.net10 has, with net11.
  Thrift.Tests builds against Thrift.Compile.net11 now, and its new
  tests use the types generated from these files.
- tutorial/netstd/Interfaces/Interfaces.csproj keeps master's net11 and
  adds the isolated option.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build and general CI cmake, automake and build system changes c# Pull requests that update C# code Pull requests that update .NET code compiler github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant