robolab-io / iohook

Global native keyboard and mouse listener for Node.js. Maintained by Robolab
https://npmjs.com/package/@mechakeys/iohook
MIT License
24 stars 7 forks source link

Missing arm64 - Apple M1 #2

Open FluffyDiscord opened 1 year ago

FluffyDiscord commented 1 year ago

Hi, would i be possible to add builds for M1 silicon? Manual build fails (npm run build inside downloaded the module) with

node_modules/@mechakeys/iohook/node_modules/node-abi/index.js:59
  throw new Error('Could not detect target for abi ' + abi + ' and runtime ' + runtime)
  ^
Error: Could not detect target for abi 108 and runtime node

package.json

{
  "main": "main.js",
  "engines": {
    "node": "18.15.0"
  },
  "dependencies": {
    "@fortawesome/fontawesome-free": "^5.15.4",
    "@mechakeys/iohook": "^1.1.1",
    "alertifyjs": "^1.13.1",
    "aws4": "^1.11.0",
    "dotenv": "^10.0.0",
    "electron-better-ipc": "^2.0.1",
    "electron-deeplink": "^1.0.7",
    "electron-serve": "^1.1.0",
    "electron-store": "^8.0.0",
    "electron-updater": "^4.6.1",
    "fast-xml-parser": "^3.20.0",
    "he": "^1.2.0",
    "interval-promise": "^1.4.0",
    "mdb-ui-kit": "^3.9.0",
    "svelecte": "^3.9.2",
    "svelte-asyncable": "^2.0.4",
    "svelte-motion": "^0.11.2",
    "tippy.js": "^6.3.1",
    "ts-md5": "^1.2.9",
    "versiony": "^2.0.1"
  },
  "devDependencies": {
    "@rollup/plugin-commonjs": "^20.0.0",
    "@rollup/plugin-node-resolve": "^13.0.4",
    "@rollup/plugin-replace": "^3.0.0",
    "@rollup/plugin-typescript": "^8.0.0",
    "@tsconfig/svelte": "^2.0.0",
    "concurrently": "^6.2.1",
    "electron": "^25",
    "electron-builder": "^24",
    "electron-rebuild": "^3.2.5",
    "rollup": "^2.56.2",
    "rollup-plugin-copy": "^3.4.0",
    "rollup-plugin-css-only": "^3.1.0",
    "rollup-plugin-livereload": "^2.0.5",
    "rollup-plugin-svelte": "^7.1.0",
    "rollup-plugin-terser": "^7.0.2",
    "sass": "^1.39.2",
    "sirv-cli": "^1.0.12",
    "svelte": "^3.42.1",
    "svelte-check": "^2.0.0",
    "svelte-preprocess": "^4.0.0",
    "svelte-stack-router": "^2.4.4",
    "tslib": "^2.0.0",
    "typescript": "4.3.5",
    "versiony-cli": "^1.3.0",
    "wait-on": "^6.0.0"
  },
  "iohook": {
    "targets": [
      "node-108",
      "electron-116"
    ],
    "platforms": [
      "win32",
      "darwin",
      "linux"
    ],
    "arches": [
      "x64"
    ]
  }
}

I am trying to use it alongside electron

ferothefox commented 1 year ago

Hi! Thanks for the report. Unfortunately, I personally do not own an M1 Mac, nor does anyone on our team. We won't be able to reproduce your issue with manual building, so I apologize for the inconvenience. This may be an issue with a heavily outdated node-abi version, so I'll push an update later that will bump it to the latest.

As for prebuilds, I'll look into third-party CI services to get something working. GitHub Actions does not yet have M1 virtual machines to run jobs on, but something like Cirrus CI does (https://cirrus-ci.org).

tcardlab commented 1 year ago

ABI issue aside, the following fork + commit of the original claims to add M1 support: https://github.com/hiredigital/iohook/commit/4f62acf15e4c7e991c4d01da97b31d3778521c92

Might be able to reference that for anyone willing to make a PR

ferothefox commented 1 year ago

FYI I bumped node-abi version to latest everything seems to be build on the existing Actions fine. Working on Cirrus CI now for automatic M1 builds (hopefully!)

Edit: looks like Cirrus placed a nasty limit. I'll try Circle and etc.