la-jarre-a-son / midi-jar

MIDI Jar is a tool box for musicians, learners, streamers, that want to route MIDI message between devices, and display a piano or chords while playing, and integrate it on a video or on a Twitch stream.
http://midi-jar.ljas.fr/
MIT License
87 stars 9 forks source link

Fail to build on Linux (ArchLinux) #2

Closed sreich closed 2 years ago

sreich commented 2 years ago

Expected Behavior

i ran npm install and got this failure on linux, run as my user. interestingly, your previous project builds fine and i can use npm start with it


midi-jar@1.0.0 postinstall npm run licenses && ts-node .erb/scripts/check-native-dep.js && electron-builder install-app-deps && cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.ts

midi-jar@1.0.0 licenses ts-node ./.erb/scripts/licenses.js

• electron-builder version=23.0.3 • loaded configuration file=package.json ("build" field) • installing production dependencies platform=linux arch=x64 appDir=/home/sreich/Downloads/midi-jar-main/release/app ⨯ /usr/bin/node process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Exit code: 1 Error output: npm WARN config production Use --omit=dev instead. npm ERR! code 1 npm ERR! path /home/sreich/Downloads/midi-jar-main/release/app/node_modules/midi npm ERR! command failed npm ERR! command sh /tmp/install-03c68391.sh npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@8.4.1 npm ERR! gyp info using node@18.6.0 | linux | x64 npm ERR! gyp info find Python using Python version 3.10.5 found at "/usr/bin/python3" npm ERR! gyp http GET https://electronjs.org/headers/v16.2.1/node-v16.2.1-headers.tar.gz npm ERR! gyp http 200 https://artifacts.electronjs.org/headers/dist/v16.2.1/node-v16.2.1-headers.tar.gz npm ERR! gyp http GET https://electronjs.org/headers/v16.2.1/SHASUMS256.txt npm ERR! gyp http 200 https://artifacts.electronjs.org/headers/dist/v16.2.1/SHASUMS256.txt npm ERR! gyp info spawn /usr/bin/python3 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/home/sreich/Downloads/midi-jar-main/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/sreich/Downloads/midi-jar-main/release/app/node_modules/midi/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/sreich/Downloads/midi-jar-main/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/sreich/.electron-gyp/16.2.1/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=/home/sreich/.electron-gyp/16.2.1', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/home/sreich/Downloads/midi-jar-main/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/home/sreich/.electron-gyp/16.2.1/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/sreich/Downloads/midi-jar-main/release/app/node_modules/midi', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in binding.gyp while trying to load binding.gyp npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: gyp failed with exit code: 1 npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/home/sreich/Downloads/midi-jar-main/node_modules/node-gyp/lib/configure.js:259:16) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28) npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12) npm ERR! gyp ERR! System Linux 5.18.12-arch1-1 npm ERR! gyp ERR! command "/usr/bin/node" "/home/sreich/Downloads/midi-jar-main/node_modules/.bin/node-gyp" "rebuild" npm ERR! gyp ERR! cwd /home/sreich/Downloads/midi-jar-main/release/app/node_modules/midi npm ERR! gyp ERR! node -v v18.6.0 npm ERR! gyp ERR! node-gyp -v v8.4.1 npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: npm ERR! /home/sreich/.npm/_logs/2022-08-05T02_19_37_707Z-debug-0.log failedTask=installAppDeps stackTrace=Error: /usr/bin/node process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Exit code: 1 Error output: npm WARN config production Use --omit=dev instead. npm ERR! code 1 npm ERR! path /home/sreich/Downloads/midi-jar-main/release/app/node_modules/midi npm ERR! command failed npm ERR! command sh /tmp/install-03c68391.sh npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@8.4.1 npm ERR! gyp info using node@18.6.0 | linux | x64 npm ERR! gyp info find Python using Python version 3.10.5 found at "/usr/bin/python3" npm ERR! gyp http GET https://electronjs.org/headers/v16.2.1/node-v16.2.1-headers.tar.gz npm ERR! gyp http 200 https://artifacts.electronjs.org/headers/dist/v16.2.1/node-v16.2.1-headers.tar.gz npm ERR! gyp http GET https://electronjs.org/headers/v16.2.1/SHASUMS256.txt npm ERR! gyp http 200 https://artifacts.electronjs.org/headers/dist/v16.2.1/SHASUMS256.txt npm ERR! gyp info spawn /usr/bin/python3 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/home/sreich/Downloads/midi-jar-main/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/sreich/Downloads/midi-jar-main/release/app/node_modules/midi/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/sreich/Downloads/midi-jar-main/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/sreich/.electron-gyp/16.2.1/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=/home/sreich/.electron-gyp/16.2.1', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/home/sreich/Downloads/midi-jar-main/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/home/sreich/.electron-gyp/16.2.1/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/sreich/Downloads/midi-jar-main/release/app/node_modules/midi', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in binding.gyp while trying to load binding.gyp npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: gyp failed with exit code: 1 npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/home/sreich/Downloads/midi-jar-main/node_modules/node-gyp/lib/configure.js:259:16) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28) npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12) npm ERR! gyp ERR! System Linux 5.18.12-arch1-1 npm ERR! gyp ERR! command "/usr/bin/node" "/home/sreich/Downloads/midi-jar-main/node_modules/.bin/node-gyp" "rebuild" npm ERR! gyp ERR! cwd /home/sreich/Downloads/midi-jar-main/release/app/node_modules/midi npm ERR! gyp ERR! node -v v18.6.0 npm ERR! gyp ERR! node-gyp -v v8.4.1 npm ERR! gyp ERR! not ok npm ERR! A complete log of this run can be found in: npm ERR! /home/sreich/.npm/_logs/2022-08-05T02_19_37_707Z-debug-0.log at ChildProcess. (/home/sreich/Downloads/midi-jar-main/node_modules/builder-util/src/util.ts:250:14) at Object.onceWrapper (node:events:628:26) at ChildProcess.emit (node:events:513:28) at maybeClose (node:internal/child_process:1091:16) at Socket. (node:internal/child_process:449:11) at Socket.emit (node:events:513:28) at Pipe. (node:net:757:14) npm ERR! code 1 npm ERR! path /home/sreich/Downloads/midi-jar-main npm ERR! command failed npm ERR! command sh /tmp/postinstall-c756e17a.sh

