From 76e9ad449808113f4ab02bc913d12c380185077f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Fri, 7 Aug 2026 16:25:03 +0200 Subject: [PATCH] Fix aggregate executable dSYM publish paths Preserve metadata from each expanded dSYM bundle entry when assigning its publish path. Extend the aggregate executable test to exercise and validate the macOS dSYM layout. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 54dd0a45-3f91-4305-a486-fa37b4e25e74 --- .../Microsoft.NETCore.Native.Publish.targets | 5 ++++- .../AggregateLibrary.csproj | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets index 610ae55338e49d..f44198d00af9a6 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets @@ -52,7 +52,10 @@ <_AggregateExecutableShimSymbolRecursivePath Include="%(_AggregateExecutableReferencePath.ShimSymbol)/**/*" Condition="'$(_AggregateExecutable)' == 'true' and '$(CopyOutputSymbolsToPublishDirectory)' == 'true' and '$(NativeSymbolExt)' == '.dSYM' and Exists('%(_AggregateExecutableReferencePath.ShimSymbol)')"> - %(_AggregateExecutableReferencePath.AssemblyName)$(NativeSymbolExt)/%(RecursiveDir)%(Filename)%(Extension) + %(_AggregateExecutableReferencePath.AssemblyName)$(NativeSymbolExt) + + <_AggregateExecutableShimSymbolRecursivePath Update="@(_AggregateExecutableShimSymbolRecursivePath)"> + %(_AggregateExecutableShimSymbolRecursivePath.SymbolBundleName)/%(_AggregateExecutableShimSymbolRecursivePath.RecursiveDir)%(_AggregateExecutableShimSymbolRecursivePath.Filename)%(_AggregateExecutableShimSymbolRecursivePath.Extension) diff --git a/src/tests/nativeaot/AggregateExecutableLibrary/AggregateLibrary.csproj b/src/tests/nativeaot/AggregateExecutableLibrary/AggregateLibrary.csproj index 730c7c1181824d..6252c8284f7ee3 100644 --- a/src/tests/nativeaot/AggregateExecutableLibrary/AggregateLibrary.csproj +++ b/src/tests/nativeaot/AggregateExecutableLibrary/AggregateLibrary.csproj @@ -16,6 +16,8 @@ ./native/ValidatorExe true true + true + true $(NoWarn);CS2008 @@ -31,6 +33,12 @@ + + + .dSYM + + + <_HelloExeRelative>$(BuildProjectRelativeDir)native/HelloExe @@ -39,4 +47,16 @@ + + + + <_ExpectedAggregateExecutableShimSymbol Include="HelloExe.dSYM/Contents/Info.plist" /> + <_ExpectedAggregateExecutableShimSymbol Include="HelloExe.dSYM/Contents/Resources/DWARF/HelloExe" /> + <_PublishedFileRelativePath Include="@(ResolvedFileToPublish->'%(RelativePath)')" /> + <_MissingAggregateExecutableShimSymbol Include="@(_ExpectedAggregateExecutableShimSymbol)" Exclude="@(_PublishedFileRelativePath)" /> + + + +