Skip to content

[patch] Re-enable package validation with suppression files (ktsu.Sdk 2.13.2)#2

Merged
matt-edmondson merged 1 commit into
mainfrom
apicompat-and-pruning-fixes
Jul 1, 2026
Merged

[patch] Re-enable package validation with suppression files (ktsu.Sdk 2.13.2)#2
matt-edmondson merged 1 commit into
mainfrom
apicompat-and-pruning-fixes

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Restores package validation (reverts the blunt EnablePackageValidation=false disable) now that ktsu.Sdk 2.13.2 relaxes the strict cross-TFM checks that were producing Polyfill false positives.

Background

dotnet pack was failing ApiCompat with CP0014/CP0015/CP0016 errors comparing per-TFM assemblies. Every flagged type is a Polyfill-embedded framework shim (DefaultInterpolatedStringHandler, ExperimentalAttribute, NullabilityInfo, DynamicallyAccessedMemberTypes, …) whose shape legitimately differs per TFM — false positives, not real API breaks. ktsu.Sdk 2.13.2 (ktsu-dev/Sdk#16) disables the strict cross-TFM validation at the SDK layer while keeping baseline validation on.

Changes

  • global.jsonktsu.Sdk 2.13.2 (carries EnableStrictModeForCompatibleFrameworksInPackage=false / EnableStrictModeForCompatibleTfms=false).
  • Removed the per-project EnablePackageValidation=false overrides across all 44 projects — validation is back on via the SDK default.
  • Added a regenerable CompatibilitySuppressions.xml per package (43 files, 17 entries each) capturing the residual Polyfill shim diffs. Regenerate with dotnet pack -p:ApiCompatGenerateSuppressionFile=true.

Result

  • Package validation is enabled again; real breaking changes vs a published baseline are still caught (EnableStrictModeForBaselineValidation stays on).
  • Verified end-to-end on the released ktsu.Sdk 2.13.2: packages pack clean (0 CP errors) with validation on.
  • NU1510 (framework-package pruning) did not reproduce, so no PackageReference conditioning was needed.

Reverts the blunt EnablePackageValidation=false in favor of keeping validation ON.
- Bumps global.json to ktsu.Sdk 2.13.2, which disables strict cross-TFM ApiCompat
  (EnableStrictModeForCompatibleFrameworksInPackage / ...CompatibleTfms) at the SDK layer
  while keeping EnablePackageValidation + baseline-strict validation on.
- Removes the per-project EnablePackageValidation=false overrides (rely on SDK default).
- Adds a regenerable CompatibilitySuppressions.xml per package (17 entries each) capturing
  the Polyfill framework-shim cross-TFM diffs ApiCompat reports as false positives
  (CP0014/CP0015/CP0016); regenerate with 'dotnet pack -p:ApiCompatGenerateSuppressionFile=true'.

Baseline validation still catches real breaks vs a published version. Verified packages pack
clean (0 CP errors) with validation enabled (via the equivalent settings). NU1510 did not
reproduce, so no framework-reference conditioning was needed.
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

@matt-edmondson matt-edmondson merged commit 8119237 into main Jul 1, 2026
5 checks passed
@matt-edmondson matt-edmondson deleted the apicompat-and-pruning-fixes branch July 1, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant