Skip to content

Generate real source links for the built assemblies - #1978

Merged
rmcrackan merged 1 commit into
masterfrom
cursor/sourcelink-github-provider-accb
Aug 19, 2026
Merged

Generate real source links for the built assemblies#1978
rmcrackan merged 1 commit into
masterfrom
cursor/sourcelink-github-provider-accb

Conversation

@rmcrackan

Copy link
Copy Markdown
Owner

What

Adds Microsoft.SourceLink.GitHub 10.0.301 to Directory.Build.props, so it applies to every
project. One file, eight lines.

Why

Every build emitted, once per project:

warning : Source control information is not available - the generated source link is empty.

477 times in the last validate run.

SourceLink's job is to embed a map in the PDB from each compiled source path to a URL where that
exact revision can be fetched, which is what lets a debugger pull matching sources for a built
binary. The warning means that map came out empty, so the PDBs shipped without it.

The repository was never the problem. The build resolves the URL and commit fine:

SourceRoot: /.../libation/  RepoUrl=https://github.com/rmcrackan/libation  SourceLinkUrl=

SourceLinkUrl was blank because no SourceLink host provider was referenced anywhere in the
repo. The SDK supplies Microsoft.SourceLink.Common - which is what emits the warning - along with
the git tasks that find the repository, but nothing translated a github.com remote into
raw.githubusercontent.com URLs. AudibleApi builds warning-free precisely because it references
this provider explicitly, so this brings Libation in line.

Verification

The generated map is now populated:

{"documents":{"/agent/repos/libation/*":"https://raw.githubusercontent.com/rmcrackan/libation/63dc8fc.../*"}}
  • Clean rebuilds of LibationAvalonia, LibationCli and LibationWinForms: 0 errors, and zero occurrences of the warning.
  • dotnet test from Source/: 1479 total, 0 failed, 23 skipped - unchanged.

PrivateAssets="All" keeps it out of anything downstream; it only affects the build.

Open in Web Open in Cursor 

The SDK supplies Microsoft.SourceLink.Common and the git tasks, so the build
resolved the repository URL and commit but had no host provider to turn them
into fetchable URLs. Every project warned that the generated source link was
empty - 477 times in the last validate run - and shipped PDBs that could not
locate their sources.

Referencing the GitHub provider, as AudibleApi already does, fills the map in:
  {"documents":{"/repo/*":"https://raw.githubusercontent.com/rmcrackan/libation/<sha>/*"}}

Co-authored-by: rmcrackan <rmcrackan@gmail.com>
@rmcrackan
rmcrackan marked this pull request as ready for review August 19, 2026 19:07
@github-actions github-actions Bot added the exempt Excluded from automatic stale closure (e.g. maintainer-opened) label Aug 19, 2026
@rmcrackan
rmcrackan merged commit 8c1b754 into master Aug 19, 2026
1 check passed
@rmcrackan
rmcrackan deleted the cursor/sourcelink-github-provider-accb branch August 19, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exempt Excluded from automatic stale closure (e.g. maintainer-opened)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants