Skip to content

fix(ci): Drop SourceLink package, use the SDK's - #24464

Merged
MartinZikmund merged 2 commits into
masterfrom
dev/mazi/fix-sourcelink-vuln
Sep 9, 2026
Merged

MartinZikmund merged 2 commits into
masterfrom
dev/mazi/fix-sourcelink-vuln

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

GitHub Issue: closes #24463

PR Type:

🏗️ Build or CI related changes

What changed? 🚀

Every CI build has been failing during restore since the advisory database refreshed on 2026-09-09:

error NU1902: Warning As Error: Package 'Microsoft.Build.Tasks.Git' 8.0.0 has a known moderate
severity vulnerability, https://github.com/advisories/GHSA-23fw-v26w-5fgq

It hit 17 projects and took down Build - Native Binaries (macOS), Tests - Unit Tests, and every WebAssembly Skia Runtime Tests job — those last ones fail while building Uno.NUnitTransformTool, so they never reach a single test.

Root cause

src/Directory.Build.props carried an explicit PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0".

Since .NET SDK 8.0.100 the SDK ships SourceLink itself and imports it implicitly — but Microsoft.NET.Sdk.SourceLink.props skips that import whenever a Microsoft.SourceLink.* package is referenced:

<!-- Suppress implicit SourceLink inclusion if any Microsoft.SourceLink package is referenced. -->
<SuppressImplicitGitSourceLink Condition="'$(PkgMicrosoft_SourceLink_Common)' != ''">true</SuppressImplicitGitSourceLink>

So the reference was pushing the SDK's current copy aside and pinning the three-year-old 8.0.0 Microsoft.Build.Tasks.Git in its place.

There is no 8.0.1 to bump to — the package is now versioned with the SDK band (10.0.x / 11.0.x), so bumping the PackageReference would just re-introduce the version skew the implicit import exists to avoid. Deleting it is the fix: the SDK's SourceLink takes over.

The surrounding PropertyGroup is untouched, so PublishRepositoryUrl, the .pdb-in-.nupkg setting, and the EmbedUntrackedSources=false workaround for mono/linker#1409 all still apply.

Validation

Restore — Uno.NUnitTransformTool in Release, red before / green after:

result
before error NU1902: … Microsoft.Build.Tasks.Git 8.0.0 …
after Restored … (in 150 ms)

Restore (full CI scope) — build/filters/Uno.UI-packages-reference.slnf in Release, on the exact CI SDK (11.0.100-preview.7.26381.103 from build/ci/net11/_global.json): clean, zero NU190x, zero errors.

Compile — Uno.NUnitTransformTool builds Release with 0 errors.

SourceLink still works — generated obj/Release/Uno.NUnitTransformTool.sourcelink.json:

{"documents":{"D:\\Work\\uno\\…\\*":"https://raw.githubusercontent.com/unoplatform/uno/611bb279f91e55c89e51ec767746a21890461722/*"}}

and the evaluated properties:

PublishRepositoryUrl  = true
RepositoryUrl         = https://github.com/unoplatform/uno
EmbedUntrackedSources = false

PR Checklist ✅

🤖 Generated with Claude Code

https://claude.ai/code/session_01Jox2uQ5z5SLRqfrhGMg2ZX

The explicit Microsoft.SourceLink.GitHub 8.0.0 reference suppressed the
SDK's implicit SourceLink import and pinned Microsoft.Build.Tasks.Git
8.0.0, which NuGet audit now flags (GHSA-23fw-v26w-5fgq).

fixes #24463

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jox2uQ5z5SLRqfrhGMg2ZX
Copilot AI lite review requested due to automatic review settings September 9, 2026 13:59
@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 50s —— View job


Review: fix(ci): Drop SourceLink package, use the SDK's

Verdict: ✅ Ship — no inline findings.

