Skip to content

CI: compile-check the webp helper bins - #3

Merged
walles merged 3 commits into
mainfrom
ci-compile-check-webp-bins
Jul 22, 2026
Merged

CI: compile-check the webp helper bins#3
walles merged 3 commits into
mainfrom
ci-compile-check-webp-bins

Conversation

@walles

@walles walles commented Jul 22, 2026

Copy link
Copy Markdown
Owner

The screenshot and stillimage helper bins are gated behind the off-by-default webp feature (which links the system libwebp), so plain cargo build/cargo test no longer compile them at all — previously they compiled in CI only by luck, because GitHub's Ubuntu image happens to ship libwebp.

This installs libwebp-dev on the runner and builds with --all-targets --all-features so CI compile-checks everything: the lib, both helper bins, tests, and benches. --all-features (rather than --features webp) stays correct if more features are added later.

Trade-off: the apt step is now a hard dependency, so CI fails at install if the package mirror hiccups — the intended cost of declaring the libwebp dependency instead of relying on the preinstalled image.

🤖 Generated with Claude Code (Opus 4.8)

walles added 3 commits July 22, 2026 08:12
libwebp-sys2 was a hard dependency of the whole crate, but only the screenshot
and stillimage helper bins use it. That forced `cargo test` and `cargo bench`
to link the system libwebp for no reason.

Make it optional behind an off-by-default `webp` feature and gate those two
bins on it. Ordinary builds, tests, and benchmarks now build without libwebp
installed; generate the screenshot with `cargo run --features webp --bin
screenshot`.
The old text claimed cost was dominated by per-frame rendering. Sampling the
running app showed it is >99% idle between frames, so frame count is the
first-order battery lever. Of the per-frame on-CPU work, ~83% is the Rust
renderer, ~15% the setImage handoff, and CGImage construction is negligible.

Split the section by tool (Criterion for the renderer in isolation, `sample`
for on-CPU hotspots, powermetrics for energy and wakeups), and note the traps
each has: `sample` undercounts blocking IPC, and the WindowServer cost of
compositing our icon is charged to its process, not ours.
The screenshot and stillimage helper bins are gated behind the
off-by-default `webp` feature, so plain `cargo build`/`cargo test` no
longer compile them at all. Install libwebp-dev on the runner and build
with `--all-targets --all-features` so CI compile-checks everything: the
lib, both helper bins, tests, and benches.
@walles
walles merged commit 272efca into main Jul 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant