feat(cli): #242 fbuild ci — PlatformIO-compatible alias for compile-many#249
feat(cli): #242 fbuild ci — PlatformIO-compatible alias for compile-many#249zackees wants to merge 1 commit into
Conversation
…many Adds `fbuild ci` as a drop-in replacement for `pio ci` that delegates to the two-stage `compile-many` primitive shipped in PR #241. Existing CI workflows can swap `s/pio ci/fbuild ci/` with no other changes. Flag mapping (PIO -> fbuild): - `--board`/`-b` -> required, picks the platform orchestrator - `--lib`/`-l` -> `PLATFORMIO_LIB_EXTRA_DIRS` overlay (';' Windows, ':' elsewhere) - `--project-conf`/`-c` -> `PLATFORMIO_PROJECT_CONFIG` overlay (canonicalized when possible) - `--keep-build-dir` -> accepted, no-op - `--build-dir` -> accepted, prints a warning (not yet honored) - positional sketches -> project dirs OR `.ino` files (parent dir is used) `CompileManyRequest` gains a `pio_env: HashMap<String, String>` that flows through `SketchBuildInputs` into each per-sketch `BuildParams.pio_env`, so the lib/project-conf overrides reach the orchestrator unchanged. Unit tests in `main.rs::ci_tests` cover the helpers (`normalize_ci_sketch_entry`, `normalize_ci_sketches`, `build_ci_pio_env`) plus a clap round-trip; integration tests in `tests/ci_command.rs` assert the required-arg surface via the compiled binary. On `*-pc-windows-msvc` the new subcommand pushed the clap-generated arg parser past the default 1 MiB Windows stack in debug builds. The added `build.rs` reserves 8 MiB for `fbuild.exe` via `/STACK:8388608` so the existing `fbuild lib-select --help` integration test (and the new `ci` ones) don't overflow. Release builds and other targets are unaffected. Closes #242. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis PR implements Changesfbuild ci — PlatformIO-compatible CI command
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
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. Comment |
|
Superseded by #248 which landed an equivalent change closing #242. Both PRs add the same failed to parse platformio.ini: config error: failed to read ci\platformio.ini: The system cannot find the file specified. (os error 2) PlatformIO-compatible alias and thread through . The two diverge only on the Windows-debug clap-help stack-overflow fix: this PR's link-arg approach is arguably cleaner than #248's runtime trampoline, so happy to fold that in as a follow-up if useful. |
Summary
Adds
fbuild cias a drop-in replacement forpio cithat delegates to the two-stagecompile-manyprimitive shipped in PR #241. Existing CI workflows can swaps/pio ci/fbuild ci/without other changes.Closes #242.
Flag mapping
fbuild ciflagpio ciequivalent--board <b>/-b <b>--board/-b--lib <path>/-l <path>(repeatable)--lib/-lPLATFORMIO_LIB_EXTRA_DIRS; ';' separated on Windows, ':' elsewhere.--project-conf <path>/-c <path>--project-conf/-cPLATFORMIO_PROJECT_CONFIG. Canonicalized when possible.--keep-build-dir--keep-build-dir--build-dir <path>--build-dir--framework-jobs/--sketch-jobs/--quick/--release/--verbose(-v)compile-many..inofile (its parent dir is used).Implementation notes
CompileManyRequestgrows apio_env: HashMap<String, String>that threads throughSketchBuildInputsinto each per-sketchBuildParams.pio_env, so the lib/project-conf overrides reach the orchestrator unchanged.normalize_ci_sketch_entry,normalize_ci_sketches,build_ci_pio_env) so they can be unit-tested without spawning a process.crates/fbuild-cli/build.rsreserves an 8 MiB stack forfbuild.exeon*-pc-windows-msvc(default is 1 MiB). The clap-generated arg parser now exceeds the default stack in Windows debug builds when rendering--help; release builds and other targets are unaffected.Test plan
uv run soldr cargo check --workspace --all-targetsuv run soldr cargo clippy --workspace --all-targets -- -D warningsuv run soldr cargo fmt --all -- --checkuv run soldr cargo test -p fbuild-cli(21 unit tests pass, 2 new integration tests pass, 3 pre-existinglib_selecttests still pass)uv run soldr cargo test -p fbuild-build --test compile_many_two_stage(5 tests pass, request struct change is wired through)RUSTDOCFLAGS=-D warnings uv run soldr cargo doc -p fbuild-cli -p fbuild-build --no-depsfbuild ci --helpshows the PIO-compatible flag surface with PIO terminologyfbuild ci --board uno examples/Blink/Blink.inois accepted (.ino-> parent dir)fbuild ciwithout--board/sketches exits non-zero with a clap usage errorfbuild compile-many ...invocation still works (handler signature extended with default-emptypio_env)🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
fbuild cicommand as a drop-in replacement forpio ciwith PlatformIO-compatible flagsDocumentation
compile-manyandcisubcommand usage and examplesChores