Skip to content

fix(wasm_build): explicit KeyboardInterrupt re-raise (meta #2580 D2) - #2586

Merged
zackees merged 1 commit into
masterfrom
fix/2580-wasm-build-keyboardinterrupt
May 30, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/2580-wasm-build-keyboardinterrupt

Conversation

@zackees

@zackees zackees commented May 30, 2026 •

Copy link
Copy Markdown
Member

Summary

ci/wasm_build.py _ensure_emscripten_wasm_ld_patch wraps ensure_emscripten_available() in try: ... except Exception as e: .... While KeyboardInterrupt is not Exception (so Ctrl-C does propagate), the repo guideline is to make the re-raise explicit. Added an except KeyboardInterrupt: raise clause ahead of the broad handler.

Addresses meta-issue #2580 finding D2 (originally CodeRabbit on #2490 — #2490 (comment)).

Test plan

  • bash lint
  • CI green

Summary by CodeRabbit

  • Bug Fixes
    • Improved WebAssembly build process to properly respond to user interrupts (Ctrl+C), enabling clean build cancellation.

Review Change Stack

…ndler

The try/except around ensure_emscripten_available() catches Exception
broadly. While KeyboardInterrupt is not Exception (so Ctrl-C does
propagate in practice), the repo guideline is to make the re-raise
explicit. Adds `except KeyboardInterrupt: raise` before the existing
`except Exception as e:` handler.

Addresses CodeRabbit finding D2 from meta #2580 (originally #2490).
@zackees
zackees merged commit 41c2dbb into master May 30, 2026
6 of 7 checks passed
@coderabbitai

coderabbitai Bot commented May 30, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1e85b391-08ac-4482-8d26-0946ea7ff501

📥 Commits

Reviewing files that changed from the base of the PR and between 9cb8566 and fc1fb99.

📒 Files selected for processing (1)
  • ci/wasm_build.py

📝 Walkthrough

Walkthrough

The PR adds explicit KeyboardInterrupt exception handling inside _ensure_emscripten_wasm_ld_patch() to prevent user interrupts from being suppressed by a broader exception handler during the best-effort emscripten patch attempt.

Changes

KeyboardInterrupt Signal Handling

Layer / File(s) Summary
Explicit interrupt signal handling
ci/wasm_build.py
KeyboardInterrupt is explicitly caught and immediately re-raised, ensuring user interrupts during the emscripten patch attempt are not suppressed by the function's non-fatal except Exception block.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A rabbit hops through CI with care,
When Ctrl+C rings through the air,
No broader catch shall steal the sigh,
KeyboardInterrupt flies on by! ✨

✨ 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 fix/2580-wasm-build-keyboardinterrupt

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.

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