Skip to content

Get NativeAOT SDK tool symbols indexed to symweb - #8135

Merged
wtgodbe merged 1 commit into
mainfrom
wtgodbe/aspnetcore-nativeaot-tools-symbols
Aug 4, 2026
Merged

wtgodbe merged 1 commit into
mainfrom
wtgodbe/aspnetcore-nativeaot-tools-symbols

Conversation

@wtgodbe

@wtgodbe wtgodbe commented Aug 4, 2026

Copy link
Copy Markdown
Member

aspnetcoretools (dotnet-dev-certs, dotnet-user-jwts, dotnet-user-secrets) sets CopyOutputSymbolsToPublishDirectory=false to avoid inflating the SDK size. This also prevents its debug symbols from ever reaching symweb, since symbol upload operates on package contents (independent of the SDK's installed layout).

This flips the flag so symbols flow into the package, and extends the SDK's existing DeleteSymbolsFromPublishDir target (which already strips *.pdb from the assembled layout) to also strip the non-Windows Native AOT debug formats (.dbg, .dSYM), so the redistributed SDK size is unaffected.

aspnetcoretools (dotnet-dev-certs, dotnet-user-jwts, dotnet-user-secrets)
set CopyOutputSymbolsToPublishDirectory=false to avoid inflating the SDK
size, but this also prevented their debug symbols from ever reaching
symweb (symbol upload operates on package contents, independent of the
SDK's installed layout). Flip the flag so symbols flow into the package,
and extend the SDK's existing DeleteSymbolsFromPublishDir target (which
already strips *.pdb from the assembled layout) to also strip the
non-Windows Native AOT debug formats (.dbg, .dSYM) so the redistributed
SDK size is unaffected.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings August 4, 2026 19:38
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the VMR SDK layout/publishing behavior so NativeAOT tool symbol files (from aspnetcoretools and related tools) are included in the packaged contents for symweb indexing, while still stripping symbols from the redistributed SDK layout to avoid SDK size inflation.

Changes:

  • Enable publishing/copying NativeAOT tool symbols into publish output so they flow into the package for symbol upload.
  • Extend the SDK layout symbol-stripping step to remove non-Windows NativeAOT symbol formats (*.dbg and macOS .dSYM bundles).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/sdk/src/Layout/redist/targets/GenerateLayout.targets Deletes additional NativeAOT symbol formats from the assembled SDK layout (to keep redistributed SDK size unchanged).
src/aspnetcore/src/Tools/NativeAot/AspNetCoreTools.NativeAot.props Flips NativeAOT tools to copy symbols into publish output so symbols can be included in package contents for symweb.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wtgodbe
wtgodbe enabled auto-merge (squash) August 4, 2026 21:06
@wtgodbe
wtgodbe merged commit 130b7a6 into main Aug 4, 2026
12 checks passed
@wtgodbe
wtgodbe deleted the wtgodbe/aspnetcore-nativeaot-tools-symbols branch August 4, 2026 23:47
akoeplinger added a commit to dotnet/runtime that referenced this pull request Aug 11, 2026
## Summary

- Preserve the metadata of each expanded aggregate executable shim dSYM
entry when assigning its publish path.
- Prevent dSYM contents from collapsing to paths such as
`HelloExe.dSYM/HelloExe.dll`, which can leave non-PE files with a `.dll`
extension in packages.
- Extend the aggregate executable test on macOS to produce dSYM bundles
and validate the expected `Contents/Info.plist` and
`Contents/Resources/DWARF` paths.

dotnet/dotnet#8135 enabled publishing the ASP.NET Core NativeAOT tool
symbols and exposed this issue during VMR package signing. The
underlying publish-path logic came from #128553.

The resulting error was that every bundle file received the same
destination:

`dotnet-dev-certs.dSYM/dotnet-dev-certs.dll`

The files overwrite each other, leaving a ~207-byte YAML relocation file
named  `.dll` . SignTool classifies files by extension, passes it to
PEReader and throws: `System.BadImageFormatException: Unknown file
format`

## Testing

- `./build.sh clr+libs -lc release -rc checked`
- Confirmed the regression test fails with the original publish target.
- `./build.sh clr -rc release`
- `src/tests/build.sh -Test
nativeaot/AggregateExecutableLibrary/AggregateLibrary.csproj -arm64
-release -nativeaot`
- `bash
artifacts/tests/coreclr/osx.arm64.Release/nativeaot/AggregateExecutableLibrary/AggregateLibrary/AggregateLibrary.sh`

> [!NOTE]
> This PR description was generated with GitHub Copilot.

Copilot-Session: 54dd0a45-3f91-4305-a486-fa37b4e25e74
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants