-
Notifications
You must be signed in to change notification settings - Fork 440
Source-build symbols repackaging #17454
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
Source-build symbols repackaging #17454
Conversation
| </ItemGroup> | ||
| </Target> | ||
|
|
||
| <Target Name="ExtractSymbolsTarballs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have a DependsOnTargets for DiscoverSymbolsTarballs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary due to target order in DependsOnTargets attribute of RepackageSymbols target.
But, it won't hurt to have it here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in abc74a8
src/SourceBuild/content/build.proj
Outdated
| DiscoverSymbolsTarballs; | ||
| ExtractSymbolsTarballs"> | ||
| <PropertyGroup> | ||
| <UnifiedSymbolsTarball>$(OutputPath)sourcebuilt-symbols-$(MicrosoftSourceBuildIntermediateInstallerVersion)-$(TargetRid).tar.gz</UnifiedSymbolsTarball> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this should have dotnet in the name.
| <UnifiedSymbolsTarball>$(OutputPath)sourcebuilt-symbols-$(MicrosoftSourceBuildIntermediateInstallerVersion)-$(TargetRid).tar.gz</UnifiedSymbolsTarball> | |
| <UnifiedSymbolsTarball>$(OutputPath)dotnet-sourcebuilt-symbols-$(MicrosoftSourceBuildIntermediateInstallerVersion)-$(TargetRid).tar.gz</UnifiedSymbolsTarball> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I expected a discussion on this naming as it would influence the naming of other source-built artifacts. cc @MichaelSimons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in abc74a8
| string guid = $"{id.Guid:N}"; | ||
| if (!string.IsNullOrEmpty(guid)) | ||
| { | ||
| if (!AllPdbGuids.ContainsKey(guid)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider consolidating this if with the previous. Nested if's don't seem to be adding value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True - will fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in b9f64fd
| } | ||
| } | ||
| } | ||
| catch(Exception) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there specific scenarios you expect here or is this a general purpose safegaurd?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just general purpose. We would catch any symbol for which we could not obtain the guid. Originally I was logging this, but there is no value in that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My question was more along the lines if there was a specific exception type(s) we should be catching instead of all. Catching all can potentially mask problems. This comment applies to the previous catch statement as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have considered handling just the specific exceptions... Perhaps we can improve this later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't get fixed later 😄 so do it now or never.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK - fixing now 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in afd434a
|
|
||
| public void IndexAllSymbols(string path) | ||
| { | ||
| AllPdbGuids = new Hashtable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a design perspective, what is the reason for tracking AllPdbGuids as an instance versus returning this from this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not much now honestly. The code got much simpler as I was revising it, so we don't need this class member anymore.
Will fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in b9f64fd
| public override bool Execute() | ||
| { | ||
| IndexAllSymbols(AllSymbolsPath); | ||
| IList<string> filesWithoutPDBs = GenerateSymbolsLayout(SdkLayoutPath, SdkSymbolsLayoutPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the parameters necessary? They are instance members and could be accesses directly within the method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this. Originally used for testing, but didn't refactor in the end.
Wil fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in b9f64fd
src/SourceBuild/content/build.proj
Outdated
| <SdkSymbolsLayout>$(ArtifactsTmpDir)SdkSymbols</SdkSymbolsLayout> | ||
| <SdkSymbolsTarball>$(OutputPath)dotnet-sdk-symbols-$(MicrosoftSourceBuildIntermediateInstallerVersion)-$(TargetRid).tar.gz</SdkSymbolsTarball> | ||
| <SdkLayout>$(ArtifactsTmpDir)Sdk</SdkLayout> | ||
| <SdkTarballPath>%(SdkTarballItem.Identity)</SdkTarballPath> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Path suffix here introduces inconsistency -e.g. how is this different that the SdkSymbolsTarball?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in b9f64fd
Co-authored-by: Michael Simons <msimons@microsoft.com>
|
|
||
| public override bool Execute() | ||
| { | ||
| IndexAllSymbols(AllSymbolsPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter isn't needed here - will fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in b9f64fd
...d/content/eng/tools/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CreateSdkSymbolsLayout.cs
Outdated
Show resolved
Hide resolved
…eBuild.Tasks.XPlat/CreateSdkSymbolsLayout.cs Co-authored-by: Michael Simons <msimons@microsoft.com>
MichaelSimons
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, ideally the code wouldn't need the catch (Exception) blocks. but I don't have a strong objection.
|
|
||
| foreach (string file in Directory.GetFiles(AllSymbolsPath, "*.pdb", SearchOption.AllDirectories)) | ||
| { | ||
| try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try-catch block isn't needed here - will remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in afd434a
|
PR is stuck in license/cla - trying to close/reopen. |
Fixes: dotnet/source-build#3621
Also adds a new symbols package for SDK, that contains PDBs in proper folder hierarchy - dotnet/source-build#3621 (comment)
Instead of 20
Symbols.<repo>.*tarballs, we'll have the following 2:First tarball contains SDK symbols that match those binaries. It enables developers to extract
dotnet-sdkanddotnet-sdk-symbolstarballs to the same destination folder, and be able to debug every single .NET assembly, as PDBs will be placed right next to binaries.Second tarball contains all symbols from all repos. This tarball introduces new naming schema for artifacts produced by
source-buildinfra. In 9.0 we should use the new naming schema for all other source-build artifacts, i.e. variousPrivate.Sourcebuilt.*tarballs.