Skip to content

Produce native symbols for Linux#4777

Merged
Kielek merged 6 commits intoopen-telemetry:mainfrom
martincostello:produce-symbols
Jan 22, 2026
Merged

Produce native symbols for Linux#4777
Kielek merged 6 commits intoopen-telemetry:mainfrom
martincostello:produce-symbols

Conversation

@martincostello
Copy link
Member

@martincostello martincostello commented Jan 16, 2026

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.md is updated.
  • Documentation is updated.
  • New features are covered by tests.

Produce native debug symbols for macOS and Linux builds.

Signed-off-by: martincostello <martin@martincostello.com>
Accidental and broke the build.
Apply Copilot fix suggestion to use dsymutil defaults.

Signed-off-by: martincostello <martin@martincostello.com>
@martincostello
Copy link
Member Author

martincostello commented Jan 16, 2026

ZIP artifact sizes:

Name Before After % Delta
bin-alpine-arm64 4.09 MB 17.4 MB x4.25
bin-alpine-x64 4.14 MB 17.9 MB x4.3
bin-macos-14 3.28 MB 3.28 MB -
bin-ubuntu-22.04 4.02 MB 15.7 MB x3.9
bin-ubuntu-22.04-arm 4 MB 16.4 MB x4.1
bin-ubuntu1604-native 1.24 MB 12.9 MB x10.4
bin-windows-2022 8.36 MB 8.36 MB -
bin-nuget-packages 7.5 MB 7.41 MB -

@martincostello martincostello changed the title Produce native symbols for macOS and Linux Produce native symbols for Linux Jan 16, 2026
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="\" />
Copy link
Member Author

@martincostello martincostello Jan 16, 2026

Choose a reason for hiding this comment

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

Preserves addition of .pdb files from #4774, as they're only ~16-19 MB each compared to ~35-50MB each for .so.debug files.

@martincostello martincostello marked this pull request as ready for review January 19, 2026 15:45
@martincostello martincostello requested a review from a team as a code owner January 19, 2026 15:45
Copilot AI review requested due to automatic review settings January 19, 2026 15:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 .debug files 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.

@RassK
Copy link
Contributor

RassK commented Jan 20, 2026

wondering if there's a point to publish separate zip (like ...-debug.zip) so the original deployment is very small but debug is directly interchangeable with the correct version and you gain debugging experience.

@zacharycmontoya
Copy link
Contributor

These size changes are pretty large, can we separate the PDB's into a separate zip rather than the release artifact zips?

@martincostello
Copy link
Member Author

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.

@zacharycmontoya
Copy link
Contributor

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 🙏🏼

Copy link
Member

@Kielek Kielek left a comment

Choose a reason for hiding this comment

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

I agree with @zacharycmontoya that we can make a separate artifacts when needed. Merging it.

@Kielek Kielek enabled auto-merge (squash) January 22, 2026 08:52
@Kielek Kielek merged commit 46cb709 into open-telemetry:main Jan 22, 2026
51 checks passed
@martincostello martincostello deleted the produce-symbols branch January 22, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments