-
Couldn't load subscription status.
- Fork 4
Add --strip option to strip debug symbols from outputs
#286
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
Conversation
There was a problem hiding this 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 a --strip option to cmake-rn for removing debug symbols from built Android and Apple native libraries, reducing binary size in production builds.
Key Changes:
- Added
--stripCLI option to enable debug symbol stripping - Implemented platform-specific stripping logic using
strip(Apple) andllvm-strip(Android) - Refactored Android NDK path resolution into reusable helper functions
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/cmake-rn/src/cli.ts | Adds --strip CLI option definition |
| packages/cmake-rn/src/platforms/apple.ts | Implements stripping for Apple platforms using strip -rSTx command |
| packages/cmake-rn/src/platforms/android.ts | Implements stripping for Android using NDK's llvm-strip and refactors NDK path helpers |
| .changeset/great-kings-clean.md | Documents the new feature in the changeset |
| const outputPath = path.join(buildPath, "out"); | ||
| assert( | ||
| fs.existsSync(outputPath), | ||
| `Expected output file in ${outputPath}`, | ||
| ); |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The outputPath variable is computed but never used. The assertion checks for 'out' directory existence, but this appears unrelated to the stripping operation. Either remove this unused code or clarify its purpose if it's meant to validate something about the strip operation.
| const outputPath = path.join(buildPath, "out"); | |
| assert( | |
| fs.existsSync(outputPath), | |
| `Expected output file in ${outputPath}`, | |
| ); |
| const outputPath = path.join(buildPath, "out"); | ||
| assert( | ||
| fs.existsSync(outputPath), | ||
| `Expected output file in ${outputPath}`, |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message says 'Expected output file' but the check is for a directory named 'out'. The message should say 'Expected output directory' to accurately reflect what's being validated.
| `Expected output file in ${outputPath}`, | |
| `Expected output directory at ${outputPath}`, |
ba50b37 to
22952b9
Compare
Merging this PR will:
--stripoption to allow the stripping of debug information from Android and Apple libraries.