Skip to content

Publishing a symbols package and Enabling Deterministic Builds#1347

Merged
severussundar merged 17 commits intomainfrom
dev/shyamsundarj/publish-symbols-package
Mar 28, 2023
Merged

Publishing a symbols package and Enabling Deterministic Builds#1347
severussundar merged 17 commits intomainfrom
dev/shyamsundarj/publish-symbols-package

Conversation

@severussundar
Copy link
Contributor

@severussundar severussundar commented Mar 21, 2023

Why make this change?

What is this change?

  • SourceLink is used for adding source control metadata to the generated binaries.
  • Symbols package has the same name as the primary package but with an extension .snupkg
  • In the pipeline task for pushing the nupkg to Nuget.org, the pattern is extended to push .snupkg as well
  • Deterministic builds require that the property ContinousIntegrationBuild be set to true during CI runs. TF_BUILD is a system variable that gets set to true during pipeline runs. ContinousIntegrationBuild is set to true conditionally depending on TF_BUILD being true.

How was this tested?

  • Build pipeline produces a symbols package

Docs

Contents of Symbols Package

image

@severussundar severussundar changed the title Dev/shyamsundarj/publish symbols package Publishing a symbols package to Nuget.org Mar 21, 2023
@severussundar severussundar changed the title Publishing a symbols package to Nuget.org Publishing a symbols package and Enabling Deterministic Builds Mar 24, 2023
@severussundar severussundar linked an issue Mar 24, 2023 that may be closed by this pull request
Copy link
Collaborator

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

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

LGTM. Appreciate the research and attention put into this.

Copy link
Contributor

@ayush3797 ayush3797 left a comment

Choose a reason for hiding this comment

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

LGTM after concluding on the NugetCommand@2 discussion. Thanks for making this change!

@abhishekkumams
Copy link
Contributor

does the .nupkg file contains any pdb files?

@severussundar
Copy link
Contributor Author

does the .nupkg file contains any pdb files?

Yes, the pdb files are present in the primary Nuget package as well. I've listed the approaches I tried to exclude them from the primary Nuget here. Unfortunately, none of them worked, and since, the contribution to size of the Nuget package by the symbol files is insignificant, at the moment, it should be okay to include them in the primary package.

@abhishekkumams
Copy link
Contributor

If the pdb files are already in the main package, what's the need of a seperate symbols package which will contain the same pdb files?

@severussundar
Copy link
Contributor Author

If the pdb files are already in the main package, what's the need of a seperate symbols package which will contain the same pdb files?

The ideal state we want to be is where we don't have the symbols in the main NuGet package and publish the symbols package. We can continue to iterate on this to exclude the symbols from the main package.

@severussundar severussundar enabled auto-merge (squash) March 27, 2023 18:47
@severussundar severussundar disabled auto-merge March 28, 2023 05:11
@severussundar severussundar merged commit 7953d06 into main Mar 28, 2023
@severussundar severussundar deleted the dev/shyamsundarj/publish-symbols-package branch March 28, 2023 17:30
abhishekkumams pushed a commit that referenced this pull request Mar 30, 2023
## Why make this change?

- Closes #1098  #1355 
- Publishing a symbols package along with the primary Nuget to
Nuget.org's symbol server, enables users to download the symbol files
(using an IDE such as Visual Studio) and step through Data API builder
source code. This provides them an enhanced debugging experience.
- Deterministic builds are important as they enable verification that
the resulting binary was built from the specified source and provides
traceability.
  
## What is this change?

- `SourceLink` .NET library is used to generate the symbols package. The
generated symbols package has the same name as the primary package but
with an extension `.snupkg`
- In the pipeline task for pushing the nupkg to Nuget.org, the pattern
is extended to push `.snupkg` as well
- Deterministic builds require that the property
`ContinousIntegrationBuild` be set to `true` during CI runs. `TF_BUILD`
is a system variable that gets set to `true` during pipeline runs.
`ContinousIntegrationBuild` is set to `true` conditionally depending on
`TF_BUILD` being `true`.

## How was this tested?

- [x] Build pipeline produces a symbols package

## Docs 

- [Docs for publishing a symbols
package](https://github.com/dotnet/sourcelink)
- [Docs for enabling deterministic
builds](https://github.com/clairernovotny/DeterministicBuilds)
- [Using Source Link for debugging in Visual Studio
](https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/sourcelink#source-link-demo)

## Contents of Symbols Package

![image](https://user-images.githubusercontent.com/11196553/227499659-20ff9a4f-165a-491f-86f8-c235ba1c0b54.png)
severussundar added a commit that referenced this pull request May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable Deterministic Builds when publishing to Nuget.org Publish symbols using a symbol package

4 participants