Strip symbols for x-plat assemblies and publish as NuPkgs
Steps to reproduce
objdump -t libhostpolicy.so
Expected behavior
Similar to coreclr,
objdump -t libcoreclr.so
and a separate file for the symbol information.
This separate file needs to be archived in symbol nupkgs like Windows .pdbs
Actual behavior
objdump -t libhostpolicy.so
contains the full symbol table.
Environment data
dotnet --info output:
Microsoft.NETCore.App 1.0.0
Note
libhostpolicy.so is the highest sized binary, if you strip symbols you get 1.1 MB down to 0.78 MB
This is not blocking release and is best done once we have moved our build/packaging system to build tools, to prevent non-trivial amount of throwaway work.
@AlfredoMS Can you PTAL at this as part of your transition to use build tools? Essentially, we need to generate symbol packages for the host binaries.
The CMake parts of enabling symbol stripping are CMakeLists.txt#L139-L230. The STRIP_SYMBOLS arg is passed in by build-native.sh#L216.
After that, to start putting the stripped symbols into symbol packages, I suggest a file like src/Native/pkg/dir.targets. (For some context, https://github.com/dotnet/coreclr/pull/9664 might be useful.)
@AlfredoMS Let me know when you're getting to a point when you can work on this and let's talk in more depth.
@dagood is this still on track for 5/10 ZBB? /cc @markwilkie @dleeapho
@gkhanna79 Is this needed for 2.0.0? I haven't had it on my radar.
I think it would be most efficient if someone working on the BuildTools Core-Setup effort picked it up, especially if they are familiar with packaging in the new world.
@chcosta Can you help look into this?
Ack
@dagood, is the native part of this something you have context on? Specifically, related to core-setup.
Adding symbol stripping to a CMake project is something I've done before, and I generally see the files I expect in https://github.com/dotnet/core-setup/tree/master/src/corehost. I don't have any context specific to Core-Setup other than what's in this issue description, though.