Skip to content

feat(cli): #242 fbuild ci — PlatformIO-compatible alias for compile-many#248

Merged
zackees merged 1 commit into
mainfrom
feat/242-fbuild-ci-alias
May 13, 2026
Merged

feat(cli): #242 fbuild ci — PlatformIO-compatible alias for compile-many#248
zackees merged 1 commit into
mainfrom
feat/242-fbuild-ci-alias

Conversation

@zackees
Copy link
Copy Markdown
Member

@zackees zackees commented May 13, 2026

Summary

Adds fbuild ci as a drop-in replacement for pio ci. The new subcommand delegates to the two-stage compile-many primitive (#241) and exposes the PlatformIO-compatible flag surface so existing CI workflows can swap s/pio ci/fbuild ci/ without other changes.

Flag mapping

fbuild ci flag pio ci equivalent Behavior
--board <b> / -b <b> --board / -b Required. Board id (e.g. uno, teensy41).
--lib <path> / -l <path> (repeatable) --lib / -l Mapped to PLATFORMIO_LIB_EXTRA_DIRS; joined with ; on Windows, : elsewhere.
--project-conf <path> / -c <path> --project-conf / -c Mapped to PLATFORMIO_PROJECT_CONFIG. Canonicalized when possible, otherwise passed through as-given.
--keep-build-dir --keep-build-dir Accepted for compatibility; no-op (fbuild always keeps build dirs under .fbuild/build/...).
--build-dir <path> --build-dir Accepted for compatibility; emits a warning and falls back to the default location (not yet honored).
--framework-jobs / --sketch-jobs / --quick / --release / -v n/a fbuild-native; same semantics as compile-many.
positional sketches positional .ino files are rewritten to their parent dir; project dirs pass through unchanged.

How it threads through

CompileManyRequest gains a pio_env: HashMap<String, String> overlay that propagates into every per-sketch BuildParams.pio_env, so --lib / --project-conf reach the platform orchestrators via the existing PLATFORMIO_* env-var contract that fbuild-config already handles.

Both fbuild ci and fbuild compile-many remain exposed and share the underlying handler.

Stack-overflow fix

The new Ci enum variant pushes clap's --help formatting past Windows' 1 MB default main-thread stack on debug builds (would crash with STATUS_STACK_OVERFLOW before parse_from returns). main() now trampolines through an 8 MB std::thread, restoring --help on debug Windows and not regressing release builds.

Test plan

  • uv run soldr cargo check --workspace --all-targets passes
  • uv run soldr cargo clippy --workspace --all-targets -- -D warnings passes
  • uv run soldr cargo fmt --all -- --check clean
  • uv run soldr cargo test -p fbuild-cli — 11 new inline ci_tests (path normalization, env-var building, clap round-trip, short flag, required-arg + mutual-exclusion rejection) plus 3 spawn-the-binary integration tests (ci_help_lists_pio_compat_flags, ci_without_board_is_a_usage_error, ci_without_sketches_is_a_usage_error) all pass
  • uv run soldr cargo test -p fbuild-build --test compile_many_two_stage still green
  • Manual: fbuild ci --help renders on debug + release Windows builds
  • Manual end-to-end build of a FastLED-style library on uno to confirm --lib / --project-conf plumbing — covered by follow-up consumer in ci: switch ./compile to fbuild compile-many for faster example builds on CI FastLED#2470

Closes #242.

…many

Adds `fbuild ci` as a drop-in replacement for `pio ci`. The new subcommand
delegates to the two-stage `compile-many` primitive (#241) and exposes the
PIO-compatible flag surface so existing CI workflows can swap
`s/pio ci/fbuild ci/` without other changes.

Flag mapping:
- --board / -b               -> required, matches pio ci
- --lib / -l (repeatable)    -> PLATFORMIO_LIB_EXTRA_DIRS (';' on Windows, ':' elsewhere)
- --project-conf / -c        -> PLATFORMIO_PROJECT_CONFIG (canonicalized when possible)
- --keep-build-dir           -> accepted for compat (no-op; fbuild always keeps build dirs)
- --build-dir <path>         -> accepted for compat (warns; not yet honored)
- positional sketches        -> .ino files are rewritten to their parent dir

CompileManyRequest gains a `pio_env: HashMap<String,String>` overlay that
threads through every per-sketch BuildParams, so --lib / --project-conf
reach the platform orchestrators via the existing PLATFORMIO_* contract.

Also fixes a Windows-debug stack overflow in clap's --help rendering: the
extra subcommand pushes past the OS main thread's 1 MB default, so main()
now trampolines through an 8 MB std::thread for clap's parse path.

Closes #242.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Warning

Rate limit exceeded

@zackees has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 11 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 90f63b7f-3829-4c26-8686-60b445d35216

📥 Commits

Reviewing files that changed from the base of the PR and between 9004dfc and d672484.

📒 Files selected for processing (6)
  • crates/fbuild-build/src/compile_many.rs
  • crates/fbuild-build/tests/compile_many_two_stage.rs
  • crates/fbuild-cli/README.md
  • crates/fbuild-cli/src/main.rs
  • crates/fbuild-cli/tests/README.md
  • crates/fbuild-cli/tests/ci_command.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/242-fbuild-ci-alias

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 cdb986a into main May 13, 2026
79 of 81 checks 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.

feat(cli): normalize compile-many under a PlatformIO-compatible fbuild ci command

1 participant