fix(makefile): repair make slimest on current nightly - #2371
Closed
ArthurZucker wants to merge 1 commit into
Closed
ArthurZucker wants to merge 1 commit into
ArthurZucker wants to merge 1 commit into
Conversation
`panic_immediate_abort` is no longer a `-Z build-std-features` value. It is a
real panic strategy now, and the old spelling is a hard error:
error: panic_immediate_abort is now a real panic strategy! Enable it with
`panic = "immediate-abort"` in Cargo.toml, or with the compiler flags
`-Zunstable-options -Cpanic=immediate-abort`.
So `make slimest` only built on a nightly older than the rename. Pass the
strategy as a codegen flag through RUSTFLAGS instead.
Deliberately not `panic = "immediate-abort"` in `[profile.slimest]`: a profile
value stable cargo cannot parse would break every cargo command in the
workspace (`make build`, `make test`, `cargo metadata`, CI on stable), not
just this target.
Also makes the toolchain overridable (`NIGHTLY ?= nightly`), since the failure
this guards against is a stale default alias rather than a missing one.
BPE-only gzipped size (`--no-default-features --features bpe,deserialize`,
aarch64-apple-darwin):
slim minsize, stable 332,799 B
slimest old flag, nightly 1.89 201,047 B
slimest this change 190,690 B -42.7% vs slim
The extra 10,357 B over the old flag path is the newer compiler, not the flag.
Collaborator
Author
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.
Stacked on #2119 (
feat/train_encode_split), which is wheremake slimestlives —mainhas no such target, hence the base.The bug
make slimestdoes not build on a current nightly:panic_immediate_abortstopped being a-Z build-std-featuresvalue and became a real panic strategy. The target only worked on a nightly predating the rename, so whethermake slimestbuilds depended on how stale yournightlyalias happened to be.The fix
-Z build-std-features=panic_immediate_abort.RUSTFLAGS="-Zunstable-options -Cpanic=immediate-abort", applied inline on theslimestrecipe only.NIGHTLY ?= nightlyso a stale default alias can be bypassed without editing the Makefile (make slimest NIGHTLY=nightly-2026-04-28), and so CI can pin.Deliberately not
panic = "immediate-abort"in[profile.slimest], which the error message also offers: a profile value stable cargo cannot parse would break every cargo command in the workspace —make build,make test,cargo metadata, CI on stable — not just this one target. The tradeoff is that the recipe replaces any ambientRUSTFLAGS; that is noted in the comment.Size
BPE-only,
tk-serialize --example binsize_pipeline,--no-default-features --features bpe,deserialize, aarch64-apple-darwin:slim(minsize)slim(minsize)--profile slimest, no-Zslimest, old flagslimest, this change−42.7% gzipped vs
slim(332,799 → 190,690). The 10,357 B improvement over the old flag path is the newer compiler, not the flag change.Two things the numbers settle, since both have caused misreadings before:
build-std+immediate-abort, so the nightly requirement is unavoidable rather than incidental. (An earlier apparent "+4.6% on nightly" was purely a 13-month-old nightly, not nightly.)--profile slimestwithout the-Zflags isminsizeunder a different directory name.Verification
make slimest-size NIGHTLY=nightly-2026-04-28→slimest tk-encode: 190690 bytes gzipped, rc=0.panicked at,backtrace,RUST_BACKTRACE(vs 2/12/3 inslim), so the panic strategy really applied rather than silently no-opping.make -n slim-sizeemits a byte-identical command to before; that target is untouched.Note for anyone building this:
rustup update nightlyifmake slimestfails on the panic strategy. Verified good on 1.97.0-nightly (2026-04-27); 1.89.0-nightly (2025-06-22) is too old. I did not add version detection to support both spellings — two code paths to keep a 13-month-old nightly working seemed worse than one clear error plus the comment, but happy to add it if you disagree.