UltimateHackingKeyboard / agent

Ultimate Hacking Keyboard configurator
https://ultimatehackingkeyboard.github.io/agent/
Other
698 stars 77 forks source link

Apple M1 Mac Build (ARM 64) #1621

Closed spuder closed 2 years ago

spuder commented 2 years ago

UHK Agent for Mac currently is only available as an Intel Build.

Screen Shot 2021-11-13 at 9 59 34 PM

Intel builds run much slower through the rosetta translation.

Since apple has completely stopped making Intel laptops, a M1 version of apps is imperative.

Additional information

Building manually

Here is the output with warnings when building on an M1 Mac

node -v               
v15.14.0
npm -v                
7.7.6
npm build

``` npm install npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: 'uhk-agent@1.5.16', npm WARN EBADENGINE required: { node: '>=16.5.0 <17.0.0', npm: '>=7.19.1 <8.0.0' }, npm WARN EBADENGINE current: { node: 'v15.14.0', npm: '7.7.6' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: 'stylelint@14.0.1', npm WARN EBADENGINE required: { node: '^12.20.0 || ^14.13.1 || >=16.0.0' }, npm WARN EBADENGINE current: { node: 'v15.14.0', npm: '7.7.6' } npm WARN EBADENGINE } npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated phantomjs-prebuilt@2.1.16: this package is now deprecated npm WARN deprecated request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated @types/form-data@2.5.0: This is a stub types definition. form-data provides its own type definitions, so you do not need this installed. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x. npm WARN deprecated highlight.js@9.18.5: Support has ended for 9.x series. Upgrade to @latest npm WARN deprecated tslint@6.1.3: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information. > uhk-agent@1.5.16 postinstall > lerna bootstrap lerna notice cli v4.0.0 lerna info Bootstrapping 7 packages lerna info Installing external dependencies ⸨ ░⸩ ⠏ install dependencies: verb installed leaf uhk-agent ⸨ ░⸩ ⠋ install dependencies: verb installed leaf uhk-agent lerna info Symlinking packages and binaries lerna info lifecycle uhk-web@1.0.0~postinstall: uhk-web@1.0.0 > uhk-web@1.0.0 postinstall /Users/spencer.owen/Code/github/agent/packages/uhk-web > ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points Compiling @angular/core : es2015 as esm2015 Compiling @angular/compiler/testing : es2015 as esm2015 Compiling @angular/cdk/keycodes : es2015 as esm2015 Compiling @angular/animations : es2015 as esm2015 Compiling @angular/common : es2015 as esm2015 Compiling @angular/cdk/collections : es2015 as esm2015 Compiling @angular/cdk/observers : es2015 as esm2015 Compiling @ngrx/store : es2015 as esm2015 Compiling @angular/cdk/platform : es2015 as esm2015 Compiling @angular/cdk/bidi : es2015 as esm2015 Compiling @angular/platform-browser : es2015 as esm2015 Compiling @angular/cdk/a11y : es2015 as esm2015 Compiling @angular/cdk/scrolling : es2015 as esm2015 Compiling @angular/forms : es2015 as esm2015 Compiling @angular/animations/browser : es2015 as esm2015 Compiling @angular/core/testing : es2015 as esm2015 Compiling @angular/router : es2015 as esm2015 Compiling @angular/cdk/portal : es2015 as esm2015 Compiling @angular/platform-browser-dynamic : es2015 as esm2015 Compiling @angular/common/http : es2015 as esm2015 Compiling @angular/platform-browser/testing : es2015 as esm2015 Compiling @angular/common/testing : es2015 as esm2015 Compiling @fortawesome/angular-fontawesome : es2015 as esm2015 Compiling @ngrx/effects : es2015 as esm2015 Compiling ngx-window-token : es2015 as esm2015 Compiling @angular/cdk/overlay : es2015 as esm2015 Compiling @angular/animations/browser/testing : es2015 as esm2015 Compiling @angular/cdk/accordion : es2015 as esm2015 Compiling @angular/cdk/clipboard : es2015 as esm2015 Compiling @angular/cdk/drag-drop : es2015 as esm2015 Compiling @angular/cdk/layout : es2015 as esm2015 Compiling @angular/cdk/stepper : es2015 as esm2015 Compiling @angular/cdk/table : es2015 as esm2015 Compiling @angular/cdk/text-field : es2015 as esm2015 Compiling @angular/cdk/tree : es2015 as esm2015 Compiling @angular/common/http/testing : es2015 as esm2015 Compiling @angular/platform-browser/animations : es2015 as esm2015 Compiling @angular/platform-browser-dynamic/testing : es2015 as esm2015 Compiling @angular/router/testing : es2015 as esm2015 Compiling @fortawesome/angular-fontawesome/testing : es2015 as esm2015 Compiling @ng-bootstrap/ng-bootstrap : es2015 as esm2015 Compiling @ng-select/ng-select : es2015 as esm2015 Compiling @ngrx/effects/testing : es2015 as esm2015 Compiling @ngrx/router-store : es2015 as esm2015 Compiling @ngrx/store/testing : es2015 as esm2015 Compiling @ngrx/store-devtools : es2015 as esm2015 Compiling angular-confirmation-popover : es2015 as esm2015 Compiling angular-notifier : es2015 as esm2015 Compiling ng2-dragula : es2015 as esm2015 Compiling ng2-nouislider : es2015 as esm2015 Compiling ngx-clipboard : es2015 as esm2015 Compiling ngx-contextmenu : es2015 as esm2015 Compiling ngx-select-ex : es2015 as esm2015 lerna success Bootstrapped 7 packages added 1339 packages, and audited 1340 packages in 2m 115 packages are looking for funding run `npm fund` for details 12 vulnerabilities (11 moderate, 1 high) To address issues that do not require attention, run: npm audit fix To address all issues possible (including breaking changes), run: npm audit fix --force Some issues need review, and may require choosing a different dependency. Run `npm audit` for details. npm notice npm notice New major version of npm available! 7.7.6 -> 8.1.3 npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.1.3 npm notice Run npm install -g npm@8.1.3 to update! npm notice \``` ``` npm run build > uhk-agent@1.5.16 prebuild > check-node-version --package node: 15.14.0 Wanted node version >=16.5.0 <17.0.0 (>=16.5.0 <17.0.0) To install node, see https://nodejs.org/download/release/v16.5.0/ npm: 7.7.6 Wanted npm version >=7.19.1 <8.0.0 (>=7.19.1 <8.0.0) To install npm, run `npm install -g npm@7.19.1 \```

