diff options
author | Omair Majid <omajid@redhat.com> | 2020-10-01 08:28:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-01 08:28:11 +0300 |
commit | 2f1694ea116cc9819644382861690f17f1c8517b (patch) | |
tree | fbf3357224dd052f12afa5e841a06ef4311e64c4 /Directory.Build.props | |
parent | 746ca52cf3405d9faeb3d2644b56e3761b375002 (diff) |
Add an option to keep native debug symbols (#39203)
When packaging .NET for Linux distributions, the package builders
generally use a different workflow for shipping symbols to users:
1. The package maintainer builds code with the debug flags (such as
`-g`) to generate full native debug info and symbols.
2. Nothing is stripped from build by the package maintainer.
3. The build system (`rpmbuild`, `debuild`) removes the debug
info (or debug symbols) from the code and creates separate
`-debuginfo` or `-debug` packages that contain just the debug
symbols.
4. These debug packages are then distributed along with the normal
packages using the normal Linux distribution mechanisms. This lets
users install the exact set of debug symbols matching their other
package.
To support this workflow in dotnet/runtime, we need to add optional
support for not stripping debug symbols. I used it has follows:
CFLAGS=-g CXXFLAGS=-g ./build.sh --keepnativesymbols true
After this build, the built binaries include all debug symbols.
I can then rely on the distro package build system to identify, strip,
package and ship the debug info/symbols separately.
See https://github.com/dotnet/runtime/issues/3781 and
https://github.com/dotnet/source-build/issues/267 for more details on
the background and motivation.
For some related fixes, see:
- https://github.com/dotnet/coreclr/pull/3445
- https://github.com/dotnet/corefx/pull/24979
Diffstat (limited to 'Directory.Build.props')
-rw-r--r-- | Directory.Build.props | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Directory.Build.props b/Directory.Build.props index dc11cc1b9f1..6a688d500c4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -107,6 +107,8 @@ <PropertyGroup> <!-- Default to portable build if not explicitly set --> <PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild> + <!-- Default to discarding symbols if not explicitly set --> + <KeepNativeSymbols Condition="'$(KeepNativeSymbols)' == ''">false</KeepNativeSymbols> <!-- Used for launchSettings.json and runtime config files. --> <AppDesignerFolder>Properties</AppDesignerFolder> <!-- Determine what architecture we are building on. --> |