Repository navigation
chore: make the binary-size check measure the pull request's own code - #1501
Conversation
tasks/size.sh builds the merge base and the head into one target directory. Cargo names workspace crates' artifacts by path relative to the workspace root, so the base worktree's freshly built usage-lib looked up to date to the head build, which then linked the base's code. Every report came out +0 bytes, and #1498 failed to compile once its head no longer built against the base's library. Workspace crates are now cleaned before each build; crates.io dependencies stay shared. The gate itself is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe size comparison build now identifies workspace packages with ChangesSize comparison
Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The size comparison cleans workspace release artifacts before each checkout’s build, helping prevent stale artifacts from skewing results. No concrete merge-blocking risk is established; the PR is ready for normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
`cargo clean -p` resolves the workspace and could update a lockfile that no longer matches the manifests, so the build that follows would measure dependencies the pull request never pinned. Both it and `cargo metadata` now run with --locked, like the build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Instruction counts
No instruction-count regression above 1%. Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run. Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes. Shadow comparisonParsing
|
<!-- entire-trail-link-start --> https://entire.io/gh/jdx/usage/trails/33 <!-- entire-trail-link-end --> ### 🚀 Features - **(cli)** publish a usage agent skill with packslip by [@jdx](https://github.com/jdx) in [#1509](#1509) - **(complete)** complete a wrapped command's arguments with its own shell completion via delegate= by [@jdx](https://github.com/jdx) in [#1498](#1498) - **(lib)** add getters that read FlagMeta, CommandMeta and ArgMeta fields wherever they live by [@jdx](https://github.com/jdx) in [#1491](#1491) - **(lib)** export the chosen subcommand to scripts as usage_cmd by [@jdx](https://github.com/jdx) in [#1505](#1505) - **(spec)** let a complete node sit inside the arg it completes by [@jdx](https://github.com/jdx) in [#1496](#1496) - **(spec)** list an arg's possible values from a command with `choices run=` by [@jdx](https://github.com/jdx) in [#1497](#1497) ### 🐛 Bug Fixes - **(bash)** complete `--flag=` values when the cursor sits after `=` by [@jdx](https://github.com/jdx) in [#1499](#1499) - **(cli)** run scripts passed to usage bash through a pipe or process substitution by [@jdx](https://github.com/jdx) in [#1494](#1494) - **(cli)** keep usage explain from running a spec's choices run= commands by [@jdx](https://github.com/jdx) in [#1503](#1503) - **(complete)** read --line=LINE in completion requests from typed completers by [@jdx](https://github.com/jdx) in [#1487](#1487) - **(complete)** show completion parse errors without garbling the prompt by [@jdx](https://github.com/jdx) in [#1495](#1495) - **(derive)** ignore closed pipes instead of panicking in generated parse() by [@jdx](https://github.com/jdx) in [#1484](#1484) - **(derive)** keep generated async dispatch from reserving stack for every command by [@jdx](https://github.com/jdx) in [#1488](#1488) - **(fish)** complete words the user has started quoting by [@jdx](https://github.com/jdx) in [#1500](#1500) - **(lib)** resolve inherited usage aliases after multiline workspace entries by [@jdx](https://github.com/jdx) in [#1507](#1507) - **(lib)** make published usage-rs tests self-contained by [@jdx](https://github.com/jdx) in [#1510](#1510) - **(zsh)** stop the completion-init handler from breaking file completion for other commands by [@jdx](https://github.com/jdx) in [#1493](#1493) ### 📚 Documentation - **(cli)** describe fig output as the legacy Fig format by [@jdx](https://github.com/jdx) in [2a1bef6](2a1bef6) - clarify CLI frameworks and generators on the homepage by [@jdx](https://github.com/jdx) in [#1482](#1482) ### 🛡️ Security - remove Entire trail runners by [@jdx](https://github.com/jdx) in [#1485](#1485) ### 🔍 Other Changes - float jdx tools and aube on latest without a release-age delay by [@jdx](https://github.com/jdx) in [#1486](#1486) - run cargo-semver-checks on every published crate by [@jdx](https://github.com/jdx) in [#1490](#1490) - fail pull requests that grow the usage CLI or a derived CLI by more than 1% by [@jdx](https://github.com/jdx) in [#1492](#1492) - make the binary-size check measure the pull request's own code by [@jdx](https://github.com/jdx) in [#1501](#1501) ### 📦️ Dependency Updates - bump jdx/renovate-config workflows to c736149 by [@jdx](https://github.com/jdx) in [06f2f1b](06f2f1b) - bump jdx/renovate-config workflows to aa49efc by [@jdx](https://github.com/jdx) in [9aaedef](9aaedef) - bump jdx/renovate-config workflows to 5b46432 by [@jdx](https://github.com/jdx) in [36f8681](36f8681) - pin jdx/renovate-config workflows to v1.0.0 by [@jdx](https://github.com/jdx) in [a31ae2f](a31ae2f) - update communique to 1.4.2 in mise.lock by [@jdx](https://github.com/jdx) in [805396f](805396f) - upgrade locked mise tools by [@jdx](https://github.com/jdx) in [d8b761d](d8b761d) - update jdx/packslip action to v1.4.0 by [@jdx](https://github.com/jdx) in [#1508](#1508)
https://entire.io/gh/jdx/usage/trails/50
The
sizecheck has not been measuring pull requests. Every recent report shows exactly +0 bytes on every binary, including #1497, which adds a lot of code tousage-liband the CLI. #1498 then failed the check with a compile error that its own build doesn't have (no field delegate on type SpecComplete).Cause.
tasks/size.shbuilds the merge base (in a worktree) and the head into one target directory, so crates.io dependencies compile once. But Cargo names a workspace crate's artifacts by its path relative to the workspace root, so both checkouts produce the same artifact names. After the base build, the head build found a freshusage-libunder the same name and reused it. The head binary was therefore built from the base's library code. That explains the +0s, and the #1498 failure: itsusage-clirebuilt (it adds alibcdependency) against the base'susage-lib, which has nodelegatefield. The same reuse can happen across CI runs through the rust-cache'd target directory, and locally across branches.Fix. Before each build, the script now runs
cargo clean --release -p <member>for every workspace member, taken fromcargo metadata --no-deps. Each side's workspace crates always build from that side's source, and crates.io dependencies stay shared and cached. The 1% gate, the binaries measured and what is gated are unchanged.Validation. Run locally against the two open pull requests, reusing one target directory across both runs on purpose, since reuse is what broke:
usageCLIf4d08fea91; +31,808 B (+0.28%) after1e065f682cdropped an mpsc channelBefore this change, the #1497 run in that setup failed to compile the same way #1498 did in CI. Both pull requests are under the gate. The derived CLI doesn't move because neither touches the derive or argv runtime.
🤖 Generated with Claude Code
Note
Low Risk
Touches only the
tasks/size.shCI script; no runtime, auth, or application code paths.Overview
Fixes the binary-size CI check so head and base builds are compared against their own workspace crate artifacts instead of silently reusing each other’s from a shared
CARGO_TARGET_DIR.In
tasks/size.sh,build()now discovers workspace members withcargo metadata --no-depsand runscargo clean --releasefor each member beforecargo build, while still sharing the target directory for crates.io deps. Comments are updated to document why the clean is required (identical artifact paths across the base worktree and the PR checkout caused +0 byte deltas and wrong linkages, e.g. head CLI against baseusage-lib).The 1% gate, measured binaries, and gating rules are unchanged—only measurement correctness.
Reviewed by Cursor Bugbot for commit aba852a. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit