fix: make strip failure non-fatal for cross-compilation#21
Merged
Conversation
The run() helper calls process.exit() on numeric error codes, which
bypasses the try/catch around the strip call. When cross-compiling
(e.g., ARM64 binary on x86_64 host), strip fails with exit code 1
('Unable to recognise the format'), killing the entire fossilize
process instead of continuing with an unstripped binary.
Fix: use execFileAsync directly instead of run() so the error is
properly caught and treated as non-fatal.
BYK
added a commit
to getsentry/cli
that referenced
this pull request
May 29, 2026
Updates fossilize to 0.8.1 which fixes a bug where `strip` failure on cross-compiled binaries (e.g., linux-arm64 on x86_64 host) called `process.exit()` instead of falling through as non-fatal. This was a pre-existing issue that predates #1037 — the `run()` helper in fossilize has always called `process.exit()` for numeric error codes, bypassing the try/catch. The fix uses `execFileAsync` directly so the error is properly caught and treated as non-fatal (prints a warning and continues with an unstripped binary). Upstream: [BYK/fossilize#21](BYK/fossilize#21)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Cross-compiling (e.g., linux-arm64 on x86_64 host) crashes fossilize because
stripfails with exit code 1 ("Unable to recognise the format of the input file") and therun()helper callsprocess.exit(1)for numeric error codes — bypassing the try/catch that was supposed to make it non-fatal.Root cause
run()(line 44) has two failure paths:process.exit(code)(kills the process, uncatchable)throw new Error(...)(caught by try/catch)stripreturns exit code 1, soprocess.exit(1)fires. The catch block on line 248 ("Warning: strip failed... (non-fatal)") never executes.Fix
Replace
run()withexecFileAsyncdirectly for the strip call. The error is now properly caught, a warning is printed, and fossilize continues with an unstripped binary.This was always the intended behavior (the comment says "Non-fatal: may fail when cross-stripping") — it just never worked because of the
process.exit()escape hatch inrun().