Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Changelog
## 0.8.1

### Bug Fixes 🐛

- Fix cross-compilation crash: `strip` failure on foreign architectures (e.g., ARM64 binary on x86_64 host) now correctly falls through as non-fatal instead of calling `process.exit()`

## 0.8.0

### New Features ✨
Expand Down
13 changes: 9 additions & 4 deletions src/impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,15 @@ export default async function (
// Windows PE binaries don't ship debug symbols in release builds.
if (!platform.startsWith("win")) {
try {
const stripCmd = platform.startsWith("darwin")
? ["strip", "-x", fossilizedBinary]
: ["strip", "--strip-unneeded", fossilizedBinary];
await run(stripCmd[0]!, ...stripCmd.slice(1));
const stripArgs = platform.startsWith("darwin")
? ["-x", fossilizedBinary]
: ["--strip-unneeded", fossilizedBinary];
// Use execFileAsync directly instead of run() — run() calls
// process.exit() on numeric error codes, bypassing try/catch.
// Cross-stripping (e.g., ARM64 binary on x86_64 host) legitimately
// fails and must be non-fatal.
await execFileAsync("strip", stripArgs, { encoding: "utf8" });
console.log(`> strip ${stripArgs.join(" ")}`);
} catch {
// Non-fatal: may fail when cross-stripping (e.g., macOS Mach-O on Linux)
console.warn(` Warning: strip failed for ${platform} (non-fatal)`);
Expand Down
Loading