-
Notifications
You must be signed in to change notification settings - Fork 342
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
Enable PDB archives for source-build #14015
Enable PDB archives for source-build #14015
Conversation
@@ -79,6 +81,48 @@ | |||
</ItemGroup> | |||
</Target> | |||
|
|||
<!-- Discover all repo's symbols that match **\obj\**\*.pdb, to be included in the "main" intermediate nupkg. --> | |||
<Target Name="CreateSymbolsList" Condition="'$(SupplementalIntermediateNupkgCategory)' == ''"> |
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.
While I appreciate the breaking down of logic into smaller chunks, it feels weird to me that CreateSymbolsList
is a separate target whose output is then deleted by another target: CreateSymbolsArchive
. It seems like the symbols list is just an implementation detail of the logic to create the archive and doesn't deserve a separate target.
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.
Yes, this is true. It started as a single target which I split into two to simplify conditioning of few tasks (packaging, message, deletion of symbols list) - each task would need its own condition.
However, I see the point and will revert to my original design.
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 with de9bb57
Found a small issue in one of the conditions - it caused few issues: 1) no archive for |
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<AbsoluteSymbolPath Include="$(SymbolsRoot)\**\obj\**\*.pdb" /> |
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.
Apologies if this is a stupid question, but is there any risk of a not-just-built pdb file being available at this path? Is there any support for posioning pdb files to catch potential leaks?
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.
obj
folder would contain content of just compiled sources. bin
folder would also contain dependencies.
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.
Looks good. I'd be curious to see what the size impact is to the current intermediates. I know runtime has run into the 500MB limit AZDO has on individual artifact files.
<SymbolsArchiveLocation>$(CurrentRepoSourceBuildArtifactsPackagesDir)</SymbolsArchiveLocation> | ||
<SymbolsList>$(SymbolsArchiveLocation)\symbols.lst</SymbolsList> | ||
<SymbolsArchivePrefix>Symbols.</SymbolsArchivePrefix> | ||
<SymbolsArchiveName>$(SymbolsArchiveLocation)$(SymbolsArchivePrefix)$(GitHubRepositoryName).tar.gz</SymbolsArchiveName> |
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.
Should the symbols tarball include the rid and version like other SB artifacts?
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.
That's a good idea - will update the name so it matches other artifacts.
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.
Source-build intermediate package does not include the Rid, i.e. Microsoft.SourceBuild.Intermediate.sdk.8.0.100-rc.2.23423.14.nupkg
I see that infra is evaluating Rid from current OS, which produces RIDs like linux-x64
, so that could be used. But, is there a value - would version be enough?
TargetRID
in SourceBuildIntermediate.proj, which is called from AfterSourceBuild.proj, is set to linux-x64
.
If we use both version and rid we get this: Symbols.sourcelink.8.0.0-beta.23422.2.linux-x64.tar.gz
Just version: Symbols.sourcelink.8.0.0-beta.23422.2.tar.gz
Related intermediate package: Microsoft.SourceBuild.Intermediate.sourcelink.8.0.0-beta.23422.2.nupkg
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 seems that only runtime
and sdk
have non-portable RID set in TargetRid
property. Other repos use the portable Rid, as we are doing portable source-builds for majority of the repos..
My test build with both version
and rid
produced the following - naming is inconsistent, but it matches the Rid used for repo's build:
Symbols.aspnetcore.8.0.0-rc.2.23423.7.linux-x64.tar.gz
Symbols.cecil.0.11.4.0-alpha.23407.2.linux-x64.tar.gz
Symbols.command-line-api.0.1.435601.linux-x64.tar.gz
Symbols.deployment-tools.8.0.0-preview.6.23407.1.linux-x64.tar.gz
Symbols.diagnostics.7.0.0-preview.23211.1.linux-x64.tar.gz
Symbols.format.8.0.442201.linux-x64.tar.gz
Symbols.msbuild.17.8.0-preview-23424-01.linux-x64.tar.gz
Symbols.nuget-client.1.0.0-preview.23424.1.linux-x64.tar.gz
Symbols.razor.7.0.0-preview.23423.3.linux-x64.tar.gz
Symbols.roslyn-analyzers.3.11.0-beta1.23420.2.linux-x64.tar.gz
Symbols.roslyn.4.8.0-2.23423.10.linux-x64.tar.gz
Symbols.runtime.8.0.0-rc.2.23418.14.fedora.36-x64.tar.gz
Symbols.sdk.8.0.100-rc.2.23423.14.fedora.36-x64.tar.gz
Symbols.source-build-externals.8.0.0-alpha.1.23421.1.linux-x64.tar.gz
Symbols.sourcelink.8.0.0-beta.23422.2.linux-x64.tar.gz
Symbols.symreader.2.1.0-beta.23253.1.linux-x64.tar.gz
Symbols.templating.8.0.100-rc.2.23423.2.linux-x64.tar.gz
Symbols.test-templates.1.1.0-rc.23410.2.linux-x64.tar.gz
Symbols.xdt.7.0.0-preview.22423.2.linux-x64.tar.gz
Symbols.xliff-tasks.1.0.0-beta.23418.1.linux-x64.tar.gz
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 with e41ac2f
src/Microsoft.DotNet.Arcade.Sdk/tools/SourceBuild/SourceBuildIntermediate.proj
Show resolved
Hide resolved
|
||
<ItemGroup> | ||
<AbsoluteSymbolPath Include="$(SymbolsRoot)\**\obj\**\*.pdb" /> | ||
<RelativeSymbolPath Include="@(AbsoluteSymbolPath)" Condition="'@(AbsoluteSymbolPath)' != ''"> |
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.
Curious if this can be achieved in one ItemGroup
$([MSBuild]::MakeRelative($(SymbolsRoot), %(FullPath)))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.
Will test it out - thanks!
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.
We can do something like this:
<AbsoluteSymbolPath Include="$(SymbolsRoot)\**\obj\**\*.pdb" />
<AbsoluteSymbolPath Update="@(AbsoluteSymbolPath)" Condition="'@(AbsoluteSymbolPath)' != ''">
<RelativePath>$([MSBuild]::MakeRelative($(SymbolsRoot), %(FullPath)))</RelativePath>
</AbsoluteSymbolPath>
It removes one ItemGroup.
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 with e41ac2f
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<AbsoluteSymbolPath Include="$(SymbolsRoot)\**\obj\**\*.pdb" /> |
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 typically seem ItemGroups name in plural form as the are a type of collection. e.g. AbsoluteSymbolPaths
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've seen both plural and singular in use and can't seem to find any guidance for .NET codebase. It appears that even source-build infra is inconsistent, i.e.
Singular:
arcade/src/Microsoft.DotNet.Arcade.Sdk/tools/SourceBuild/SourceBuildArcade.targets
Line 83 in 08a46d5
<IntermediateNupkgArtifactFile Include="$(CurrentRepoSourceBuildArtifactsPackagesDir)**\*.nupkg" /> |
arcade/src/Microsoft.DotNet.Arcade.Sdk/tools/SourceBuild/SourceBuildIntermediate.proj
Line 60 in 08a46d5
<Content Include="@(IntermediatePackageFile->WithMetadataValue('Category', '$(SupplementalIntermediateNupkgCategory)'))" /> |
Plural:
arcade/src/Microsoft.DotNet.Arcade.Sdk/tools/SourceBuild/SourceBuildArcadeBuild.targets
Line 115 in 08a46d5
<SourceBuildFilesToCopy Include="$(RepoRoot)/**/*" /> |
<SourceBuiltPackageFiles Include="$(CurrentRepoSourceBuiltNupkgCacheDir)**/*.nupkg" /> |
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 acknowledge there are inconsistencies in the code base. I asked to see if you had reasons for using singular. I personally find the plural form can help the readability therefore tend to favor that form as a general rule.
Added the relevant data to main comment. |
This is now fixed. I've updated the initial comment with updated symbols paths in archive packages and added all relevant numbers for intermediate and symbols archive sizes. |
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.
We want this for .NET 8, right? It's easier to just target release/8.0.1xx first and, once it's merged, it will then automatically be ported to main branch.
Arcade repo doesn't have any 8.0-specific branch, they flow their I'm going to make a small update to this PR to address 2 of @MichaelSimons comments. |
Resolves: dotnet/source-build#3547, dotnet/source-build#3609 and dotnet/source-build#3610
This change enables creation of repo-specific PDB archives, named
Symbols.<repo-name>.tar.gz
. Archives get included inmain
source-build intermediate package, and eventually extracted toartifacts/<chip>/<flavor>
i.e.artifacts/x64/Release
.New infra collects all PDBs using
**\obj\**\*.pdb
pattern.File hierarchy is preserved, which enables archive to contain multiple files with the same name. File hierarchy is rooted in
$(CurrentRepoSourceBuildArtifactsDir)
except forsource-build-externals
repo, which uses$(RepoRoot)
.Validation VMR build is in progress: https://dev.azure.com/dnceng/internal/_build/results?buildId=2261578&view=results
Example content, from
Symbols.sourcelink.tar.gz
:Here are some numbers: