Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement SourceLink support #18968

Closed
rolfbjarne opened this issue Sep 8, 2023 · 0 comments · Fixed by #20054
Closed

Implement SourceLink support #18968

rolfbjarne opened this issue Sep 8, 2023 · 0 comments · Fixed by #20054
Assignees
Labels
enhancement The issue or pull request is an enhancement feature A feature to be implemented
Projects
Milestone

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented Sep 8, 2023

Android did this: xamarin/xamarin-android#7298

We should implement this as well.

Ref: #11879

As part of this we should make sure the Health tab in the NuGet Package Explorer says we're OK:

Screenshot 2023-09-19 at 07 19 52

from: https://nuget.info/packages/Microsoft.iOS.Runtime.ios-arm64/16.4.8825-net8-rc1

@rolfbjarne rolfbjarne added the enhancement The issue or pull request is an enhancement label Sep 8, 2023
@rolfbjarne rolfbjarne added this to the .NET 9 milestone Sep 8, 2023
@rolfbjarne rolfbjarne added this to Features in .NET 9 Sep 8, 2023
@rolfbjarne rolfbjarne added the feature A feature to be implemented label Sep 8, 2023
haritha-mohan added a commit to haritha-mohan/xamarin-macios that referenced this issue Feb 7, 2024
Fixes xamarin#18968

We provide a mapping to the checked in source files via SourceLink.json
and the rest of the generated/untracked sources are embedded into the
PDB to provide a more comprehensive debugging experience. Since we
invoke CSC directly, there were a few workarounds that had to be implemented
(ex: implementing a helper script to account for untracked sources
instead of simply using the EmbedUntrackedSources MSBuild property).

As for testing, the newly added support was validated via the sourcelink
dotnet tool which confirmed all the sources in the PDB either had valid
urls or were embedded.

sourcelink test Microsoft.MacCatalyst.pdb —> sourcelink test passed: Microsoft.MacCatalyst.pdb

The PDB size does increase in size after embedding;
for example, Microsoft.MacCatalyst.pdb went from 5 MB to 15.7 MB.

But considering it would significantly help improve the debugging
experience, be consistent with Android’s offerings, and it’s a
highlighted attribute on the NuGet package explorer I think it’s a
worthy size increase.

Refs:
xamarin/xamarin-android#7298
dotnet/roslyn#12625
https://github.com/dotnet/sourcelink/tree/main/docs
haritha-mohan added a commit that referenced this issue Feb 26, 2024
Fixes #18968

We provide a mapping to the checked in source files via SourceLink.json
and the rest of the generated/untracked sources are embedded into the
PDB to provide a more comprehensive debugging experience. Since we
invoke CSC directly, there were a few workarounds that had to be
implemented (ex: implementing a helper script to account for untracked
sources instead of simply using the EmbedUntrackedSources MSBuild
property).

As for testing, the newly added support was validated via the dotnet
sourcelink tool which confirmed all the sources in the PDB either had
valid urls or were embedded.

`sourcelink test Microsoft.MacCatalyst.pdb` —> `sourcelink test passed:
Microsoft.MacCatalyst.pdb`

The PDB size does increase in size after embedding;
Microsoft.MacCatalyst.pdb went from 5 MB to 15.7 MB.

But considering it would significantly help improve the debugging
experience, be consistent with Android’s offerings, and it’s a
highlighted attribute on the NuGet package explorer I think it’s a
worthy size increase.

Refs:
xamarin/xamarin-android#7298 
dotnet/roslyn#12625
https://github.com/dotnet/sourcelink/tree/main/docs

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Michael Cummings (MSFT) <mcumming@microsoft.com>
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
.NET 9 automation moved this from Features to Done Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue or pull request is an enhancement feature A feature to be implemented
Projects
Development

Successfully merging a pull request may close this issue.

2 participants