wilix-team / iohook

Node.js global keyboard and mouse listener.
https://wilix-team.github.io/iohook
MIT License
1.2k stars 291 forks source link

install script hardcoded to install prebuilt binary #309

Closed jla3378 closed 3 years ago

jla3378 commented 3 years ago

ran npm run build successfully on darwin-arm64 but npm run install tries to download a non-existent prebuild from https//github.com/wilix-team/iohook/releases/download/v0.7.2/iohook-v0.7.2-node-v88-darwin-arm64.tar.gz despite having built it locally

several other packages that have a dependency on iohook will not compile as the iohook install script gives up after failing to find a prebuilt rather than building itself locally or finding that it has already been built locally

jla3378 commented 3 years ago

iohook-v0.7.2-electron-v85-darwin-arm64.tar.gz

At the very least, could you guys upload either this or an arm64-darwin prebuild, please?

jla3378 commented 3 years ago
error /Users/sgulls/src/razer-macos/node_modules/iohook: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: /Users/joojin/src/razer-macos/node_modules/iohook
Output:
electron 85 darwin arm64
Downloading prebuild for platform: iohook-v0.7.2-electron-v85-darwin-arm64
Downloading prebuild.tar.gz
Error: GET https://github.com/wilix-team/iohook/releases/download/v0.7.2/iohook-v0.7.2-electron-v85-darwin-arm64.tar.gz returned 404
Prebuild for current platform (iohook-v0.7.2-electron-v85-darwin-arm64) not found!
Try to compile for your platform:
# cd node_modules/iohook;
# npm run compile

/Users/sgulls/src/razer-macos/node_modules/iohook/install.js:15
  throw err;
  ^
Prebuild for current platform (iohook-v0.7.2-electron-v85-darwin-arm64) not found!
(Use `node --trace-uncaught ...` to show where the exception was
WilixLead commented 3 years ago

I think we need additional arm CI builder for this case

jla3378 commented 3 years ago

should just involve specifying arm64 under macOS arch. or since you guys use travis, osx_image: xcode12.2 for universal builds. or manually adding CFLAGS="$CFLAGS -arch x86_64 -arch arm64", LDFLAGS="$LDFLAGS -arch x86_64 -arch arm64", etc.

ash0x0 commented 3 years ago

Thanks for the info @sgulls. I will however be moving from a prebuilds approach to a local build approach with gyp so this shouldn't be an issue after that switch as iohook will stop relying on prebuilds. I will close this as it should be solved as soon as that transition is made and there are other issues that will address that. Feel free to reopen please and I will ping here as well once the switch to local builds is done.