Ship stripped cdac AOT binary and its symbols in the transport package#129783
Merged
hoyosjs merged 1 commit intoJun 24, 2026
Conversation
The Microsoft.DotNet.Cdac.Transport package consumed the NativeAOT publish output (DotNetCdacBinDir), which is the unstripped binary with no adjacent symbol file. The runtime-component build (native-library.targets) already strips the binary like the CoreCLR cmake build and installs both the stripped library and its symbol file (.so.dbg/.dylib.dwarf/.pdb) into the CoreCLR artifacts directory, but nothing consumed them. Point the package at CoreCLRArtifactsPath so it ships the stripped binary, and use a NativeBinary item so the packaging infrastructure (GetSymbolPackageFiles) auto-discovers the adjacent symbol file and adds it to the symbol package. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Microsoft.DotNet.Cdac.Transport packaging project to source the mscordaccore_universal native artifact from the CoreCLR artifacts output (rather than the NativeAOT publish output) and to model it as a NativeBinary so the existing packaging targets can discover and include the adjacent symbol file in the symbol package.
Changes:
- Switch the package input from
$(DotNetCdacBinDir)to$(CoreCLRArtifactsPath)formscordaccore_universal. - Use a
NativeBinaryitem (then include it via<File Include="@(NativeBinary)">) soGetSymbolPackageFilescan auto-pick up.so.dbg/.dylib.dwarf/.pdb.
Comments suppressed due to low confidence (1)
src/installer/pkg/projects/Microsoft.DotNet.Cdac.Transport/Microsoft.DotNet.Cdac.Transport.pkgproj:22
- The
<File>item group should be conditioned on$(PackageTargetRuntime)being set (consistent with other native packages like Microsoft.NETCore.DotNetAppHost). Without this, building the pkgproj directly with an emptyPackageTargetRuntimewould produce an invalidTargetPathlikeruntimes//nativeand also bypass symbol discovery (which is already gated onPackageTargetRuntime!='').
<ItemGroup>
<File Include="@(NativeBinary)">
<TargetPath>runtimes/$(PackageTargetRuntime)/native</TargetPath>
<IsNative>true</IsNative>
</File>
</ItemGroup>
max-charlamb
approved these changes
Jun 24, 2026
steveisok
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
On Linux and macOS the
mscordaccore_universal(cdac AOT) binary shipped in theMicrosoft.DotNet.Cdac.Transportpackage was unstripped, and no debug symbols were being added to the symbol packages. Diagnostics tooling consuming this transport package got a fat binary with no separate symbol file.Root cause
The package's
<File>entry pointed at$(DotNetCdacBinDir), the NativeAOT publish directory. That output is intentionally unstripped, and there is no symbol file next to it.The runtime-component build (
src/native/managed/native-library.targets) already does the right thing: it strips the binary the same way the CoreCLR cmake build does and installs both the stripped library and its symbol file (.so.dbg/.dylib.dwarf/.pdb) into the CoreCLR artifacts directory. Nothing was consuming that stripped output.Change
Point the transport package at
$(CoreCLRArtifactsPath)(where the stripped binary and symbol are installed) instead of the publish directory. Switching the entry from a bare<File>to a<NativeBinary>item lets the existing packaging infrastructure (GetSymbolPackageFilesinsrc/installer/pkg/projects/Directory.Build.targets) auto-discover the adjacent symbol file and add it to the symbol package, matching howMicrosoft.NETCore.DotNetAppHostand other native packages work.This is deliberately surgical: the custom cmake-matching strip logic (including the macOS
codesignstep) is left untouched; only the package now consumes the stripped output plus its symbol.Note
This PR was authored with assistance from GitHub Copilot.