Enable deterministic builds and embed untracked sources in NuGet packages#4337
Enable deterministic builds and embed untracked sources in NuGet packages#4337slang25 wants to merge 2 commits intoaws:developmentfrom
Conversation
…ages Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
This is somewhat related to #4110, right? I did give it a try when that issue was created, but even after applying Martin's suggestions I only got those warnings to go away after I manually changed the SDK not to use the |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@dscpinheiro Yes it's basically #4110 I won't go into too much detail about what I'm trying to do, but I writing some meta-programing tools, and it's helpful if packages are "complete" and contain links to source, or embed untracked source files. You'll see what's missing if you go here: As I understand, this should still work with the nuspec approach, because it's about the symbols/dlls and you are already getting the sourcelink document embedded there, it's just that the symbols don't include the untracked files, and the paths are deterministic ( So it should be a case of tweaking the build step. Are the actual release build scripts part of the repo or are these private? |
Description
Enable
DeterministicandEmbedUntrackedSourcesMSBuild properties across all projects that produce NuGet packages.Deterministic: Ensures the compiler produces byte-identical output for the same inputs, enabling reproducible builds.EmbedUntrackedSources: Embeds source files not tracked by source control (e.g. auto-generated code) into the PDB. This complements the existing SourceLink support so that consumers can debug into generated sources that can't be fetched from GitHub.Properties are added to
sdk/Directory.Build.props,extensions/Directory.Build.props, and the 5 per-extensionDirectory.Build.propsfiles that shadow the parent.Motivation and Context
The NuGet packages published by this repository already include SourceLink, allowing sources to be mapped back to their GitHub repo source files. However:
Deterministicflag is not explicitly set, which means builds may not be reproducible across machines.Testing
These are declarative MSBuild property changes. They can be verified by:
dotnet tool run sourcelink print-jsonto confirm SourceLink metadata.MetadataToolsto confirm untracked sources are embedded.Breaking Changes Assessment
No breaking changes. These properties affect compiler and PDB output only — they do not change the runtime behavior or public API surface of any assembly.
Types of changes
Checklist
License