Repository navigation
Conversation
bgw
force-pushed
the
bgw/no-unwind-tables
branch
from
November 20, 2026 00:05
68a485a to
eda153c
Compare
Workers abort on panic, and their symbols are stripped, so their unwind tables (`.eh_frame`) can't be used for unwinding or useful backtraces. Release builds now disable them on Linux and macOS, for Rust (`-C force-unwind-tables=no`) and for libwebp and mozjpeg (`CFLAGS_<target>`). On aarch64-unknown-linux-gnu, the worker shrinks from 5,389,384 to 5,258,312 bytes (-128 KiB, -2.4%), or from 5,324,984 to 5,232,944 bytes (-90 KiB, -1.7%) without the padding between its 64 KiB-aligned segments. std is prebuilt, so its tables (about 150 KiB) stay. On macOS, rustc already omits them with `panic = "abort"`, so only the C libraries change (not measured). Windows requires unwind tables, and wasm doesn't have them. The flags are in `.cargo/worker-release.toml`, which `scripts/build-native.mjs` (CI) and `pnpm build:release` pass with `--config`. They aren't in `.cargo/config.toml`, because tests unwind. `[env]` can't be conditional on the target (rust-lang/cargo#10273), so it lists a `CFLAGS_<target>` for every Linux and macOS target in `scripts/platforms.mjs`. `pnpm build:release` doesn't pass `--target`, so there the flags also apply to build scripts and proc macros, which only changes how they fail if they panic. rav1d's `RUSTC_BOOTSTRAP=rav1d` (for riscv) moves from the script to `.cargo/config.toml`'s `[env]`, so that any riscv build works. Co-Authored-By: Claude <noreply@anthropic.com>
bgw
force-pushed
the
bgw/no-unwind-tables
branch
from
November 20, 2026 02:53
eda153c to
442a52e
Compare
bgw
marked this pull request as ready for review
November 20, 2026 03:03
This branch has not been deployed
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.
Workers abort on panic, and their symbols are stripped, so their unwind
tables (
.eh_frame) can't be used for unwinding or useful backtraces.scripts/build-native.mjsnow disables them on Linux, for Rust(
-C force-unwind-tables=no) and for libwebp and mozjpeg(
CFLAGS_<target>). On aarch64-unknown-linux-gnu, the worker shrinksfrom 5,389,384 to 5,258,312 bytes (-128 KiB, -2.4%), or from 5,324,984
to 5,232,944 bytes (-90 KiB, -1.7%) without the padding between its
64 KiB-aligned segments. std is prebuilt, so its tables (about
150 KiB) stay.
Windows requires unwind tables, and macOS isn't measured, so they're
unchanged.
pnpm build:releasenow runs the same script for the host, so thatpnpm test:releaseand the benchmark use CI's flags. The script alwayspasses
--target, so that the flags don't apply to build scripts andproc macros, and copies the worker to
target/release.Co-Authored-By: Claude noreply@anthropic.com
Stack created with GitHub Stacks CLI • Give Feedback 💬