npm ERR! A complete log of this run can be found in: npm ERR! /home/sreich/.npm/_logs/2022-08-05T02_19_09_993Z-debug-0.log

ArTiSTiX commented 2 years ago

Oh oh...

I thought that nobody would need a build on linux, i was sooo wrong. I did not dig into building it on linux, cause it was failing at CI (and it costs to re-run blindly) but if you find a way to do it, i will add the changes to provide an AppImage build.

The build looks like to fail because of a bindings.gyp variables: https://github.com/nodejs/node-gyp/issues/2673 Maybe you have a specific node version that does not want to build correctly too.

Also, for Linux, looks like the https://github.com/justinlatimer/node-midi packages has some requirements:

ArTiSTiX commented 2 years ago

@sreich I had no issue running it on Ubuntu

Node version: 16.16.0 (this may be because of your node version that the build was failing) I installed libasound2-dev but did not try without installing it.

It is working perfectly (after a few fixes i will bring to v1.1.0)

VirtualBox_MORGANE_06_08_2022_16_09_39

sreich commented 2 years ago

Huh i'm not sure what to make of this, especially given the link. It seems to choose python 3 but that doesn't seem to be an issue. i've already got alsa-lib installed (archlinux)

My node version is v18.6.0

ArTiSTiX commented 2 years ago

I think the issue is with your node-gyp version, looks like it has some issues with this openssl_fips variable in the v8.4.1.

Try updating manually node-gyp in the project to 9.1.0 (i had no issue with it, but reproduced yours with 8.4.1). Strange since the package-lock mentions using node-gyp@9.1.0

I also upgraded the project to v1.1.0 with some dependencies upgrades, and it now has the standard music notation feature !

I also provided a Linux AppImage build in the latest release

sreich commented 2 years ago

Okay cool, i'll just use the appimage then, nice. Thanks. You're really on the ball with this project. I opened it up and I'm honestly impressed. The ui is shockingly nice already, it's got a lot of features going through it

And holy crap was I surprised when I saw the pipewire-like(linux) interface for routing! THEN it's got some really nice touches like the start minimized and startup. I'll start using this and give feedback accordingly. Looking forward to what other neat features you will add to it

ArTiSTiX commented 2 years ago

@sreich Thanks !

Yeah, since chord-display as a webpage was not fulfilling real needs, i wanted to start a standalone app that makes sense for an user. So little things like "Always on top", being able to have the window as tiny as possible, and having a local web server for having it remotely in another program were my main focus.

And of course, operating systems lack this kind of MIDI configuration with routing between devices, so this looks promising for adding new stuff (i have a lot in mind, port routing and splitting the keyboard is one them).

I think the startup feature would not work on linux, i'm really not a linux user myself and its not documented by Electron.

But if you wanna to launch it minimized, adding the --openAsHidden argument should work.

Don't hesitate if you have some features in mind that could be added.

I'll be working on the virtual keyboard features soon.

sreich commented 2 years ago

ah okay, thanks. No problem, it's super easy to add startup entries on nix especially since it is an appimage

Thank you