Skip to content

chore(ci): add teensy40/41 to fbuild, KeyboardInterrupt in RPG, dedupe pyproject - #2326

Merged
zackees merged 1 commit into
masterfrom
chore/fbuild-teensy-rpg-interrupt-pyproject-dedup
Apr 18, 2026
Merged

zackees merged 1 commit into
masterfrom
chore/fbuild-teensy-rpg-interrupt-pyproject-dedup

Conversation

@zackees

@zackees zackees commented Apr 18, 2026 •

Copy link
Copy Markdown
Member

Summary

  • ci/compiler/fbuild_boards.py: add teensy40/teensy41 to FBUILD_BOARDS (teensy orchestrator already supports Cortex-M7) and refresh the "NOT supported" comments to list actual gaps (STM32, RP2040/RP2350, NRF52, Apollo3, SAM/SAMD, MGM240, esp8266, atmega8a).
  • ci/util/running_process_group.py: catch KeyboardInterrupt in the main wait loop — kill active children, delegate to handle_keyboard_interrupt, then reraise. Replace per-process stop_monitoring cleanup with a single StuckMonitor.shutdown() call.
  • pyproject.toml: remove duplicate running-process>=3.0.7 dep (canonical running-process>=3.0.9 remains at line 45).

Test plan

  • bash lint clean
  • bash fbuild teensy40 --examples Blink succeeds
  • bash fbuild teensy41 --examples Blink succeeds
  • Existing AVR/ESP32 FBUILD_BOARDS still compile
  • Ctrl-C during bash test terminates cleanly without orphaned child processes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for Teensy 4.0 and Teensy 4.1 boards.
  • Bug Fixes

    • Improved keyboard interrupt handling to ensure all child processes are properly terminated when interrupted.
    • Enhanced process group cleanup mechanism for better reliability.

…, dedupe pyproject

- fbuild_boards: add teensy40/teensy41 to FBUILD_BOARDS and update "NOT supported" comments to reflect current orchestrator coverage (STM32, RP2040, NRF52, etc. still on PlatformIO).
- running_process_group: catch KeyboardInterrupt in the main wait loop, kill active child processes, and delegate to handle_keyboard_interrupt before reraising. Replace per-process stop_monitoring loop with single StuckMonitor.shutdown() call.
- pyproject: remove duplicate running-process>=3.0.7 entry (running-process>=3.0.9 remains).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Apr 18, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Updated board support configuration for fbuild by adding Teensy 4.0/4.1 support and expanding documented exclusions with refined reasons. Enhanced process management with KeyboardInterrupt handling to gracefully terminate child processes. Removed a duplicate dependency constraint in project configuration.

Changes

Cohort / File(s) Summary
Board Configuration Updates
ci/compiler/fbuild_boards.py
Added teensy40 and teensy41 to supported boards frozenset. Refined documentation on unsupported boards, clarifying Teensy 3.x/LC exclusion as "no Cortex-M7" and ESP32 variants as requiring "custom IDF/driver configs." Expanded exclusion list to explicitly document additional platforms (atmega8a, STM32, RP2040/RP2350, NRF52, Apollo3, SAM/SAMD, MGM240, esp8266) lacking fbuild orchestrators.
Process Management
ci/util/running_process_group.py
Added KeyboardInterrupt exception handler in _run_parallel monitoring loop that terminates all active child processes, invokes interrupt handler, and re-raises. Simplified stuck-monitor cleanup by replacing per-process stop_monitoring calls with single shutdown() call.
Dependency Cleanup
pyproject.toml
Removed duplicate running-process>=3.0.7 dependency entry while retaining running-process>=3.0.9.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

Poem

🐰 Teensy boards hop in with glee,
Four-oh and four-one join the spree!
Interrupts now handled with care,
Child processes stop mid-air.
Cleanup streamlined, config neat—
This refactor's quite the treat! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the three main changes: adding teensy40/41 to fbuild, adding KeyboardInterrupt handling to RunningProcessGroup, and removing a duplicate dependency.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ 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 chore/fbuild-teensy-rpg-interrupt-pyproject-dedup

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ci/util/running_process_group.py`:
- Around line 370-375: The except block currently creates a new
KeyboardInterrupt() instead of capturing the caught exception; update the
handler to use "except KeyboardInterrupt as ki:" and pass that captured
exception to handle_keyboard_interrupt(ki) (while still killing active_processes
and preserving the trailing raise), matching the pattern used elsewhere in this
module (see handle_keyboard_interrupt and active_processes).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c753e8e7-b6ee-4095-a24b-472d1ca67f51

📥 Commits

Reviewing files that changed from the base of the PR and between 598d298 and 971c822.

📒 Files selected for processing (3)
  • ci/compiler/fbuild_boards.py
  • ci/util/running_process_group.py
  • pyproject.toml
💤 Files with no reviewable changes (1)
  • pyproject.toml

Comment on lines +370 to +375
except KeyboardInterrupt:
# Kill all active child processes on interrupt
for proc in active_processes:
proc.kill()
handle_keyboard_interrupt(KeyboardInterrupt())
raise

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Capture the caught KeyboardInterrupt instead of constructing a new one.

The two other handlers in this file (lines 674–676 and 754–756) use except KeyboardInterrupt as ki: and forward ki. Here a fresh KeyboardInterrupt() is passed to handle_keyboard_interrupt, which breaks the traceback chain that helper explicitly preserves via raise KeyboardInterrupt() from ki, and is inconsistent with the rest of the module.

Also note: on the main thread, handle_keyboard_interrupt re-raises itself, so the trailing raise on line 375 only executes on worker threads — that's fine, just be aware it isn't redundant.

♻️ Suggested fix
-        except KeyboardInterrupt:
-            # Kill all active child processes on interrupt
-            for proc in active_processes:
-                proc.kill()
-            handle_keyboard_interrupt(KeyboardInterrupt())
-            raise
+        except KeyboardInterrupt as ki:
+            # Kill all active child processes on interrupt
+            for proc in active_processes:
+                proc.kill()
+            handle_keyboard_interrupt(ki)
+            raise
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ci/util/running_process_group.py` around lines 370 - 375, The except block
currently creates a new KeyboardInterrupt() instead of capturing the caught
exception; update the handler to use "except KeyboardInterrupt as ki:" and pass
that captured exception to handle_keyboard_interrupt(ki) (while still killing
active_processes and preserving the trailing raise), matching the pattern used
elsewhere in this module (see handle_keyboard_interrupt and active_processes).

@zackees
zackees merged commit cafcfb3 into master Apr 18, 2026
5 of 80 checks passed
@zackees
zackees deleted the chore/fbuild-teensy-rpg-interrupt-pyproject-dedup branch May 30, 2026 20:01
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