Summary

  • The change removes the explicit PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" from src/Directory.Build.props and replaces it with an explanatory comment, letting the SDK's implicit SourceLink import (present since .NET SDK 8.0.100) take over.
  • Confirmed this was the only reference to Microsoft.SourceLink.* / Microsoft.Build.Tasks.Git anywhere in the repo (Directory.Build.targets, other .props files) — removal is complete, no dangling version pin elsewhere.
  • Confirmed the surrounding <Choose> condition (Configuration != Debug, non-test, non-sample, SourceLinkEnabled != false) is untouched, so PublishRepositoryUrl, EmbedUntrackedSources=false (Linker performance issue with GetCustomDebugInformation dotnet/linker#1409 workaround), and the .pdb-in-package setting all still apply exactly as before.
  • Checked the SDK versions pinned for CI (global.json, build/ci/net10/_global.json, build/ci/net11/_global.json) — all are well above the 8.0.100 floor required for the SDK's implicit SourceLink import, so no CI leg is left without SourceLink support.
  • This is a pure build-system config fix (no C#/API-surface changes), so the standard code-style/DependencyProperty/async/test-coverage checklist items are not applicable here. Root cause (explicit package reference suppressing the SDK's implicit import) is correctly identified and fixed at the source rather than papered over with a version bump or NoWarn.
  • Commit/PR title follows Conventional Commits (fix(ci): ...).

No cross-cutting concerns.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is narrowly scoped to removing a problematic package reference, and repository-wide searches confirm no remaining Microsoft.SourceLink.* references that would keep suppressing the SDK’s implicit SourceLink.

Pull request overview

This PR fixes CI restore failures caused by a vulnerability advisory (NU1902) by removing an explicit Microsoft.SourceLink.GitHub package reference that was suppressing the .NET SDK’s implicit SourceLink support and pinning an outdated Microsoft.Build.Tasks.Git.

Changes:

  • Removed the explicit Microsoft.SourceLink.GitHub PackageReference from src/Directory.Build.props.
  • Added an inline MSBuild comment explaining why SourceLink should be provided implicitly by the SDK (and why adding the package back is harmful).
File summaries
File Description
src/Directory.Build.props Drops the explicit SourceLink package reference to allow SDK-provided SourceLink/tasks and avoid restore failures from the vulnerable pinned dependency.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@unodevops

Copy link
Copy Markdown
Contributor

Comment thread src/Directory.Build.props Resolved
Copilot AI review requested due to automatic review settings September 9, 2026 14:41
@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 50s —— View job


Review: fix(ci): Drop SourceLink package, use the SDK's

  • Gather context (diff, AGENTS.md rules)
  • Review src/Directory.Build.props change
  • Post inline findings (if any)
  • Post summary

Verdict: ✅ Ship — no findings.

Summary

  • Change is a single, minimal removal of the explicit Microsoft.SourceLink.GitHub PackageReference in src/Directory.Build.props, replaced with an explanatory comment. No code/API surface touched, so the DependencyProperty/async/cross-platform-suffix/test-coverage checklist items don't apply here.
  • Verified no other reference to Microsoft.SourceLink.* or Microsoft.Build.Tasks.Git remains anywhere under src/ — the removal is complete, no dangling version pin left behind (consistent with build-system.md's note that CPM isn't enabled and versions are pinned centrally; nothing else pins this package).
  • The surrounding <Choose>/<When> condition and the PropertyGroup (PublishRepositoryUrl, EmbedUntrackedSources=false for the Linker performance issue with GetCustomDebugInformation dotnet/linker#1409 workaround, .pdb-in-package setting) are untouched — only the now-unneeded <ItemGroup> was removed.
  • The second commit (e0a4c082) just fixes the new comment's indentation to tabs, matching the file's existing style and the reviewer's inline suggestion — no functional change.
  • Root cause (explicit package reference suppressing the SDK's implicit SourceLink import per Microsoft.NET.Sdk.SourceLink.props) is correctly identified and fixed at the source, not papered over with a version bump or NoWarn.
  • Conventional Commit format is followed (fix(ci): ...).

No cross-cutting concerns.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The functional change is small and aligned with SDK behavior; only a minor wording clarification in the new comment was suggested.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread src/Directory.Build.props Resolved
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 232777 has failed on Uno.UI - CI.

@MartinZikmund
MartinZikmund merged commit 2c352c4 into master Sep 9, 2026
62 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/fix-sourcelink-vuln branch September 9, 2026 18:49
@mergify

mergify Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@agneszitte

agneszitte commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

@Mergifyio backport servicing/6.8

@mergify

mergify Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

backport servicing/6.8

✅ Backports have been created

Details

@agneszitte

Copy link
Copy Markdown
Member

@Mergifyio backport release/stable/6.7

@mergify

mergify Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

backport release/stable/6.7

✅ Backports have been created

Details

agneszitte added a commit that referenced this pull request Sep 10, 2026
…r-24464

fix(ci): Drop SourceLink package, use the SDK's (backport #24464)
agneszitte added a commit that referenced this pull request Sep 10, 2026
…6.7/pr-24464

fix(ci): Drop SourceLink package, use the SDK's (backport #24464)
@MartinZikmund MartinZikmund mentioned this pull request Sep 16, 2026
3 of 5 tasks
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.

[Bug] CI is red on every build: NU1902 on Microsoft.Build.Tasks.Git 8.0.0 (GHSA-23fw-v26w-5fgq)

6 participants