Skip to content

fix(build): the standalone binary is over its 500 KiB budget on main, and CI does not catch it #1045

Description

@Chemaclass

Problem

tests/unit/project/build_test.sh::test_built_binary_stays_below_500_kib fails on a clean main:

Expected '513422'
to be less or equal than '512000'

Measured on main at 5e5c803, with no working-tree changes:

git stash -u && bash build.sh bin && wc -c < bin/bashunit
# 513422   (501 KiB)

Why nobody noticed

The test opens with:

if ! build_optimizer_is_available; then
  bashunit::skip "shfmt and jq are required for standalone optimization"
  return
fi

CI images do not have both shfmt and jq, so the test skips there and only ever runs on a contributor's machine. A budget that is enforced nowhere the merge gate can see is not enforced. That is how the recent run of merges (#1037#1042) crossed it without a single red check.

Two separate things to fix

  1. Get back under budget — or move the budget deliberately, with the new number written down. 501 KiB against a 500 KiB limit is a 0.3% overshoot, so this is a decision about where the line belongs, not an emergency.
  2. Make the gate real. Either install shfmt + jq in the workflow that runs this test, or assert the unoptimised size (which needs neither) so the check cannot silently skip. A skipped budget test is worse than no budget test, because it reads as green.

Notes

  • The build.sh comment-stripping from perf(build): strip standalone comments #990 bought ~22%; the growth since is ordinary feature accretion, not a regression in the builder.
  • Not urgent for correctness — the binary works; it is only past a self-imposed size line.

Acceptance criteria

  • ./bashunit tests/unit/project/build_test.sh passes on a clean checkout with shfmt and jq installed
  • The size check runs (not skips) in at least one CI job, so a future overshoot blocks a merge
  • If the budget is raised rather than met, the new number and the reasoning are recorded

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions