feat(#119): Add support for all currently supported .NET frameworks (net9.0, net10.0)#150
Merged
LeeCampbell merged 9 commits intoHdrHistogram:mainfrom Mar 4, 2026
Conversation
6 tasks
Collaborator
Author
|
The agent's PAT lacks the diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 79a2410..25eda9e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -14,7 +14,10 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
- dotnet-version: '8.0.x'
+ dotnet-version: |
+ 8.0.x
+ 9.0.x
+ 10.0.x
cache: true
cache-dependency-path: '**/*.csproj'
|
LeeCampbell
previously approved these changes
Mar 3, 2026
LeeCampbell
added a commit
to LeeCampbell/HdrHistogram.NET-1
that referenced
this pull request
Mar 4, 2026
Update setup-dotnet to install all three supported SDK versions (8.0.x, 9.0.x, 10.0.x) using a multi-line dotnet-version scalar, matching the new multi-target framework support added in HdrHistogram#150. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 task
Resolve merge conflicts with upstream changes to bring the branch up to date. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
LeeCampbell
added a commit
to LeeCampbell/HdrHistogram.NET-1
that referenced
this pull request
Mar 4, 2026
Update setup-dotnet to install all three supported SDK versions (8.0.x, 9.0.x, 10.0.x) using a multi-line dotnet-version scalar, matching the new multi-target framework support added in HdrHistogram#150. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
LeeCampbell
previously approved these changes
Mar 4, 2026
The TaggedLogLineMatcher regex used `.+` (greedy match) in the optional tag group, which relied on backtracking to correctly parse tags. .NET 10 changed regex engine backtracking behaviour, causing the optional group to be skipped entirely instead of backtracking to find the tag value. Replace `Tag=.+` with `Tag=[^,]+` to match only non-comma characters, avoiding the need for backtracking across comma boundaries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
LeeCampbell
added a commit
to LeeCampbell/HdrHistogram.NET-1
that referenced
this pull request
Mar 4, 2026
Update setup-dotnet to install all three supported SDK versions (8.0.x, 9.0.x, 10.0.x) using a multi-line dotnet-version scalar, matching the new multi-target framework support added in HdrHistogram#150. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
LeeCampbell
approved these changes
Mar 4, 2026
LeeCampbell
added a commit
to LeeCampbell/HdrHistogram.NET-1
that referenced
this pull request
Mar 4, 2026
Update setup-dotnet to install all three supported SDK versions (8.0.x, 9.0.x, 10.0.x) using a multi-line dotnet-version scalar, matching the new multi-target framework support added in HdrHistogram#150. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief: Issue #119 — Add support for all currently supported .NET frameworks (net9.0, net10.0)
Summary
The library currently targets
net8.0;netstandard2.0.As of March 2026, .NET 9 (STS) and .NET 10 (LTS) are both in active support alongside .NET 8 (LTS).
This issue adds
net9.0andnet10.0as target frameworks across the library, test, examples, benchmarking, and CI projects.No code logic changes are expected — the existing
#if NET5_0_OR_GREATERguard inBitwise.csalready covers all three modern targets.The spec file
spec/tech-standards/build-system.mdmust also be updated to reflect the new targets.Affected Files (confirmed by exploration)
HdrHistogram/HdrHistogram.csprojnet8.0;netstandard2.0net10.0;net9.0;net8.0;netstandard2.0HdrHistogram.UnitTests/HdrHistogram.UnitTests.csprojnet8.0net10.0;net9.0;net8.0HdrHistogram.Examples/HdrHistogram.Examples.csprojnet8.0net10.0HdrHistogram.Benchmarking/HdrHistogram.Benchmarking.csprojnet8.0net10.0;net9.0;net8.0.github/workflows/ci.ymldotnet-version: 8.0.x8.0.x,9.0.x,10.0.x(multi-line — see CI section below).devcontainer/Dockerfilesdk:9.0-bookworm-slim+ 8.0 runtimesdk:10.0-bookworm-slim+ explicit 8.0 and 9.0 runtimesspec/tech-standards/build-system.mdnet8.0;netstandard2.0Conditional Compilation
Only one
#ifguard exists in the main library:HdrHistogram/Utilities/Bitwise.cs:#if NET5_0_OR_GREATER— usesSystem.Numerics.BitOperations.LeadingZeroCount().This guard already applies correctly to net8.0, net9.0, and net10.0.
No new
#ifdirectives are required.No
#if NET9_0_OR_GREATERor#if NET10_0_OR_GREATERoptimisations have been identified as necessary for this changeset.CI YAML Change
The
actions/setup-dotnet@v4action supports a multi-line scalar fordotnet-version.Use the following exact syntax in
.github/workflows/ci.yml:Do not use separate
setup-dotnetsteps for each version — this would breakcache: truebehaviour.Devcontainer Change
The current
.devcontainer/Dockerfileis based onmcr.microsoft.com/dotnet/sdk:9.0-bookworm-slimand installs only the .NET 8.0 runtime.The Examples project is a developer-facing runnable tool; after changing its target to
net10.0, it must remain buildable inside the devcontainer.Resolution (Option A): Change the base image to
mcr.microsoft.com/dotnet/sdk:10.0-bookworm-slimand add explicit installation of the 8.0 and 9.0 runtimes using thedotnet-install.shscript, so all three runtime versions remain available locally.Spec Update: Sections to Change in
spec/tech-standards/build-system.mdThe following five locations must be updated; all other sections (including the AppVeyor section, lines 137–177, which is already acknowledged as outdated) are out of scope:
net8.0;netstandard2.0→net10.0;net9.0;net8.0;netstandard2.0net8.0→net10.0;net9.0;net8.0net8.0→net10.0;net9.0;net8.0The Examples project section is absent from the spec, so no spec change is needed for that project.
Acceptance Criteria
HdrHistogram.csprojtargetsnet10.0;net9.0;net8.0;netstandard2.0HdrHistogram.UnitTests.csprojtargetsnet10.0;net9.0;net8.0HdrHistogram.Examples.csprojtargetsnet10.0HdrHistogram.Benchmarking.csprojtargetsnet10.0;net9.0;net8.0setup-dotnetstep with a multi-linedotnet-versionscalar.devcontainer/Dockerfileusessdk:10.0-bookworm-slimbase image with 8.0 and 9.0 runtimes installeddotnet build -c Releasesucceeds for all target frameworksdotnet testpasses on all three modern runtimes (net8.0, net9.0, net10.0)dotnet packproduces a NuGet package containing assemblies for all four targetsspec/tech-standards/build-system.mdupdated at the five specific locations listed aboveTest Strategy
No new tests need to be written.
The existing test suite in
HdrHistogram.UnitTests/provides full coverage.Multi-targeting the test project is sufficient:
dotnet testautomatically runs all tests against each<TargetFrameworks>entry.The CI pipeline, once updated to install all three SDKs, will exercise net8.0, net9.0, and net10.0 in a single
dotnet testinvocation.Verification locally:
dotnet build HdrHistogram/HdrHistogram.csproj -c Release dotnet test HdrHistogram.UnitTests/HdrHistogram.UnitTests.csproj -c Release dotnet pack HdrHistogram/HdrHistogram.csproj -c Release --no-buildAfter
dotnet pack, confirm the.nupkgcontainslib/net8.0/,lib/net9.0/,lib/net10.0/, andlib/netstandard2.0/folders.Risks and Open Questions
BenchmarkDotNet compatibility:
BenchmarkDotNetversion0.13.12(currently referenced) must support net10.0.Verify during implementation by attempting a Release build of the benchmarking project.
If
BenchmarkDotNet 0.13.12fails to build againstnet10.0, upgrade bothBenchmarkDotNetandBenchmarkDotNet.Diagnostics.Windowsto the latest stable version as part of this PR and update the version recorded inspec/tech-standards/build-system.mdaccordingly.Examples project: The issue specifies updating to
net10.0only (single target, not multi-target).This is intentional — examples are a developer-facing runnable tool, not a shipped library.
The devcontainer change (see above) ensures local buildability is preserved.
Spec update:
spec/tech-standards/build-system.mdstill documents AppVeyor CI.That section was already outdated before this issue.
Only the five target framework and prerequisite locations listed above need updating here; AppVeyor cleanup is out of scope.
Task breakdown
Task List: Issue #119 — Add support for net9.0 and net10.0
Cross-referenced against every acceptance criterion in
plan/ready/brief.md.1 — Main library: target frameworks
File:
HdrHistogram/HdrHistogram.csproj1.1 Change
<TargetFrameworks>on line 4 fromnet8.0;netstandard2.0tonet10.0;net9.0;net8.0;netstandard2.0.Verify: the element reads exactly
<TargetFrameworks>net10.0;net9.0;net8.0;netstandard2.0</TargetFrameworks>.1.2 Add two
<PropertyGroup>conditions for the ReleaseDocumentationFile,mirroring the existing block at lines 24–26.
Add one block for
net9.0(bin\Release\net9.0\HdrHistogram.xml) and one fornet10.0(bin\Release\net10.0\HdrHistogram.xml), immediately after theexisting
net8.0block.Verify: both new blocks are present and follow the same pattern as the
net8.0block.2 — Unit tests: target frameworks
File:
HdrHistogram.UnitTests/HdrHistogram.UnitTests.csproj<TargetFrameworks>on line 4 fromnet8.0tonet10.0;net9.0;net8.0.Verify: the element reads exactly
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>.3 — Examples project: target framework
File:
HdrHistogram.Examples/HdrHistogram.Examples.csproj<TargetFrameworks>on line 5 fromnet8.0tonet10.0.Verify: the element reads exactly
<TargetFrameworks>net10.0</TargetFrameworks>.4 — Benchmarking project: target frameworks and BenchmarkDotNet compatibility
File:
HdrHistogram.Benchmarking/HdrHistogram.Benchmarking.csproj4.1 Change
<TargetFrameworks>on line 5 fromnet8.0tonet10.0;net9.0;net8.0.Verify: the element reads exactly
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>.4.2 Attempt a Release build of the benchmarking project:
If the build succeeds, this task is done — BenchmarkDotNet 0.13.12 is compatible.
If the build fails due to BenchmarkDotNet incompatibility with net10.0, proceed to task 4.3.
4.3 (Conditional — only if task 4.2 fails) Upgrade both
BenchmarkDotNetandBenchmarkDotNet.Diagnostics.Windowsto the lateststable version.
Verify:
dotnet build HdrHistogram.Benchmarking/HdrHistogram.Benchmarking.csproj -c Releasesucceeds after the upgrade.
Note: if this task is executed, also complete task 10.6 in the spec section below.
5 — CI pipeline: multi-version SDK install
File:
.github/workflows/ci.ymlsetup-dotnetstep (lines 15–19) with a single step usinga multi-line
dotnet-versionscalar:setup-dotnetsteps — that would breakcache: true.Verify: the file contains exactly one
setup-dotnetstep, anddotnet-versionis a multi-line block scalar listing all three versions.
6 — Devcontainer: upgrade base image and install additional runtimes
File:
.devcontainer/Dockerfile6.1 Change the
FROMline (line 5) frommcr.microsoft.com/dotnet/sdk:9.0-bookworm-slimtomcr.microsoft.com/dotnet/sdk:10.0-bookworm-slim.Verify: the first
FROMline referencessdk:10.0-bookworm-slim.6.2 Replace the single 8.0 runtime install (lines 6–8) with explicit
installs of both the 8.0 and 9.0 runtimes via
dotnet-install.sh, keeping bothin the same
RUNlayer to avoid creating extra image layers:RUN dotnet_version=8.0 \ && curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin \ --runtime dotnet --channel $dotnet_version --install-dir /usr/share/dotnet \ && dotnet_version=9.0 \ && curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin \ --runtime dotnet --channel $dotnet_version --install-dir /usr/share/dotnetVerify: the file installs both 8.0 and 9.0 runtimes, and the base image is 10.0.
7 — Spec: main library TargetFrameworks
File:
spec/tech-standards/build-system.md, approx. lines 24–26code block from:
8 — Spec: test project TargetFramework
File:
spec/tech-standards/build-system.md, approx. lines 35–37TargetFrameworkto the pluralTargetFrameworksto match a multi-target declaration.Verify: the code block in that section shows all three targets.
9 — Spec: benchmarking project TargetFrameworks
File:
spec/tech-standards/build-system.md, approx. lines 42–45"Targets the current LTS runtime only (developer tool, not a shipped library):" to
reflect multi-targeting, and update the XML code block from:
10 — Spec: benchmark configuration runtime list
File:
spec/tech-standards/build-system.md, approx. lines 226–22810.1 In the "Benchmark Configuration" section, replace the single target entry:
with a list of all three supported runtimes:
Verify: the bullet list covers all three TFMs.
10.2 (Conditional — only if task 4.3 was executed) Update the BenchmarkDotNet
version numbers in the "Benchmarking Project" dependencies code block
(approx. lines 66–67) to match the upgraded version.
Verify: the version string in the spec matches the version in
HdrHistogram.Benchmarking/HdrHistogram.Benchmarking.csproj.11 — Spec: prerequisites
File:
spec/tech-standards/build-system.md, approx. line 25412 — Verification: build, test, and pack
These tasks confirm all acceptance criteria related to running the toolchain.
They must be performed after all implementation tasks above are complete.
12.1 Run a Release build of the main library and confirm it succeeds for
all four target frameworks:
Verify: build output shows
net10.0,net9.0,net8.0, andnetstandard2.0all built without errors.
12.2 Run the full test suite and confirm all tests pass on all three
modern runtimes:
dotnet test HdrHistogram.UnitTests/HdrHistogram.UnitTests.csproj -c ReleaseVerify: test results show three separate
net10.0,net9.0, andnet8.0runs,all green with zero failures.
12.3 Pack the library and confirm all four TFM folders are present in
the produced
.nupkg:Then inspect the package:
Verify: the archive contains
lib/net8.0/,lib/net9.0/,lib/net10.0/,and
lib/netstandard2.0/folders.13 — Code review fixes
Issues found during post-implementation review and resolved.
13.1 BenchmarkDotNet version regression: the branch base had
0.13.12butupstream/mainalready upgraded to0.15.8.Updated
HdrHistogram.Benchmarking/HdrHistogram.Benchmarking.csprojto0.15.8.Verified:
dotnet build -c Release -p:TargetFrameworks=net9.0succeeds.13.2
spec/tech-standards/build-system.mdBenchmarkDotNet version blockalso reflected the old
0.13.12.Updated both package references in the spec to
0.15.8to match the csproj.13.3
spec/tech-standards/build-system.mdTFM description table in the"Main Library" section was missing rows for
net9.0andnet10.0.Added
net10.0(current LTS target),net9.0(STS target), andnet8.0(LTS target) rows.Acceptance Criterion Cross-Reference
HdrHistogram.csprojtargetsnet10.0;net9.0;net8.0;netstandard2.0HdrHistogram.UnitTests.csprojtargetsnet10.0;net9.0;net8.0HdrHistogram.Examples.csprojtargetsnet10.0HdrHistogram.Benchmarking.csprojtargetsnet10.0;net9.0;net8.0setup-dotnetstep.devcontainer/Dockerfileusessdk:10.0-bookworm-slim+ 8.0 and 9.0 runtimesdotnet build -c Releasesucceeds for all TFMsdotnet testpasses on net8.0, net9.0, net10.0dotnet packproduces.nupkgwith all four target foldersspec/tech-standards/build-system.mdupdated at all five locationsCloses #119