Skip to content

No release since v5.12.1: every CI run on main fails in Release on package validation (CP0014/CP0015) for Color, Cpp, Music and Strings.Identifiers #517

Closed

Description

@matt-edmondson

What's wrong

Every CI run on main since 2026-10-13 has ended in failure. The tests pass on all three OSes. The failing step is Analyze & Release → Release (ktsubuild release). Package validation (ApiCompat) refuses four of the packages it packs:

Project Errors per run
Semantics.Color 11
Semantics.Cpp 9
Semantics.Music 11
Semantics.Strings.Identifiers 11

All of the errors are CP0014/CP0015 between adjacent target frameworks (lib/net8.0 vs lib/net9.0, and lib/net9.0 vs lib/net10.0). They are raised on the Polyfill shims compiled into each assembly:

error CP0015: Cannot change arguments of attribute 'System.Runtime.CompilerServices.NullableContextAttribute' on 'System.Diagnostics.CodeAnalysis.ExperimentalAttribute'. [...\Semantics.Color\Semantics.Color.csproj]
error CP0014: Cannot remove attribute 'System.Runtime.CompilerServices.NullableContextAttribute(2)' from 'System.Diagnostics.CodeAnalysis.ExperimentalAttribute.UrlFormat.get'.
error CP0014: Cannot remove attribute 'System.Runtime.CompilerServices.NullableAttribute(0)' from 'System.Runtime.CompilerServices.DefaultInterpolatedStringHandler'.
error CP0014: Cannot remove attribute 'System.Runtime.CompilerServices.CompilerGeneratedAttribute' from 'System.Diagnostics.CodeAnalysis.ExperimentalAttribute.UrlFormat.set'.

The release step therefore never runs to the end, and nothing has been published since v5.12.1 (2026-10-12T23:30Z). Everything merged after that is unreleased, including the [major] changes for #310 (WeakString set only through Create) and #498 (directory Name is a DirectoryName). The new benchmark-history.yml workflow_run trigger (#320) has therefore never seen a successful CI run: its three runs so far all ended skipped.

Runs (all on main):

  • Last green run: 38321074578 (a198bca, 2026-10-12). It packed and released 5.12.1 with KtsuBuild 2.19.2 on SDK 10.0.401.
  • First red run: 38368803947 (1aa6971, 2026-10-13). It failed with the same SDK 10.0.401 but KtsuBuild 2.19.3. None of the four projects changed between the two commits.
  • Latest red run: 40994500092 (5d5ea9a, 2026-10-30). Same four projects, same diagnostics, on SDK 10.0.403.

Three other projects already reference Polyfill and are multi-targeted, and they pass: Strings, Paths and Quantities. Each of them carries a CompatibilitySuppressions.xml covering exactly these shim differences, together with a comment explaining why:

The four failing projects reference Polyfill and multi-target, but have no suppression file:

The red run starts exactly when KtsuBuild went from 2.19.2 to 2.19.3. This suggests the tool now runs package validation on pack where it did not before, and the four packages without suppressions are the ones exposed by that change. Other repositories in the org that multi-target with Polyfill and have no suppression file may be hitting the same thing.

Reproduce

dotnet pack Semantics.Color -c Release

This fails with the CP0014/CP0015 errors above. The same happens for Semantics.Music, Semantics.Strings.Identifiers and Semantics.Cpp.

Suggested fix

Do for these four projects what Strings, Paths and Quantities already do:

  1. Generate a CompatibilitySuppressions.xml for each project with dotnet pack -p:ApiCompatGenerateSuppressionFile=true.
  2. Check that every generated entry is a Polyfill shim (System.Diagnostics.CodeAnalysis.ExperimentalAttribute, System.Runtime.CompilerServices.DefaultInterpolatedStringHandler, …) rather than a real API difference in the library.
  3. Commit the files, with the same explanatory comment in each csproj.

If the 2.19.3 change turns out to be unintended, raise it with KtsuBuild as well. The suppressions are still correct either way, because they cover by-design differences between target frameworks.

Acceptance criteria

Activity

  1. added
    bug
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions