fix(bridge): handle async spawn 'error' + default MAME bin to /usr/games/mame#227
Merged
privaloops merged 1 commit intomainfrom Apr 27, 2026
Merged
Conversation
…mes/mame
Two related fixes after debugging launches on the Pi:
1. ENOENT ("binary not found") fires asynchronously as an 'error'
event on the ChildProcess, not a synchronous throw. MameProcess
only listened to 'exit', so Node escalated the unhandled 'error'
into a process-wide exception and the systemd service died on every
missing-binary attempt. Now both events are caught, the first one
that fires emits a spawn-error ExitReason, and the bridge stays
alive. Two new test cases pin the contract.
2. systemd's default PATH doesn't include /usr/games, the directory
Debian uses for MAME. A bare spawn("mame") found nothing even
though the binary was installed. Default the bridge's MAME binary
to /usr/games/mame, with SPRIXE_BRIDGE_MAME_BIN as the override for
other distros. The Pi service unit now sets the env var
explicitly so the resolution is unambiguous.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two related fixes after debugging launches on the Pi:
ENOENT ("binary not found") fires asynchronously as an 'error'
event on the ChildProcess, not a synchronous throw. MameProcess
only listened to 'exit', so Node escalated the unhandled 'error'
into a process-wide exception and the systemd service died on every
missing-binary attempt. Now both events are caught, the first one
that fires emits a spawn-error ExitReason, and the bridge stays
alive. Two new test cases pin the contract.
systemd's default PATH doesn't include /usr/games, the directory
Debian uses for MAME. A bare spawn("mame") found nothing even
though the binary was installed. Default the bridge's MAME binary
to /usr/games/mame, with SPRIXE_BRIDGE_MAME_BIN as the override for
other distros. The Pi service unit now sets the env var
explicitly so the resolution is unambiguous.