Skip to content

chore(shrink): scaffold module + owo-colors dep (#494, part of #493) - #495

Merged
zackees merged 1 commit into
mainfrom
shrink/phase-0a-scaffold
Jun 8, 2026
Merged

chore(shrink): scaffold module + owo-colors dep (#494, part of #493)#495
zackees merged 1 commit into
mainfrom
shrink/phase-0a-scaffold

Conversation

@zackees

@zackeeszackees commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary

Phase 0a of the --shrink design (#493). Zero behavior change; sets up the infrastructure so subsequent phases can land without touching lib.rs again.

Closes#494.

Changes

  • Add owo-colors = "4" workspace dep (terminal coloring for the forthcoming --shrink reporting one-liner; auto-disables on non-tty + respects NO_COLOR).
  • Wire owo-colors into fbuild-cli.
  • Create crates/fbuild-build/src/shrink/ with stub mod.rs + README.md documenting the phase plan.

Drive-by: bump uv.lock fbuild entry from 2.2.21 -> 2.2.22 to match the version cut in #490.

Excluded (separate sub-tasks)

Test plan

  • soldr cargo check --workspace --all-targets clean
  • soldr cargo clippy --workspace --all-targets -- -D warnings exits 0
  • CI green

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added foundation for --shrink flag supporting flash-size reduction capabilities
    • Enabled colored terminal output for build reporting (automatically disables on non-TTY environments and respects NO_COLOR variable)
  • Documentation

    • Added comprehensive roadmap for the shrink subsystem detailing planned implementation phases and design approach

Phase 0a of the --shrink design (#493). Zero behavior change; sets up the
infrastructure so subsequent phases can land without touching lib.rs again.
Changes:
- Add owo-colors = "4" workspace dep (terminal coloring for the
forthcoming --shrink reporting one-liner; auto-disables on non-tty
+ respects NO_COLOR).
- Wire owo-colors into fbuild-cli.
- Create crates/fbuild-build/src/shrink/ with stub mod.rs + README.md
documenting the phase plan.
Excluded from this PR (separate sub-tasks):
- #491 firmware.map auto-emit — substantive linker-flag work across all
platform orchestrators, tracked in its own issue.
- The real CLI surface, libc probe, auto-resolver, shadow archive, and
spec-file emission — Phases 1-4 in #493.
Drive-by: bump uv.lock fbuild entry from 2.2.21 -> 2.2.22 to match
the version cut in #490.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitaiBot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0d70fc22-35b8-4158-b4fb-58591a59963c

📥 Commits

Reviewing files that changed from the base of the PR and between 2bee10b and a143f30.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • Cargo.toml
  • crates/fbuild-build/src/lib.rs
  • crates/fbuild-build/src/shrink/README.md
  • crates/fbuild-build/src/shrink/mod.rs
  • crates/fbuild-cli/Cargo.toml

📝 Walkthrough

Walkthrough

This PR scaffolds the Phase 0a foundation for the flash-size reduction subsystem. It creates the shrink module structure with documentation, wires it into fbuild-build's public API, and integrates the owo-colors terminal coloring library into both workspace and fbuild-cli dependencies to support future colored output formatting.

Changes

Phase 0a: Shrink Module Scaffolding

Layer / File(s)Summary
Shrink module structure and API wiring
crates/fbuild-build/src/lib.rs, crates/fbuild-build/src/shrink/mod.rs, crates/fbuild-build/src/shrink/README.md
Adds pub mod shrink; to expose the new module in fbuild-build's public API. Creates shrink/mod.rs with module-level documentation noting no functionality is exposed yet, and shrink/README.md describing the multi-phase implementation roadmap from Phase 0a through Phase 8, including CLI plumbing, toolchain integration, symbol checks, spec emission, platform wiring, and rollout scope.
Terminal color library dependencies
Cargo.toml, crates/fbuild-cli/Cargo.toml
Adds owo-colors = "4" to the root workspace and owo-colors = { workspace = true } to fbuild-cli crate dependencies. Includes inline documentation specifying auto-disable on non-TTY streams and NO_COLOR environment variable support for consistent terminal behavior.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A shrink module rises, all scaffolded with care,
Colors bloom with owo, ready to declare.
Phase 0a complete—the foundation is sound,
Future phases beckon, where real work is found!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately describes the main change: scaffolding a shrink module and adding the owo-colors dependency.
Linked Issues check✅ PassedAll objectives from issue #494 are met: owo-colors added to crates/fbuild-cli with proper auto-disable behavior, shrink module scaffolded with README and mod.rs, and exposed via pub mod in lib.rs.
Out of Scope Changes check✅ PassedAll changes align with issue #494 scope; no firmware.map auto-emit or Phase 1+ logic included; only scaffolding and dependency plumbing present.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch shrink/phase-0a-scaffold

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zackees
zackees merged commit 51f74ad into mainJun 8, 2026
87 checks passed
zackees added a commit that referenced this pull request Jun 8, 2026
… part of #493) (#499)
Phase 1d of the --shrink design (#493). Lands the per-platform shrinker
registry type and the green `auto shrinking: ...` one-liner reporter, both
with empty data so the user-facing behavior stays silent on every platform
until subsequent phases populate the registry.
Public API:
- `fbuild_build::shrink::registry::AutoShrinkEntry { category, symbols }` —
a single shrinker the auto-resolver applies on a given platform. `category`
is the short human-readable name used by the verbose plan; `symbols` is
what the green one-liner enumerates.
- `fbuild_build::shrink::registry::registry_for(Platform) -> &'static [AutoShrinkEntry]`
— per-platform lookup. Returns `&[]` for every platform in Phase 1d;
phases 4-6 populate per-platform as each shrinker (printf-thin,
scanf-thin, stdio FILE strip, ...) lands.
- `fbuild_build::shrink::reporting::print_auto_shrinking_line(out, entries)`
— writes the green one-liner to any `io::Write`. When `entries` is empty,
writes nothing. Uses `owo-colors` (already a workspace dep) which
auto-disables on non-tty and respects `NO_COLOR`.
Tests:
- 2 unit tests in `registry::tests` — every platform empty, struct shape.
- 5 unit tests in `reporting::tests`:
- empty registry prints nothing
- registry with empty symbols prints nothing
- single entry lists its symbols (ANSI stripped)
- multiple entries are concatenated
- output contains ANSI green when color enabled
owo-colors added to fbuild-build's dependencies (was already in the
workspace deps from #495).
All `cargo test -p fbuild-build --lib shrink::` pass (12/12 — 5 from
Phase 1a + 7 new). `clippy --workspace --all-targets -- -D warnings` exits 0.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

Phase 0a: scaffold shrink module + add owo-colors dep

1 participant

@zackees