Skip to content

validate-platform-sdks.sh packs at the already-published VERSION.md version, so it can validate the cached nuget.org SDK instead of the working tree #82

Open

Description

@matt-edmondson

What's wrong

scripts/validate-platform-sdks.sh packs every SDK project to a temporary feed without overriding the version (L18-L20):

dotnet pack "$REPO_ROOT/$proj/$proj.csproj" -c Release -o "$FEED" --nologo -v quiet
  • The packages therefore take the committed VERSION.md value.
  • That version is written by the release commit, so on any branch or PR it is a version that has already been published. Today it is 2.31.3-pre.1.
  • The script then pins the consumer's global.json msbuild-sdks to that version, and the generated nuget.config lists nuget.org alongside the local feed (L48-L66).

The repo's own test harness explains why this is unsafe. In test/Sdk.Examples.Tests/Infrastructure/SdkFeed.cs (L19-L31), NuGet resolves msbuild-sdks from the global packages folder before any configured source. Packing at the bare VERSION.md value collides with the published package, and "on a machine that has that version cached the examples would silently build against the published SDK instead of the working tree". SdkFeed avoids this by packing at VERSION + "-local" + guid. The script does not.

Failure scenario

  1. A developer has built any consumer on ktsu.Sdk 2.31.3-pre.1, so that version is in ~/.nuget/packages.
  2. They change Sdk.Linux/Sdk.props so that RuntimeIdentifiers is wrong.
  3. They run scripts/validate-platform-sdks.sh.
  4. The consumers resolve the cached published SDK, and the script prints "All platform SDK validations passed".

On a fresh CI runner the cache happens to be empty, so the job is correct there mostly by luck. Any runner with a warm or restored NuGet cache gets the same false pass.

Suggested fix

Preferred:

  • Move the Linux row into PlatformSdkResolutionTests, which already asserts the same four properties for Windows, macOS, iOS and Android through the uniquely versioned SdkFeed.
  • Rename the Linux demo to the Demo.<Platform> pattern the others use, so that IsLinuxProject detection works.
  • Delete the script and the validate-platform-sdks job in .github/workflows/dotnet-sdk.yml.

Minimal alternative: pack with -p:Version=... -p:PackageVersion=... set to a run-unique suffix, as SdkFeed does, and drop nuget.org from the generated nuget.config if nothing needs it.

Acceptance criteria

Activity

  1. added
    bug
    on Oct 30, 2026
  2. matt-edmondson commented on Oct 30, 2026

    @matt-edmondson
    ContributorAuthor

    Triage


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions