Skip to content

feat(repair): options to set strip level and collect debug symbols #620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

taegyunkim
Copy link

@taegyunkim taegyunkim commented Aug 15, 2025

Disclaimer: code changes and below description are generated using Claude Code

Summary

This PR enhances the auditwheel repair command with granular symbol stripping options and debug symbol collection capabilities. The current --strip option only supports all-or-nothing symbol removal. This enhancement provides fine-grained control over which symbols to strip and adds the ability to extract and preserve debug symbols for debugging purposes.

New Features

Enhanced Strip Levels

  • --strip-level option with four levels:
    • none (default): No stripping
    • debug: Remove debug symbols only (strip -g)
    • unneeded: Remove unneeded symbols (strip --strip-unneeded)
    • all: Remove all symbols (strip -s) - equivalent to current --strip

Debug Symbol Collection

  • --collect-debug-symbols: Extract debug symbols before stripping using objcopy --only-keep-debug
  • --debug-symbols-output: Custom output path for debug symbols zip file
  • Creates zip archive with preserved directory structure
  • Automatically adds GNU debuglink to stripped binaries

Command Examples

# Current behavior (still supported with deprecation warning)
auditwheel repair --strip wheel.whl

# New enhanced options
auditwheel repair --strip-level=debug wheel.whl
auditwheel repair --strip-level=debug --collect-debug-symbols wheel.whl
auditwheel repair --strip-level=debug --collect-debug-symbols --debug-symbols-output=debug.zip wheel.whl

Expected Output

Standard repair:
- mywheel-1.0-py3-none-linux_x86_64.whl

With debug symbol collection:
- mywheel-1.0-py3-none-linux_x86_64.whl (stripped wheel)
- mywheel-1.0-py3-none-linux_x86_64_debug_symbols.zip (debug symbols)

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