Skip to content

Enable source linking - #3331

Merged
pauldendulk merged 1 commit into
Mapsui:mainfrom
hymccord:feat/symbol-linking
Apr 25, 2026
Merged

pauldendulk merged 1 commit into
Mapsui:mainfrom
hymccord:feat/symbol-linking

Conversation

@hymccord

Copy link
Copy Markdown
Contributor

This will allow the automatic downloading of source code and symbols when debugging.

Closes: #1475

Copilot AI review requested due to automatic review settings April 24, 2026 21:13
@CLAassistant

CLAassistant commented Apr 24, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

Pull request overview

Enables SourceLink-style debugging support by centralizing PDB/debug settings and adding packaging metadata so NuGet consumers can download source/symbols while debugging.

Changes:

  • Removed per-project <DebugType>portable</DebugType> overrides from several .csproj files and centralized it in Directory.Build.props.
  • Added package metadata/settings intended for SourceLink and symbol packages (PublishRepositoryUrl, IncludeSymbols, SymbolPackageFormat, ContinuousIntegrationBuild).
  • Updated the NuGet release workflow to use dotnet nuget push with --skip-duplicate.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Samples/Mapsui.Samples.Common/Mapsui.Samples.Common.csproj Removes project-level DebugType override to rely on centralized props.
Mapsui/Mapsui.csproj Removes project-level DebugType override to rely on centralized props.
Mapsui.Rendering.Skia/Mapsui.Rendering.Skia.csproj Removes project-level DebugType override to rely on centralized props.
Mapsui.Experimental.Rendering.Skia/Mapsui.Experimental.Rendering.Skia.csproj Removes project-level DebugType override to rely on centralized props.
Directory.Build.props Adds SourceLink/symbol packaging properties and centralizes DebugType setting.
.github/workflows/dotnet-release-nugets.yml Switches publishing to dotnet nuget push and skips duplicates.

Comment thread Directory.Build.props Resolved
Comment thread Directory.Build.props Resolved
@hymccord

Copy link
Copy Markdown
Contributor Author

After it builds on the server (where CI env is true).

image

Sample output of build:

image

@hymccord
hymccord force-pushed the feat/symbol-linking branch from a709b22 to 4e14de5 Compare April 24, 2026 21:19
@hymccord
hymccord force-pushed the feat/symbol-linking branch from 4e14de5 to 882193a Compare April 24, 2026 21:28

@pauldendulk pauldendulk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great, thanks for fixing this old open issue!

Here is the copilot review:

Summary

Three things in one PR:

  1. Adds SourceLink + symbol package properties to Directory.Build.props
  2. Consolidates <DebugType>portable</DebugType> from 4 individual .csproj files into the shared Directory.Build.props
  3. Switches CI NuGet push from the legacy nuget push (NuGet CLI) to dotnet nuget push (.NET CLI)
  4. Bonus: fixes inconsistent tab/space indentation in Directory.Build.props

Assessment

The change is correct and mergeable. Here are the specifics:

Directory.Build.props — source linking setup ✅

The four new properties are exactly right for modern .NET SDK (8+):

  • PublishRepositoryUrl — embeds the repo URL in PDB/nupkg metadata
  • IncludeSymbols + SymbolPackageFormat=snupkg — generates .snupkg symbol packages
  • ContinuousIntegrationBuild Condition="'$(CI)' == 'true'" — enables deterministic builds on CI, which SourceLink requires for correct path embedding

The Copilot bot comment saying Microsoft.SourceLink.GitHub is needed is wrong for .NET 8+. SourceLink is built into the SDK and these properties are sufficient. @hymccord's rebuttal is correct.

CI workflow (dotnet-release-nugets.yml) ✅ with one note

Switching to dotnet nuget push is consistent with the rest of the repo tooling. The dotnet nuget push command automatically pushes .snupkg files alongside .nupkg (there's a --no-symbols flag to suppress it), so Copilot's concern there is also unfounded — @hymccord's explanation is correct.

One minor point: the uses: NuGet/setup-nuget@v2 step earlier in the workflow is now unused (the nuget CLI is no longer called). Worth removing in this PR or a follow-up to avoid silently downloading unnecessary tooling.

DebugType consolidation ✅

Clean DRY improvement — the <DebugType>portable</DebugType> was duplicated in 4 project files and now lives in one place.

Minor nit

The existing Directory.Build.props uses True (capital) for GenerateDocumentationFile. The new IncludeSymbols uses lowercase true. Functionally identical for MSBuild, but inconsistent. Not a blocker.


Verdict

Approve. The PR does what it says, the approach is correct for modern .NET SDK, and the Copilot bot's two blocking comments are both wrong. The only actionable suggestion is removing the now-unused NuGet/setup-nuget@v2 step from the workflow, which can be done here or in a follow-up.

@pauldendulk
pauldendulk merged commit 4e5f44e into Mapsui:main Apr 25, 2026
5 checks passed
@hymccord
hymccord deleted the feat/symbol-linking branch April 25, 2026 19:15
@pauldendulk pauldendulk added the PR type: 🛠️ Chore Internal changes that don't affect end users (e.g., code cleanup, build tweaks). label Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR type: 🛠️ Chore Internal changes that don't affect end users (e.g., code cleanup, build tweaks).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add source link to our nuget

4 participants