npm run build

``` npm run build > uhk-agent@1.5.16 prebuild > check-node-version --package > uhk-agent@1.5.16 build > lerna run build lerna notice cli v4.0.0 lerna info Executing command in 5 packages: "npm run build" lerna info run Ran npm script 'build' in 'kboot' in 3.7s: > kboot@0.0.0 build > tsc --project ./src/tsconfig.json lerna info run Ran npm script 'build' in 'uhk-common' in 4.6s: > uhk-common@1.0.0 build > run-s tsc copy:* > uhk-common@1.0.0 tsc > tsc > uhk-common@1.0.0 copy:scancodes > copyfiles ./src/config-serializer/config-items/scancodes.json dist lerna info run Ran npm script 'build' in 'uhk-usb' in 2.4s: > uhk-usb@1.0.0 build > tsc lerna info run Ran npm script 'build' in 'uhk-agent' in 21.1s: > uhk-agent@0.0.0 build > webpack && npm run install:build-deps && npm run download-firmware && npm run copy-to-tmp-folder assets by path *.js 1.35 MiB asset electron-main.js 1.35 MiB [emitted] [minimized] (name: main) 2 related assets asset preload.js 178 bytes [emitted] [from: src/preload.js] [copied] [minimized] assets by path *.json 529 bytes asset package.json 426 bytes [emitted] [from: src/package.json] [copied] asset manifest.json 103 bytes [emitted] [from: src/manifest.json] [copied] runtime modules 793 bytes 4 modules modules by path ../ 3.02 MiB modules by path ../../node_modules/ 1.88 MiB 391 modules modules by path ../uhk-common/ 904 KiB 228 modules modules by path ../uhk-usb/ 188 KiB 77 modules modules by path ../kboot/ 71.9 KiB modules by path ../kboot/dist/ 33.7 KiB 24 modules modules by path ../kboot/node_modules/ 38.2 KiB 7 modules modules by path ./ 675 KiB modules by path ./node_modules/ 612 KiB 67 modules modules by path ./src/ 63.3 KiB modules by path ./src/util/*.ts 16.8 KiB 13 modules modules by path ./src/services/*.ts 37.6 KiB 7 modules modules by path ./src/*.ts 8.96 KiB 4 modules 21 modules webpack 5.59.0 compiled successfully in 15030 ms > uhk-agent@0.0.0 install:build-deps > cd ./dist && npm i added 65 packages, and audited 66 packages in 2s 5 packages are looking for funding run `npm fund` for details found 0 vulnerabilities > uhk-agent@0.0.0 download-firmware > node ../../scripts/download-firmware.js Start download https://github.com/UltimateHackingKeyboard/firmware/releases/download/v8.10.12/uhk-firmware-8.10.12.tar.gz > uhk-agent@0.0.0 copy-to-tmp-folder > node ../../scripts/copy-to-tmp-folder.js lerna info run Ran npm script 'build' in 'uhk-web' in 51.7s: > uhk-web@1.0.0 build > run-s -sn build:renderer > uhk-web@1.0.0 build:renderer /Users/spencer.owen/Code/github/agent/packages/uhk-web/package.json > ng build --prod --aot --project=uhk-renderer Initial Chunk Files | Names | Size main-es5.a4818618d3149fe3a61d.js | main | 1.97 MB main-es2015.a4818618d3149fe3a61d.js | main | 1.81 MB polyfills-es5.407c0ab608fa79f389c8.js | polyfills-es5 | 147.88 kB polyfills-es2015.59abccebedf731e6810c.js | polyfills | 90.11 kB scripts.72b524b64636d8ec708f.js | scripts | 24.67 kB styles.3e56b0534b4f6b394887.css | styles | 3.78 kB | Initial ES5 Total | 2.14 MB | Initial ES2015 Total | 1.92 MB Lazy Chunk Files | Names | Size stylesLight.css | stylesLight | 138.57 kB stylesDark.css | stylesDark | 138.37 kB runtime-es2015.59b85b822b640d9e1df0.js | runtime | 1.45 kB runtime-es5.59b85b822b640d9e1df0.js | runtime | 1.45 kB Build at: 2021-11-14T05:39:25.694Z - Hash: 0f7aa378a12c15843153 - Time: 44920ms lerna success run Ran npm script 'build' in 5 packages in 56.3s: lerna success - kboot lerna success - uhk-agent lerna success - uhk-common lerna success - uhk-usb lerna success - uhk-web \```

spuder commented 2 years ago

I was able to build and run the app natively on M1 without issue

Screen Shot 2021-11-13 at 10 41 49 PM

I suspect that this won't be feasible to automate until one of the following is implemented

A) github actions adds support for M1 runners B) UHK spins up a self hosted M1 github runner

As a temporary solution I may be to setup a self hosted runner on my M1 mac. I'm willing to donate compute cycles to help expedite getting M1 builds to the general public.

mondalaci commented 2 years ago

Closing this issue as a duplicate of #1419. Thanks for the heads-up and details!