Uh oh!
There was an error while loading. Please reload this page.
Add an option to keep native debug symbols - #39203
Conversation
omajid
commented
Jul 13, 2020
51f12b5 to
e935340Comparee935340 to
063a014Compareomajid
commented
Jul 21, 2020
Anyone willing to review this? |
dagood
commented
Jul 21, 2020
@jkoritzinsky maybe you'd like to review this change--cmake conditions and new build script arg. |
dagood
left a comment
There was a problem hiding this comment.
Seems very reasonable. One suggestion and one comment about the context--I'm not particularly familiar with this area.
There was a problem hiding this comment.
The help message doesn't mention it takes an argument, but it seems to take true/false and reject nothingness. 😕 But it looks like this is also the case with other settings, so this PR appears to be consistent to me.
There was a problem hiding this comment.
Should I take a stab at fixing up the other settings too?
Uh oh!
There was an error while loading. Please reload this page.
063a014 to
417e787Compareomajid
commented
Sep 21, 2020
@janvorli hey, can you help me find some reviewers for this PR? Thanks in advance! |
janvorli
left a comment
There was a problem hiding this comment.
I would like to ask you to change few things.
There was a problem hiding this comment.
I would prefer creating a msbuild property for this instead of passing it in the cmakeargs. We do that e.g. for the -portablebuild option, so I'd like to use unified way for all of them. You would then add this option to eng/build-commons.sh, which is used to parse the common options for coreclr, libraries and installer .sh scripts and add the cmake arg there. You'll need to update src/coreclr/runtime.proj, src/installer/corehost/corehost.proj and src/libraries/Native/build-native.proj to convert the msbuild property to the -keepsymbols option passed to the respective .sh scripts.
There was a problem hiding this comment.
Does the updated patch match what you had in mind?
There was a problem hiding this comment.
A nit - based on various cmake args settings in coreclr, I'd prefer this to be named CLR_CMAKE_KEEP_SYMBOLS to keep things unified.
417e787 to
f23aca6Compareomajid
commented
Sep 25, 2020
@janvorli Does the "keepSymbols" name appear clear enough to you? Should I look at disambiguating it to "keepNativeSymbols" or "keepUnmanagedSymbols" or something similar? |
janvorli
commented
Sep 25, 2020
Hmm, |
f23aca6 to
2fcdb9dCompareThis is a backport of dotnet/runtime#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 dotnet#3781 and dotnet/source-build#267 for more details on the background and motivation. For some related fixes, see: - dotnet/coreclr#3445 - dotnet/corefx#24979
2fcdb9d to
2ff2c5bCompareomajid
commented
Sep 30, 2020
The CI failures look unrelated to my changes (json tests and mono build issues) but I have rebased this branch onto master to see if that fixes the CI failures. |
omajid
commented
Sep 30, 2020
@janvorli Does this still look okay? |
janvorli
commented
Sep 30, 2020
I'll still re-run the runtime tests to see the |
When packaging .NET for Linux distributions, the package builders generally use a different workflow for shipping symbols to users:
The package maintainer builds code with the debug flags (such as
-g) to generate full native debug info and symbols.Nothing is stripped from build by the package maintainer.
The build system (
rpmbuild,debuild) removes the debug info (or debug symbols) from the code and creates separate-debuginfoor-debugpackages that contain just the debug symbols.These debug packages are then distributed along with the normal packages using the normal Linux distribution mechanisms. This letsusers 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:
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 #3781 and dotnet/source-build#267 for more details on the background and motivation.
For some related fixes, see: