chore: finish CPM, centralise build properties, restore SourceLink - #10
Merged
Conversation
PR C of the adoption sequence in ADOPTING.md. Closes the last four file clauses: 1.2, 1.3, 1.7 and 1.8. - 1.3: Directory.Packages.props gains CentralPackageVersionOverrideEnabled =false. This repo already had CPM with versionless PackageReferences, so this is the one-line completion rather than a migration. Without it MSBuild silently ignores a stray inline Version= and uses the central one, which is the exact drift the file exists to prevent. - 1.2: root Directory.Build.props replaced with the canonical template, and the properties each csproj restated are deleted from it. The src csproj now carries only PackageId, Version, Description, TargetFrameworks, tags, icon and its own URLs. Tests and demo set GenerateDocumentationFile=false to opt back out of the new default -- sample and fixture code has no XML docs and TreatWarningsAsErrors would fail the build over every missing one. - 1.8: PackageOutputPath now points at artifacts/packages instead of a hardcoded C:\nuget-local\ dev feed, and GeneratePackageOnBuild is scoped to Release. A local dev feed is a personal preference, not repo config; even guarded to Windows it made one machine's layout part of the build. - 1.7: Microsoft.SourceLink.GitHub restored with PrivateAssets="All", at the estate-wide 10.0.400. It had been removed here as redundant, and that observation is correct as far as it goes -- see the proof below -- but the clause wants source linking pinned to a version the estate controls rather than moving with whichever SDK feature band happens to build. The 1.3 proof, packed before and after from a clean obj/ at the same commit (873d8a7) so SourceLink cannot embed two different git SHAs and move the MVID for reasons unrelated to the change: 1.2 + 1.3 + 1.8 alone, every entry in both packages: BYTE-IDENTICAL nuspec, README.md, icon.png, [Content_Types].xml, lib/{net8.0,net10.0}/*.dll, *.xml, and both *.pdb -- all `same`. Only _rels/.rels and the .psmdcp differ, both regenerated per pack. adding 1.7's SourceLink reference on top: nuspec, README, icon, and both XML doc files: still identical. Each .pdb grows 48 bytes; each .dll changes 72 of 34304 bytes, first at offset 137 (the PE header's deterministic stamp) -- consistent with the assembly's embedded PDB checksum moving, not with a code change. The source-link document map itself is unchanged: one blob either way, same raw.githubusercontent.com URL, same commit SHA. No duplicate blob. So the property/CPM migration is provably consumer-neutral, and the only package delta in this PR is the one 1.7 deliberately asks for. CHANGELOG: the [Unreleased] "Removed Microsoft.SourceLink.GitHub" entry is deleted rather than contradicted -- it never shipped, and leaving it beside its own reversal would be worse than either. The PackageOutputPath entry is rewritten, because 1.8 removes the dev feed outright rather than guarding it. Verified locally: Release build at zero warnings, 80 tests passing on both net8.0 and net10.0 with coverage collected, and no stray C:\ directory created anywhere in the tree. Co-Authored-By: Claude Opus 5 (1M context) <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.
What changed
PR C of the NextIteration.Standards adoption sequence (
ADOPTING.mdstep 3). Closes the last four file clauses.Directory.Packages.propsgainsCentralPackageVersionOverrideEnabled=false. This repo already had CPM with versionlessPackageReferences, so this is the one-line completion rather than a migration. Without it MSBuild silently ignores a stray inlineVersion=and uses the central one — the exact drift the file exists to prevent.Directory.Build.propsis replaced with the canonical template, and every property each csproj restated is deleted from it. The src csproj now carries onlyPackageId,Version,Description,TargetFrameworks, tags, icon and its own URLs. Tests and demo setGenerateDocumentationFile=falseto opt back out of the new default — sample and fixture code has no XML docs, andTreatWarningsAsErrorswould fail the build over every missing one.PackageOutputPathpoints atartifacts/packagesinstead of a hardcodedC:\nuget-local\dev feed, andGeneratePackageOnBuildis scoped to Release. A local dev feed is a personal preference, not repo config; even guarded to Windows it made one machine's layout part of the build.Microsoft.SourceLink.GitHubrestored withPrivateAssets="All", at the estate-wide 10.0.400.The §1.3 proof
Packed before and after from a clean
obj/at the same commit (873d8a7), so SourceLink cannot embed two different git SHAs and move the MVID for reasons unrelated to the change.§1.2 + §1.3 + §1.8 alone — every entry in both packages is byte-identical:
NextIteration.SpectreConsole.Splash.nuspecREADME.md,icon.png,[Content_Types].xmllib/net8.0/*.dll,lib/net10.0/*.dlllib/net8.0/*.xml,lib/net10.0/*.xmllib/net8.0/*.pdb,lib/net10.0/*.pdb(snupkg)_rels/.rels,*.psmdcpAdding §1.7's SourceLink reference on top is the only thing in this PR that changes a shipped byte:
.nuspec,README.md,icon.pngand both XML doc files: still identical..pdbgrows 48 bytes; each.dllchanges 72 of 34304 bytes, first at offset 137 — the PE header's deterministic stamp. Consistent with the assembly's embedded PDB checksum moving, not with a code change.raw.githubusercontent.comURL, same commit SHA, no duplicate blob.So the property/CPM migration is provably consumer-neutral, and the only package delta is the one §1.7 deliberately asks for.
A note on §1.7
This reference had been removed here as redundant, and that observation is correct as far as it goes — I verified it independently before touching anything: with no reference at all, SDK 10.0.111 still writes
<repository … commit=…>into the nuspec and a full source-link document map into the PDB, because the SDK shipsMicrosoft.NET.Sdk.SourceLink.targets. The clause still wants the explicit reference, so that source linking is pinned to a version the estate controls rather than moving with whichever SDK feature band happens to build the package. Restored on that basis rather than because the removal was wrong about the mechanics.CHANGELOG
The
[Unreleased]"RemovedMicrosoft.SourceLink.GitHub" entry is deleted rather than contradicted — it never shipped, and leaving it beside its own reversal would be worse than either. ThePackageOutputPathentry is rewritten, because §1.8 removes the dev feed outright rather than guarding it to Windows.Verification
Local, at this commit:
dotnet build --configuration Release— 0 warnings, 0 errors;dotnet test -- --coverage— 80 passed, 0 failed on bothnet8.0andnet10.0, coverage collected. No strayC:\directory created anywhere in the tree.Consumer impact
The
.nuspecis byte-identical, so no dependency, floor, or metadata visible to NuGet changes. The shipped assembly and symbols shift by the 72/48 bytes described above, as a consequence of restoring the SourceLink reference. Step-through debugging and repository metadata worked before and work after.Checklist
TreatWarningsAsErrorsis on)CHANGELOG.mdupdated under[Unreleased].nuspec🤖 Generated with Claude Code