Skip to content

feat(build): retire MockEnv extra_scripts shim (#553 step 4) - #585

Merged
zackees merged 1 commit into
mainfrom
feat/retire-mockenv-553-step4
Jun 14, 2026
Merged

zackees merged 1 commit into
mainfrom
feat/retire-mockenv-553-step4

Conversation

@zackees

@zackees zackees commented Jun 14, 2026

Copy link
Copy Markdown
Member

Summary

Step 4 of the #553 retirement plan. lite-SCons is now the sole extra_scripts backend.

Closes #584

Removed

  • crates/fbuild-build/src/script_runtime_harness.py — the MockEnv shim, 434 LOC of Python.
  • The HARNESS-vs-LITE_HARNESS dispatch and the FBUILD_LITE_SCONS env var read (use_lite_scons function gone).
  • The resolve_extra_script_overlay_with_mode public overload — callers used it to pin the backend during the migration window. The single resolve_extra_script_overlay entry point is now the whole API.
  • Five MockEnv-only tests that asserted on hard-fail semantics the lite backend deliberately diverges from:
  • use_lite_scons_default_and_opt_out_vocabulary test — the env var contract it locks down no longer exists.

Updated

  • crates/fbuild-build/src/script_runtime.rs module docstring — single-backend reality, preserves a one-paragraph history note about the staged retirement so future readers can follow the trail back to feat(build): opt-in lite-SCons extra_scripts harness (#553) #581/feat(build): default extra_scripts backend to lite-SCons (#553 step 3) #583/lite-SCons step 4: retire MockEnv shim (#553) #584.
  • crates/fbuild-build/README.md "Native extra_scripts Boundary" section — flat "what's supported" list, no more lite-vs-MockEnv table. Keeps the three architectural boundaries (real DAG, scanner-driven dep discovery, PlatformIO chip-family builders) that still fall through to --platformio.
  • crates/fbuild-build/src/flag_overlay.rs doc on BuildOverlay.lite_scons_records — the Option wrapper now reflects "populated whenever a script ran" rather than the legacy "only when FBUILD_LITE_SCONS=1".
  • crates/fbuild-build/tests/lite_scons_acceptance.rs — drops the _with_mode(..., true) call site for the simpler single entry point. All 5 acceptance tests still cover the same five Feasibility: real SCons engine for extra_scripts beyond the native flag-mutation shim #553 spike patterns.
  • lite_scons_harness.py BoardConfig.get() — prefer flat-dict lookup (matching the Rust side's contract that hands us {"build.mcu": "..."} not nested {"build": {"mcu": "..."}}). Fixed a regression caught by the now-passing test_resolve_extra_script_overlay_supports_board_config_shim.
  • test_shim_medium_nonflag_scope_recorded_not_rejected (renamed to _does_not_reject) — dropped its MockEnv-specific notes assertion. The surviving assertion (LFS_OK define lands, script doesn't fail) is the test's real point.

Verification

  • soldr cargo check --workspace --all-targets — clean
  • soldr cargo clippy -p fbuild-build --all-targets — clean
  • soldr cargo test -p fbuild-build --lib — 699/699 pass
  • soldr cargo test -p fbuild-build --test lite_scons_acceptance — 5/5 pass
  • grep FBUILD_LITE_SCONS crates/ — two historical references in doc comments only; no runtime code reads the env var.

Closes #584
Refs #553

Step 4 of the #553 retirement plan: lite-SCons is now the
sole extra_scripts backend. Closes #584.

Removed
=======
- crates/fbuild-build/src/script_runtime_harness.py — the MockEnv shim,
  434 LOC of Python.
- The HARNESS-vs-LITE_HARNESS dispatch and the FBUILD_LITE_SCONS env var
  read (use_lite_scons function gone).
- The resolve_extra_script_overlay_with_mode public overload that
  callers used to pin the backend during the migration window. The
  single resolve_extra_script_overlay entry point is now the whole API.
- Five MockEnv-only tests that asserted on hard-fail semantics the lite
  backend deliberately diverges from:
    * test_resolve_extra_script_overlay_rejects_unsupported_import_name
      — lite-SCons silently ignores Import("foo"); not a hard-fail.
    * test_resolve_extra_script_overlay_rejects_projenv_in_pre_script
      — lite-SCons uses unified env; projenv works in PRE scripts too.
    * test_resolve_extra_script_overlay_rejects_unsupported_scope_mutation
      — lite-SCons stores unknown scopes in _vars permissively.
    * test_shim_complex_execute_verbose_action_is_noop
      — lite-SCons actually runs Execute (#553 spike result).
    * test_shim_complex_sconscript_bails
      — lite-SCons recursively evals SConscript (#553 spike result).
- use_lite_scons_default_and_opt_out_vocabulary test — the env var
  contract it locks down no longer exists.

Updated
=======
- crates/fbuild-build/src/script_runtime.rs module docstring rewritten
  for the single-backend reality; preserves a one-paragraph history
  note about the staged retirement so future readers can follow the
  trail back to #581/#583/#584.
- crates/fbuild-build/README.md "Native extra_scripts Boundary"
  section rewritten with a flat "what's supported" list (no more
  lite-vs-MockEnv table), keeping the three architectural boundaries
  (real DAG, scanner-driven dep discovery, PlatformIO chip-family
  builders) that still fall through to --platformio.
- crates/fbuild-build/src/flag_overlay.rs doc on
  BuildOverlay.lite_scons_records updated — the Option wrapper now
  reflects "populated whenever a script ran" rather than the legacy
  "only when FBUILD_LITE_SCONS=1".
- crates/fbuild-build/tests/lite_scons_acceptance.rs — drops the
  _with_mode(..., true) call site for the simpler single entry point.
  All 5 acceptance tests still cover the same five #553 spike patterns.
- crates/fbuild-build/src/lite_scons_harness.py BoardConfig.get() —
  prefer flat-dict lookup (matching the Rust side's contract that
  hands us {"build.mcu": "..."} not nested {"build": {"mcu": "..."}}).
  Fixed a regression caught by the now-passing
  test_resolve_extra_script_overlay_supports_board_config_shim.
- test_shim_medium_nonflag_scope_recorded_not_rejected dropped its
  MockEnv-specific notes assertion; the surviving assertion (LFS_OK
  define lands, script doesn't fail) is the test's real point.

Verification
============
- soldr cargo check --workspace --all-targets — clean
- soldr cargo clippy -p fbuild-build --all-targets — clean
- soldr cargo test -p fbuild-build --lib — 699/699 pass
- soldr cargo test -p fbuild-build --test lite_scons_acceptance — 5/5 pass
- grep FBUILD_LITE_SCONS crates/ — two historical references in
  doc comments only; no runtime code reads the env var.

Closes #584
Refs #553

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@zackees, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 3 minutes and 20 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2af433ed-81e2-4176-96a2-f70b997b0d45

📥 Commits

Reviewing files that changed from the base of the PR and between 849b630 and b9cb8e9.

📒 Files selected for processing (7)
  • crates/fbuild-build/README.md
  • crates/fbuild-build/src/flag_overlay.rs
  • crates/fbuild-build/src/lite_scons_harness.py
  • crates/fbuild-build/src/script_runtime.rs
  • crates/fbuild-build/src/script_runtime_harness.py
  • crates/fbuild-build/src/script_runtime_tests.rs
  • crates/fbuild-build/tests/lite_scons_acceptance.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/retire-mockenv-553-step4

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 db2a764 into main Jun 14, 2026
89 of 91 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jun 15, 2026
@zackees
zackees deleted the feat/retire-mockenv-553-step4 branch October 16, 2026 11:19
Sign up for free to 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.

lite-SCons step 4: retire MockEnv shim (#553)

1 participant