Skip to content

Split debug symbols out of Python wheels - #927

Merged
adsharma merged 3 commits into
mainfrom
split-debug-symbols
Sep 7, 2026
Merged

Split debug symbols out of Python wheels#927
adsharma merged 3 commits into
mainfrom
split-debug-symbols

Conversation

@adsharma

@adsharma adsharma commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Depends on LadybugDB/ladybug-python#55 (submodule bump to cafd946 included here).

Splits debug info out of the final repaired wheels so shipped wheels stay stripped while crash reports remain debuggable:

  • Linux: objcopy split into .debug + --add-gnu-debuglink
  • macOS: dsymutil into a .dSYM bundle + strip -S, regenerated post-delocate so it matches the shipped binary
  • Windows: extract .pdb from the wheel, drop `.exp$/$.lib$ linker byproducts

New scripts/pip-package/split_debug_symbols.py performs the split and repacks each wheel with a corrected RECORD; the workflow uploads the extracted symbols as separate per-platform artifacts (manylinux_2_28-symbols-<arch> / <os>-symbols-<platform>).

The splitter reuses an in-build .debug when the binary is already stripped (covers the CMake POST_BUILD path) and regenerates from the final binary otherwise, so there is no double-strip hazard.

Add per-OS symbol separation after cibuildwheel builds so shipped
wheels stay stripped while crash reports remain debuggable:

- Linux: objcopy split into .debug + gnu-debuglink
- macOS: dsymutil into .dSYM + strip -S (regenerated post-delocate)
- Windows: extract .pdb, drop .exp/.lib byproducts

scripts/pip-package/split_debug_symbols.py does the split and repacks
each wheel with a corrected RECORD; the workflow uploads the extracted
symbols as separate per-platform artifacts.

Depends on LadybugDB/ladybug-python#55 (submodule bump included here).
Comment thread .github/workflows/python-wheel-workflow.yml Dismissed
- setup.py now passes -DLBUG_SPLIT_DEBUG_SYMBOLS=OFF: raw .debug/dSYM
  artifacts packaged inside the wheel crashed auditwheel repair
  (pyelftools 'Section' object has no attribute 'iter_versions').
  The split happens on the final repaired wheel instead, which needs
  the debug info still present in the shipped binary.
- split_debug_symbols.py: _find_extensions no longer matches binaries
  inside *.dSYM bundles ('.dSYM' is a suffix of the bundle dir name,
  not a standalone path part) -- this made dsymutil run on the DWARF
  file itself. macOS path also reuses a shipped dSYM when the .so is
  already stripped, mirroring the Linux reuse path.
- Bump tools/python_api for the LBUG_SPLIT_DEBUG_SYMBOLS gate.
@adsharma
adsharma force-pushed the split-debug-symbols branch from 450c2ff to 9657600 Compare September 7, 2026 04:28
@adsharma

adsharma commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@adsharma
adsharma merged commit 3d15b4f into main Sep 7, 2026
6 checks passed
@adsharma
adsharma deleted the split-debug-symbols branch September 7, 2026 04:29
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.

2 participants