Skip to content

fix(native-hid): release builds never load the HID helper from the build machine's checkout path - #117

Merged
snekxs merged 1 commit into
OpenMouse-Project:mainfrom
HighestFidelity:pr/native-hid-path
Nov 13, 2026
Merged

snekxs merged 1 commit into
OpenMouse-Project:mainfrom
HighestFidelity:pr/native-hid-path

Conversation

@HighestFidelity

Copy link
Copy Markdown
Contributor

When native-hid/src/apply.mjs isn't next to the executable, Bridge falls back to the source checkout it was built from (CARGO_MANIFEST_DIR, baked in at compile time). For a release binary that's the CI runner's path, D:\a\... on Windows. Any account on the user's machine can create D:\a\... and drop its own apply.mjs there, and Bridge would run it with Node.

What changed:

  • This only gates the dev fallback. A release build uses the checkout path only when the running executable is inside that checkout (cargo build --release, then target/release/...). Debug builds keep the fallback as before.
  • The bundled helper paths next to the executable are untouched, so installed releases find the helper exactly as they do now.

Tested:

  • New unit test a_release_build_uses_the_checkout_only_from_inside_it: the test binary counts as inside its own folder, a made-up checkout does not, and debug builds always allow the fallback.
  • cargo fmt --check, cargo test --locked, and clippy with -D warnings for Linux and x86_64-pc-windows-gnu all pass.
  • A fork build with this change passed a quick Windows test using the bundled helper. I didn't stage a fake D:\a\... checkout to watch it get refused.

🤖 Generated with Claude Code

…ild machine's checkout path

When the bundled apply.mjs is missing, release binaries fell back to the
build machine's checkout path (a CI runner's D:\a\... on Windows), which
another account could create and fill. That dev fallback is now used only
by debug builds and by binaries run from inside that checkout. The bundled
helper paths are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 86974b1 and 89a64b5.

Files selected for processing: 1

  • src/drivers/native_hid.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving 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.

Share

@github-actions github-actions Bot added type: bug PR title category: bug area: native Native bridge and platform services area: devices HID access and device drivers labels Nov 13, 2026
@snekxs
snekxs merged commit f51fbb8 into OpenMouse-Project:main Nov 13, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: devices HID access and device drivers area: native Native bridge and platform services type: bug PR title category: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants