Produce native symbols for Linux#4777
Conversation
Produce native debug symbols for macOS and Linux builds. Signed-off-by: martincostello <martin@martincostello.com>
...ssions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs
Show resolved
Hide resolved
...ssions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs
Outdated
Show resolved
Hide resolved
...ssions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs
Outdated
Show resolved
Hide resolved
...ssions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs
Outdated
Show resolved
Hide resolved
Accidental and broke the build.
Apply Copilot fix suggestion to use dsymutil defaults. Signed-off-by: martincostello <martin@martincostello.com>
|
ZIP artifact sizes:
|
Not working and I cannot debug locally.
Explcitly add `.dll`, `.dylib`, `.pdb` and `.so` to exclude `.so.debug`. Signed-off-by: martincostello <martin@martincostello.com>
| <file src="**\*" target="\" /> | ||
| <file src="**\*.dll" target="\" /> | ||
| <file src="**\*.dylib" target="\" /> | ||
| <file src="**\*.pdb" target="\" /> |
There was a problem hiding this comment.
Preserves addition of .pdb files from #4774, as they're only ~16-19 MB each compared to ~35-50MB each for .so.debug files.
There was a problem hiding this comment.
Pull request overview
This PR adds native debug symbol generation for Linux builds, separating debug information into .so.debug files while stripping symbols from the main .so binaries. This follows the approach used in PR #4774 for Windows PDB files.
Changes:
- Added CMake configuration to compile with debug symbols and strip them into separate
.debugfiles for Linux - Updated build scripts to copy both the native library and its debug symbols
- Modified NuGet package specification to filter files by extension instead of including all files
- Updated test snapshots to verify the presence of debug symbol files in distributions
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/OpenTelemetry.AutoInstrumentation.Native/CMakeLists.txt | Added compiler flags for debug symbols and post-build commands to strip symbols into separate .debug files |
| build/Build.Steps.Linux.cs | Updated to copy both the .so library and .so.debug symbol files to the build output |
| .github/workflows/build.yml | Updated Ubuntu 16.04 artifact replacement to handle both library and debug symbol files |
| nuget/OpenTelemetry.AutoInstrumentation.Runtime.Native/OpenTelemetry.AutoInstrumentation.Runtime.Native.nuspec | Changed from wildcard file inclusion to specific extension filters |
| test/IntegrationTests/BuildTests.DistributionStructure_*.verified.txt | Updated test snapshots for all Linux variants to include the .so.debug files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...y.AutoInstrumentation.Runtime.Native/OpenTelemetry.AutoInstrumentation.Runtime.Native.nuspec
Show resolved
Hide resolved
|
wondering if there's a point to publish separate zip (like |
|
These size changes are pretty large, can we separate the PDB's into a separate zip rather than the release artifact zips? |
|
Basically the same comment as #4774 (comment). If they need to be split, it needs thought and probably a bunch of changes to the build process because there's lots of "just scoop up everything in the output" in the logic, so picking and choosing files and moving them to different artifacts will include the complexity. If that work does need to be done, it's not something I will have the time to do for at least a week. |
|
Ok, we can proceed with this PR and if we really need to decrease size we can take that on as a comprehensive effort. Thanks for opening these PR's @martincostello 🙏🏼 |
Kielek
left a comment
There was a problem hiding this comment.
I agree with @zacharycmontoya that we can make a separate artifacts when needed. Merging it.
Why
Inspired by #4774 producing PDBs for native Windows DLLs.
See #4777 (comment) for impact to artifact sizes.
What
Produce native debug symbols for Linux builds.
I can't get macOS to work and I don't have access to a Mac to debug it locally, so I've left macOS as-is.
Tests
Manual inspection of build assets plus snapshots updated.
Checklist
CHANGELOG.mdis updated.Documentation is updated.New features are covered by tests.