📦 Include symbols (snupkg's) when creating nuget packages.#552
Conversation
Codecov Report
@@ Coverage Diff @@
## main #552 +/- ##
=======================================
Coverage 85.18% 85.18%
=======================================
Files 137 137
Lines 3322 3322
Branches 749 749
=======================================
Hits 2830 2830
Misses 294 294
Partials 198 198 Continue to review full report at Codecov.
|
bruno-garcia
left a comment
There was a problem hiding this comment.
Thanks for tackling this one too @PureKrome
Left a couple notes
| <!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) --> | ||
| <PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
| <!-- Optional: Embed source files that are not tracked by the source control manager in the PDB --> | ||
| <EmbedUntrackedSources>true</EmbedUntrackedSources> |
There was a problem hiding this comment.
What would such files be? This was left out I believe because I didn't understand the value (or couldn't verify it would add value) when I originally added it
There was a problem hiding this comment.
I added a new comment in the original issue #530 with some screen shots about this.
If I set that to true or false, it still says 'untracked'. Hmmm.
When i add the ContinuousIntegrationBuild value in .. i can get better results.
ContinuousIntegrationBuildadded + false
ContinuousIntegrationBuild added + true
but if i don't add the ContinuousIntegrationBuild value...
TL;DR;
To get NuGet package explorer to be 'happy', I need:
- ✔️
<EmbedUntrackedSources>true</EmbedUntrackedSources> - ✔️
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
I'm honestly not too sure what these are doing and how they make things better/worse. Or in other words, what effect does it have when i DO NOT include them? Sure i know NuGet Package Explorer cries .. but what is happening behind the scenes?
There was a problem hiding this comment.
Got some info on the CIB setting.
This repo shows how to get a fully deterministic build using Source Link. Deterministic builds are important as they enable verification that the resulting binary was built from the specified source and provides traceability.
Deterministic builds require a property to be set to true during CI: ContinuousIntegrationBuild. These should not be enabled during local dev or the debugger won't be able to find the local source files.
So i'll try and make sure the CIB setting is only set via the CLI (because we're using various CI environments right now)
There was a problem hiding this comment.
Also, -FINALLY- stumbled across the docs about the settings.
Set EmbedUntrackedSources to true to instruct the build system to embed project source files that are not tracked by the source control or imported from a source package to the generated PDB.
If the project generates additional source files that are added to Compile item group in a custom target, this target must run before BeforeCompile target (specify BeforeTargets="BeforeCompile"). Otherwise, these additional source files will not be automatically embedded into the PDB.
Again, I don't really understand what this means with respect to Sentry / Sentry's project system :(
I'm going to leave it IN .. as Nuget Package Manager was having a cry, if it was false.
|
|
||
| <!-- Prop required by Microsoft.SourceLink.GitHub --> | ||
| <!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) --> | ||
| <PublishRepositoryUrl>true</PublishRepositoryUrl> |
There was a problem hiding this comment.
Is this true by default? I wonder because sourcelink already worked on this repo
There was a problem hiding this comment.
Another great question. I found the docs on this: (Emphasis, mine)
The URL of the repository supplied by the CI server or retrieved from source control manager is stored in PrivateRepositoryUrl variable.
This value is not directly embedded in build outputs to avoid inadvertently publishing links to private repositories. Instead, PublishRepositoryUrl needs to be set by the project in order to publish the URL into RepositoryUrl property, which is used e.g. in the nuspec file generated for NuGet package produced by the project.
To me, this suggests that the default is FALSE .. but if that's the case ... how does this work?
I've removed it (locally) and generated a new package .. and .. it lists the url in there!
I .. don't get it :(
I think this value is different to <RepositoryUrl>https://github.com/getsentry/sentry-dotnet</RepositoryUrl> which already exists.
~~
So maybe:
- <RepositoryUrl> can be anything, which is meta data for someone to 'know' where the repo is if they want to manually look at code
- <PublishRepositoryUrl> maybe related to how the symbol packages are known where to exist?
I'm thinking, based on the docs, I should put it in there .. mainly because this is a PUBLIC repo.
EDIT: Thinking more on this, I think the above is maybe wrong.
It's an order of importance issue. (I just tested this locally)
- if
<RepositoryUrl>exists, use this. - else if
<PublishRepositoryUrl>== true, then auto set<RepositoryUrl> - else no value for
<RepositoryUrl>
There was a problem hiding this comment.
Also, asked a question in the sourcelink repo.
|
All looking great @PureKrome |
Co-authored-by: Bruno Garcia <bruno@brunogarcia.com>
bruno-garcia
left a comment
There was a problem hiding this comment.
Thanks for the thorough analysis. Let's add it in!
|
Yay! Thanks @bruno-garcia. One last request: could this get the |
|
Sorry I forgot @PureKrome |







Fixes #530
While reviewing the code, I've noticed that the CI system is using something called Zeus for release management. So i'm not familiar with that project (sponsored by Sentry, btw 👏🏻 ). As such, I'm guessing certain steps and unable to do a full end-to-end test, so I'm not to sure how successful this PR will be/get.
Basic idea I've done:
dotnet packincludes symbolsnupkg(currently the status quo) and now also thesnupkgup to zeus 'artifacts'build.propsto have the default suggested source-link settings.I can't see if the
snupkg's do end up getting copied to Zeus. Also, I can't see how to 'release' both if they are up in Zeus.