Skip to content

Separate debug symbols for the _lbug extension - #55

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

Separate debug symbols for the _lbug extension#55
adsharma merged 3 commits into
mainfrom
split-debug-symbols

Conversation

@adsharma

@adsharma adsharma commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Enforces hidden visibility for smaller binaries and keeps debug info in Release builds so it can be split into separate symbol files:

  • macOS: dsymutil into a .dSYM bundle + strip -S
  • Windows: native .pdb via /Zi + /DEBUG (plus /OPT:REF,ICF in Release)
  • Linux: objcopy split into _lbug.debug + --add-gnu-debuglink

Tool lookups are non-fatal so unusual toolchains don't hard-fail.

Companion PR in LadybugDB/ladybug wires this into the wheel workflow (split on final repaired wheels + upload symbol artifacts).

Enforce hidden visibility for smaller binaries and keep debug info in
Release builds (-g / /Zi+/DEBUG) so it can be split into separate symbol
files: .dSYM on macOS (dsymutil + strip -S), .pdb on Windows (native),
.debug on Linux (objcopy split + gnu-debuglink).

Wheel builds consume these via split_debug_symbols.py in the main repo.
Wheel builds set -DLBUG_SPLIT_DEBUG_SYMBOLS=OFF via setup.py: raw
.debug/dSYM artifacts packaged inside the wheel break auditwheel
repair, and the split instead happens on the final repaired wheel
(where the debug info must still be present). Local builds keep the
previous split-at-build-time behavior (default ON).
pybind11_add_module() unconditionally attaches a POST_BUILD
${CMAKE_STRIP} step -- plain `strip` on Linux, i.e. --strip-all --
which runs before our own split and destroys both symtab and DWARF.
Wheel builds therefore produced empty ~3KB .debug stubs (macOS was
unaffected: `strip -x` keeps DWARF; Windows: CMAKE_STRIP unset).

Stripping is now owned solely by the LBUG_SPLIT_DEBUG_SYMBOLS pipeline
(in-build objcopy split, or host-side split_debug_symbols.py for
wheels), both of which preserve .symtab so addresses stay mappable to
function names.
@adsharma
adsharma merged commit 0176c78 into main Sep 7, 2026
2 checks passed
@adsharma
adsharma deleted the split-debug-symbols branch September 7, 2026 04:25
adsharma added a commit to LadybugDB/ladybug that referenced this pull request Sep 7, 2026
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).
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.

1 participant