Skip to content

[Feature]: Consider Source Link support, publishing symbols, and deterministic builds #128

Description

@fkelava

Pre-submission Checklist

  • I have read the README features list
  • I have read the FAQ Wiki
  • I have searched existing issues and this feature hasn't been requested
  • I have verified this feature doesn't already exist in the package

Problem Statement

Modern .NET (since the .NET 8 SDK) includes Source Link. The effect is that- when debugging a dump that contains frames from a given DLL or package, or when performing 'Peek Definition' or 'Go To Definition', instead of decompiling, the proper corresponding source files are automatically fetched by a compatible IDE. This makes build-time and debugging work considerably easier.

Hexa.NET.ImGui isn't Source Link enabled. This in itself is not a problem, but trying to 'Go To Definition' for any overload generally is far too slow to be usable in Visual Studio 2026. I need the repo open somewhere if I wanna quickly check what an overload precisely does, which does slow things down on occasion.

Source Link goes hand in hand with deterministic builds, which basically just attest that the build was in fact generated from the sources it claims to be. This is quite painless to enable on CI.

Another topic is that no symbols seem to be published on NuGet. It would be helpful to do so, since only minimal changes should be required to .csproj files to enable it.

NuGet Package Explorer, under the 'Health' section, gives feedback on whether these things are enabled.

Proposed Solution

For deterministic builds, it is enough to specify in a .csproj (or better, in a Directory.Build.props for the whole solution at once):

<PropertyGroup>
    <ContinuousIntegrationBuild Condition="'$(GITHUB_RUN_ID)' != ''">true</ContinuousIntegrationBuild>
</PropertyGroup>

See https://github.com/terrafx/terrafx.interop.windows/blob/main/Directory.Build.props#L44, etc.

Or, for local testing, dotnet build /p:ContinuousIntegrationBuild=true.

Symbols could be published in a few ways. Either include the .pdbs into the main NuGet package per https://github.com/dotnet/sourcelink#include-in-main-package, or generate a .snupkg and publish it to NuGet with these two .csproj properties:

<PropertyGroup>
    <IncludeSymbols>true</IncludeSymbols>
    <SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

nuget push should collect and automatically push any symbol package adjacent to a .nupkg.

With these done, Source Link should also just 'light up' if you're using the latest .NET SDK to publish.

Alternatives Considered

No response

Additional Context

The goal is more or less to go from this:

Image

to something vaguely resembling this:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions