Skip to content
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

Build Mac symbols in .dSYM bundle, not single .dwarf file #94237

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions eng/liveBuilds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@
Include="
$(CoreCLRSharedFrameworkPdbDir)*.pdb;
$(CoreCLRSharedFrameworkPdbDir)*.dbg;
$(CoreCLRSharedFrameworkPdbDir)*.dwarf" IsNative="true" />
$(CoreCLRSharedFrameworkPdbDir)*.dwarf;
$(CoreCLRSharedFrameworkPdbDir)*.dSYM"
IsNative="true" />
<RuntimeFiles Condition="Exists('$(CoreCLRArtifactsPdbDir)System.Private.CoreLib.pdb')"
Include="$(CoreCLRArtifactsPdbDir)System.Private.CoreLib.pdb" />
<RuntimeFiles Condition="Exists('$(CoreCLRArtifactsPdbDir)System.Private.CoreLib.ni.pdb')"
Expand All @@ -113,7 +115,8 @@
Include="
$(CoreCLRSharedFrameworkPdbDir)*.pdb;
$(CoreCLRSharedFrameworkPdbDir)*.dbg;
$(CoreCLRSharedFrameworkPdbDir)*.dwarf" />
$(CoreCLRSharedFrameworkPdbDir)*.dwarf;
$(CoreCLRSharedFrameworkPdbDir)*.dSYM" />

<CoreCLRCrossTargetFiles>
<TargetPath>runtime/$(CoreCLRCrossTargetComponentDirName)_$(TargetArchitecture)/native</TargetPath>
Expand Down Expand Up @@ -188,6 +191,7 @@
$(LibrariesNativeArtifactsPath)*.so;
$(LibrariesNativeArtifactsPath)*.dbg;
$(LibrariesNativeArtifactsPath)*.dwarf;
$(LibrariesNativeArtifactsPath)*.dSYM;
$(LibrariesNativeArtifactsPath)*.pdb"
IsNative="true"
Exclude="@(ExcludeNativeLibrariesRuntimeFiles)" />
Expand Down
6 changes: 4 additions & 2 deletions eng/native/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ endfunction()
function (get_symbol_file_name targetName outputSymbolFilename)
if (CLR_CMAKE_HOST_UNIX)
if (CLR_CMAKE_TARGET_APPLE)
set(strip_destination_file $<TARGET_FILE:${targetName}>.dwarf)
# set(strip_destination_file $<TARGET_FILE:${targetName}>.dwarf)
set(strip_destination_file $<TARGET_FILE:${targetName}>.dSYM)
else ()
set(strip_destination_file $<TARGET_FILE:${targetName}>.dbg)
endif ()
Expand Down Expand Up @@ -416,7 +417,8 @@ function(strip_symbols targetName outputFilename)
OUTPUT_VARIABLE DSYMUTIL_HELP_OUTPUT
)

set(DSYMUTIL_OPTS "--flat")
# set(DSYMUTIL_OPTS "--flat")
set(DSYMUTIL_OPTS "")
if ("${DSYMUTIL_HELP_OUTPUT}" MATCHES "--minimize")
list(APPEND DSYMUTIL_OPTS "--minimize")
endif ()
Expand Down
3 changes: 2 additions & 1 deletion eng/native/naming.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
<LibPrefix>lib</LibPrefix>
<LibSuffix>.dylib</LibSuffix>
<StaticLibSuffix>.a</StaticLibSuffix>
<SymbolsSuffix>.dwarf</SymbolsSuffix>
<!-- <SymbolsSuffix>.dwarf</SymbolsSuffix> -->
<SymbolsSuffix>.dSYM</SymbolsSuffix>
Copy link
Member

Choose a reason for hiding this comment

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

This might quickly become a leaky abstraction. For example, we also are missing updating GetSymbolPackageFiles in https://github.com/dotnet/runtime/blob/main/src/installer/pkg/projects/Directory.Build.targets (the excludes and all that)

</PropertyGroup>
</When>
<Otherwise>
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/.nuget/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
<NonWindowsNativeFile Include="@(NativeWithSymbolFile)"
Exclude="@(WindowsNativeFile)" />

<NonWindowsSymbolFile Include="@(NonWindowsNativeFile -> '%(Identity)$(SymbolsSuffix)')" />
<NonWindowsSymbolFile Condition="'$(SymbolsSuffix)'=='.dSYM'" Include="@(NonWindowsNativeFile -> '%(Identity)$(SymbolsSuffix)/**')" />
<NonWindowsSymbolFile Condition="'$(SymbolsSuffix)'!='.dSYM'" Include="@(NonWindowsNativeFile -> '%(Identity)$(SymbolsSuffix)')" />

