From fc793f140fe0c6685ecd3869d7a0ba9078dac4e4 Mon Sep 17 00:00:00 2001 From: Chemaclass Date: Mon, 10 Aug 2026 21:04:49 +0200 Subject: [PATCH] fix(build): raise the standalone binary budget to 544 KiB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit main is red: the artifact is 513422 bytes against a 512000 limit, crossed by ordinary feature growth (#1037 was merged while this check was failing, and every PR opened since inherits the red). Contrary to the issue's first guess, CI does run this check — build.yml installs shfmt and both runners ship jq — so the gate worked and was merged past. The gate is fine; the number was stale. Raising rather than shrinking, because the alternatives are worse: stripping blank lines saves 3244 bytes (still over) and is unsafe, since a blank line inside a heredoc is content — the hazard #990 already had to handle; and shfmt --minify reaches the old line only by stripping all indentation out of the shipped artifact. The reasoning and the measurements are recorded next to the assertion so the next raise is a decision rather than a silencing. Closes #1045 --- CHANGELOG.md | 1 + tests/unit/project/build_test.sh | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcc6c095..4540b7e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - Performance: `--coverage` is about 1.6x to 2.3x faster. Executable-line classification no longer forks `grep` per source line, which was roughly half of a coverage run's wall time and affected both engines equally (#1005) ### Fixed +- Build: the standalone binary size budget is 544 KiB, raised from 500 KiB after ordinary feature growth crossed it; the artifact keeps its indentation rather than being minified (#1045) - `assert_within_delta` rejects malformed numbers such as `1.2.3` or `5-3` as non-numeric instead of leaking a raw `bc` parse error or silently evaluating them as an expression (#1026) - Report formats are no longer empty under `--parallel`. `--report-junit`, `--report-tap`, `--report-json`, `--report-html` and `--log-junit` all recorded zero tests, because the rows were collected inside the per-test worker and nothing rebuilt them in the parent (#1004) diff --git a/tests/unit/project/build_test.sh b/tests/unit/project/build_test.sh index 0ebaacc9..c7cd4af7 100644 --- a/tests/unit/project/build_test.sh +++ b/tests/unit/project/build_test.sh @@ -321,7 +321,21 @@ function test_built_binary_contains_no_source_lines() { assert_equals "0" "$(grep -c '^source ' "$build_dir/bashunit")" } -function test_built_binary_stays_below_500_kib() { +# The budget is a guard against the artifact growing without anyone noticing, +# not a hard product limit. It was raised from 512000 to 557056 (544 KiB) in +# #1045, after a run of features crossed the old line by 0.3%: the alternatives +# to raising it were both worse. +# +# as-is 518493 bytes over +# strip blank lines 515249 bytes still over — and unsafe, because a blank +# line inside a heredoc is content (#990) +# shfmt --minify 471673 bytes reaches it, by stripping every bit of +# indentation out of the shipped artifact +# +# So: keep the artifact readable and move the line, with headroom for a few more +# features. Raise it deliberately and record the number again when it is hit — +# do not silence it. +function test_built_binary_stays_below_544_kib() { if ! build_optimizer_is_available; then bashunit::skip "shfmt and jq are required for standalone optimization" return @@ -334,7 +348,7 @@ function test_built_binary_stays_below_500_kib() { local bytes bytes=$(wc -c <"$build_dir/bashunit" | tr -d ' ') - assert_less_or_equal_than 512000 "$bytes" + assert_less_or_equal_than 557056 "$bytes" } function test_build_assert_valid_syntax_rejects_broken_file() {