Skip to content

Conversation

@NikolaMilosavljevic
Copy link
Member

@NikolaMilosavljevic NikolaMilosavljevic commented Oct 3, 2023

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:

dotnet-sdk-symbols-8.0.100-rtm.23477.1-fedora.38-x64.tar.gz
sourcebuilt-symbols-8.0.100-rtm.23477.1-fedora.38-x64.tar.gz

First tarball contains SDK symbols that match those binaries. It enables developers to extract dotnet-sdk and dotnet-sdk-symbols tarballs 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-build infra. In 9.0 we should use the new naming schema for all other source-build artifacts, i.e. various Private.Sourcebuilt.* tarballs.

@NikolaMilosavljevic NikolaMilosavljevic requested a review from a team as a code owner October 3, 2023 18:07
</ItemGroup>
</Target>

<Target Name="ExtractSymbolsTarballs"
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in abc74a8

DiscoverSymbolsTarballs;
ExtractSymbolsTarballs">
<PropertyGroup>
<UnifiedSymbolsTarball>$(OutputPath)sourcebuilt-symbols-$(MicrosoftSourceBuildIntermediateInstallerVersion)-$(TargetRid).tar.gz</UnifiedSymbolsTarball>
Copy link
Member

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.

Suggested change
<UnifiedSymbolsTarball>$(OutputPath)sourcebuilt-symbols-$(MicrosoftSourceBuildIntermediateInstallerVersion)-$(TargetRid).tar.gz</UnifiedSymbolsTarball>
<UnifiedSymbolsTarball>$(OutputPath)dotnet-sourcebuilt-symbols-$(MicrosoftSourceBuildIntermediateInstallerVersion)-$(TargetRid).tar.gz</UnifiedSymbolsTarball>

Copy link
Member Author

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in abc74a8

@mthalman mthalman requested a review from a team October 4, 2023 19:05
string guid = $"{id.Guid:N}";
if (!string.IsNullOrEmpty(guid))
{
if (!AllPdbGuids.ContainsKey(guid))
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

True - will fix this.

Copy link
Member Author

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)
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK - fixing now 😄

Copy link
Member Author

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();
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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);
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in b9f64fd

<SdkSymbolsLayout>$(ArtifactsTmpDir)SdkSymbols</SdkSymbolsLayout>
<SdkSymbolsTarball>$(OutputPath)dotnet-sdk-symbols-$(MicrosoftSourceBuildIntermediateInstallerVersion)-$(TargetRid).tar.gz</SdkSymbolsTarball>
<SdkLayout>$(ArtifactsTmpDir)Sdk</SdkLayout>
<SdkTarballPath>%(SdkTarballItem.Identity)</SdkTarballPath>
Copy link
Member

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?

Copy link
Member Author

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);
Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in b9f64fd

…eBuild.Tasks.XPlat/CreateSdkSymbolsLayout.cs

Co-authored-by: Michael Simons <msimons@microsoft.com>
Copy link
Member

@MichaelSimons MichaelSimons left a 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
Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in afd434a

@NikolaMilosavljevic
Copy link
Member Author

PR is stuck in license/cla - trying to close/reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants