Fix .NET 10 source app detection (TargetFramework regex) - #1318
Merged
tnikolova82 merged 9 commits intoAug 20, 2026
Conversation
Contributor
Author
|
Addressed review feedback (via Slack) that the newly-added `dotnet-runtime`/`dotnet-aspnetcore` 10.0.11 and `dotnet-sdk` 10.0.400 manifest entries had an empty `source_sha256` field. That field records the sha256 of the original `builds.dotnet.microsoft.com` artifact (distinct from `uri`/`sha256`, which point at the already-verified `buildpacks.cloudfoundry.org` mirror). Downloaded each of the three original Microsoft-hosted artifacts directly and filled in their sha256:
( |
|
@rkoster Also, LGTM |
for stack(s) cflinuxfs4, cflinuxfs5
for stack(s) cflinuxfs4, cflinuxfs5
The regex used to detect the target dotnet-runtime version from a source app's <TargetFramework> (e.g. net8.0, netcoreapp6.7) only matched a single digit for the major version component. This caused staging to fail for net10.0 apps with "could not find a version of dotnet-runtime to install", even though dotnet-runtime/dotnet-sdk/ dotnet-aspnetcore 10.0.x were already vendored in manifest.yml. Widen the major-version capture group from \d to \d+ so multi-digit majors like net10.0 are recognized.
Adds a source_10.0 fixture (net10.0 MVC app, mirroring source_9.0) and a "with .NET Core 10" switchblade spec asserting a successful deployment, exercising the TargetFramework regex fix.
for stack(s) cflinuxfs4, cflinuxfs5
for stack(s) cflinuxfs4, cflinuxfs5
for stack(s) cflinuxfs4, cflinuxfs5
…nd dotnet-sdk 10.0.400 The dependency-bot-generated manifest entries merged from pr-by-releng-bot-1786473315/-1786473390/-1786473529 shipped with an empty source_sha256 field (the sha256 of the original builds.dotnet.microsoft.com artifact, as opposed to the uri/sha256 fields which point at the buildpacks.cloudfoundry.org mirror and were already correctly populated and verified). Downloaded each of the three original Microsoft-hosted artifacts directly and computed their sha256: - aspnetcore-runtime-10.0.11-linux-x64.tar.gz: d3504b4b7c1898b668f58ab0ea4d28821a520a97c9a758b8bb68a424a6f1ccef - dotnet-runtime-10.0.11-linux-x64.tar.gz: 7d847ecaa123efae40b114c5d45641e456b4cd65e5114b4612095d45d7c71a63 - dotnet-sdk-10.0.400-linux-x64.tar.gz: 7ad9d2db01512e41fd580a0630321bb70cd062d7fe4c5badfb4ce81ec1eddbb8
…nd dotnet-sdk 10.0.400
tnikolova82
force-pushed
the
fix-net10-target-framework-regex
branch
from
August 19, 2026 14:36
71b2e6b to
9aa020b
Compare
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.
Problem
Deploying a source-based app targeting
net10.0fails during staging at the "Finalizing Dotnet Core" step with:This happens even though
dotnet-sdk/dotnet-runtime/dotnet-aspnetcore10.0.x are already vendored inmanifest.yml(added in #1175 and follow-up dependency-bot commits).Root cause
The
TargetFrameworkregex insrc/dotnetcore/project/project.go(SourceInstallDotnetRuntime) only matched a single digit major version:This matches
net8.0/net9.0fine, but never matchesnet10.0, so runtime version detection fails for any two-digit major.Fix
\dto\d+.net10.0, mirroring the existingnet5.0/netcoreapp6.7cases) inproject_test.go.source_10.0fixture (net10.0 MVC app, mirroringsource_9.0) and awith .NET Core 10switchblade integration spec indefault_test.goasserting a successful source-based deployment.Dependency version bumps (also fixed here)
Fixing the regex alone wasn't enough — it uncovered two further, unrelated issues that had to be fixed for .NET 10 to actually be usable:
1. SDK/runtime version mismatch. The vendored
dotnet-sdk 10.0.300's own CLI tooling requiresMicrosoft.NETCore.App >= 10.0.8just to run, butmanifest.ymlonly vendoreddotnet-runtime/dotnet-aspnetcore10.0.2 — and the .NET host can roll a runtime forward to a newer patch, never backward. So even with the regex fixed, staging still failed later atdotnet publishwithYou must install or update .NET to run this application.Fixed by bumping to the matching10.0.10(merging already-mirrored dependency-bot PRs #1305/#1303).2. cgroup v2 root-cgroup segfault (upstream runtime bug).
.NET 10.0.10is exposed to dotnet/runtime#130092 — a regression introduced in .NET 9.0 (dotnet/runtime#93611) where, when a process's cgroup path is the root of the cgroup v2 mount (no per-container subdirectory nesting — seen in practice on some Diego cells), the hierarchical memory-limit walk-up loop reads past the mount root, causing an access violation crash during app startup. This is independent of theDOTNET_GCHeapHardLimitwork in #1317 — it's an outright segfault during early CLR/GC init, before any GC config is consulted. Fixed upstream in dotnet/runtime#130377, backported torelease/10.0via dotnet/runtime#130404, and shipped in.NET 10.0.11(released 2026-08-11, confirmed via the dotnet/core release manifest). This PR now bumpsdotnet-runtime/dotnet-aspnetcoreto10.0.11anddotnet-sdkto10.0.400accordingly (merging already-mirrored dependency-bot branches, each independently verified: artifact URLs return HTTP 200 and downloaded artifacts' SHA256 matches the manifest).Verification
go build/go vetclean.project,finalize,hooks,supply).dockerswitchblade backend end-to-end: SDK install → runtime/aspnetcore install →dotnet publishsucceeds → app serves the expected homepage content.net10.0source app using a locally-built cached buildpack zip from this exact branch state — staging succeeded (SDK 10.0.400 → runtime 10.0.11 → aspnetcore 10.0.11 →dotnet publish), app started and servedHTTP 200on first request.