Pin the bundled .NET runtime so it is a deliberate choice - #2092
Draft
NickJosevski wants to merge 1 commit into
Draft
Pin the bundled .NET runtime so it is a deliberate choice#2092NickJosevski wants to merge 1 commit into
NickJosevski wants to merge 1 commit into
Conversation
Calamari publishes self-contained. Every artifact carries its own copy of the .NET runtime. Customer vulnerability scanners report against that bundled runtime. Nothing in the repo chose the runtime version. The version came from whichever runtime pack the build agent's SDK happened to ship. Two builds of the same commit on differently patched agents would ship different runtimes. build/BundledRuntime.cs holds a single constant. The constant applies at both self-contained publish sites and at restore. Restore needs the property too. Publish runs with --no-restore. Without the pinned pack downloaded during restore, publish fails with NETSDK1112 on any agent that has not cached the pack. --no-restore is kept. A comment there records that it prevents project.assets.json contention across parallel per-RID publishes. Verified on a cold cache in both directions. The NETSDK1112 failure was reproduced before the fix was confirmed. On SDK 8.0.421, whose default pack is 8.0.27, the published output carries 8.0.29. 82 extraction tests pass on a machine whose newest installed runtime is 8.0.27. The constant needs bumping whenever .NET ships a security patch. A stale value silently ships a vulnerable runtime. .NET 8 reaches end of support on 10 November 2026, after which this must move to a supported major. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
NickJosevski
force-pushed
the
nj/pin-runtime
branch
from
August 4, 2026 07:51
05c4e5d to
fcceee8
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.
Background
Calamari publishes self-contained. Every artifact carries its own copy of the .NET runtime. Customer vulnerability scanners report against that bundled runtime.
Nothing in the repo chose the runtime version. The version came from whichever runtime pack the build agent's SDK happened to ship. Two builds of the same commit on differently patched agents would ship different runtimes.
Results
The bundled runtime version is now a single constant in
build/BundledRuntime.cs. The constant applies at both self-contained publish sites and at restore.Restore needs the property too. Publish runs with
--no-restore. Without the pinned pack downloaded during restore, publish fails with NETSDK1112 on any agent that has not cached the pack.--no-restoreis kept. A comment there records that it preventsproject.assets.jsoncontention across parallel per-RID publishes.Reducing risk
How to review this PR
The constant needs bumping whenever .NET ships a security patch. A stale value silently ships a vulnerable runtime. Worth a Renovate rule after Renovate is re-enabled.