<ExistingWindowsSymbolFile Include="@(WindowsSymbolFile)" Condition="Exists('%(Identity)')" />
<ExistingNonWindowsSymbolFile Include="@(NonWindowsSymbolFile)" Condition="Exists('%(Identity)') AND '$(SkipPackagingXplatSymbols)'!='true'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(_targetOS)' == 'win' and '$(NativeLib)' == 'Static'">.lib</NativeBinaryExt>
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(_targetOS)' != 'win' and '$(NativeLib)' == 'Static'">.a</NativeBinaryExt>

<NativeSymbolExt Condition="'$(NativeSymbolExt)' == '' and '$(_IsApplePlatform)' == 'true'">.dsym</NativeSymbolExt>
<NativeSymbolExt Condition="'$(NativeSymbolExt)' == '' and '$(_IsApplePlatform)' == 'true'">.dSYM</NativeSymbolExt>
<NativeSymbolExt Condition="'$(NativeSymbolExt)' == '' and '$(_targetOS)' == 'win'">.pdb</NativeSymbolExt>
<NativeSymbolExt Condition="'$(NativeSymbolExt)' == ''">.dbg</NativeSymbolExt>

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
<IlcFrameworkNativePath>$(MicrosoftNetCoreAppRuntimePackNativeDir)</IlcFrameworkNativePath>
<TrimmerSingleWarn>false</TrimmerSingleWarn>
<!-- Use .dwarf files instead of .dsym files since our symbol exporting may not safely handle folders. -->
<NativeSymbolExt Condition="'$(_IsApplePlatform)' == 'true'">.dwarf</NativeSymbolExt>
<DsymUtilOptions Condition="'$(_IsApplePlatform)' == 'true'">--flat</DsymUtilOptions>
<!-- <NativeSymbolExt Condition="'$(_IsApplePlatform)' == 'true'">.dwarf</NativeSymbolExt> -->
<!-- <DsymUtilOptions Condition="'$(_IsApplePlatform)' == 'true'">--flat</DsymUtilOptions> -->
</PropertyGroup>

<ItemGroup Condition="'$(NativeAotSupported)' == 'true'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@
</ItemGroup>

<Target Name="AddRuntimeSpecificNativeSymbolToPackage">
<ItemGroup Condition="'$(SymbolsSuffix)'!='.dSYM'">
<TfmSpecificDebugSymbolsFiles Include="$(NativeBinDir)$(LibPrefix)System.IO.Ports.Native$(LibSuffix)$(SymbolsSuffix)" />
</ItemGroup>
<ItemGroup Condition="'$(SymbolsSuffix)'=='.dSYM'">
<TfmSpecificDebugSymbolsFiles Include="$(NativeBinDir)$(LibPrefix)System.IO.Ports.Native$(LibSuffix)$(SymbolsSuffix)/**" />
</ItemGroup>
<ItemGroup>
<TfmSpecificDebugSymbolsFile Include="$(NativeBinDir)$(LibPrefix)System.IO.Ports.Native$(LibSuffix)$(SymbolsSuffix)"
<TfmSpecificDebugSymbolsFile Include="@(TfmSpecificDebugSymbolsFiles)"
TargetPath="/runtimes/$(OutputRID)/native"
TargetFramework="$(TargetFramework)" />
</ItemGroup>
Expand Down
7 changes: 6 additions & 1 deletion src/native/corehost/corehost.proj
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@
Command="&quot;$(DotNetTool)&quot; exec @(InjectResourceTool) --bin &quot;$(DacPath)&quot; --image &quot;$(SingleFileHostDestinationPath)&quot; --name MINIDUMP_EMBEDDED_AUXILIARY_PROVIDER" />

<!-- Copy symbols if they exist. We may not have separate symbols if they were not stripped from the native binary itself. -->
<Copy SourceFiles="$(SingleFileHostSymbolsPath)" DestinationFiles="$(SingleFileHostSymbolsDestinationPath)" Condition="Exists('$(SingleFileHostSymbolsPath)')" />
<ItemGroup Condition="'$(SymbolsSuffix)'=='.dSYM'">
<DSYMFiles Include="$(SingleFileHostSymbolsPath)/**/*"/>
</ItemGroup>

<Copy SourceFiles="@(DSYMFiles)" DestinationFolder="$(SingleFileHostSymbolsDestinationPath)/%(RecursiveDir)" Condition="'$(SymbolsSuffix)'=='.dSYM' and Exists('$(SingleFileHostSymbolsPath)')" />
<Copy SourceFiles="$(SingleFileHostSymbolsPath)" DestinationFiles="$(SingleFileHostSymbolsDestinationPath)" Condition="'$(SymbolsSuffix)'!='.dSYM' and Exists('$(SingleFileHostSymbolsPath)')" />
</Target>

<Target Name="PrepareSingleFileHostWithEmbeddedDac"
Expand Down