jan icon indicating copy to clipboard operation
jan copied to clipboard

bug: electron `make build` fails

Open lomenzel opened this issue 1 year ago • 6 comments

Describe the bug running make build and also make dev result in an error

Steps to reproduce Steps to reproduce the behavior:

  1. Clone git repo
  2. Enter a nix environment with gnumake and yarn
  3. run make build

Expected behavior build the app i guess

Screenshots grafik

screenshot text: ○ (Static) prerendered as static HTML

$ yarn copy:assets && yarn workspace jan build $ cpx "models/" "electron/models/" && cpx "docs/openapi/" "electron/docs/openapi" $ run-script-os $ tsc -p . && electron-builder -p never -l deb • electron-builder version=24.9.1 os=6.7.0-rc7 • loaded configuration file=package.json ("build" field) • writing effective config file=dist/builder-effective-config.yaml • packaging platform=linux arch=x64 electron=28.0.0 appOutDir=dist/linux-unpacked • building target=deb arch=x64 file=dist/jan-linux-amd64-0.1.3.deb • adding autoupdate files for: deb. (Beta feature) resourceDir=/home/leonard/Projekte/jan/jan/electron/dist/linux-unpacked/resources ⨯ cannot execute cause=fork/exec /home/leonard/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86_64/fpm: no such file or directory command=/home/leonard/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86_64/fpm -s dir --force -t deb -d libgtk-3-0 -d libnotify4 -d libnss3 -d libxss1 -d libxtst6 -d xdg-utils -d libatspi2.0-0 -d libuuid1 -d libsecret-1-0 --deb-recommends libappindicator3-1 --deb-compression xz --architecture amd64 --after-install /run/user/1000/t-Boxdoz/0-after-install --after-remove /run/user/1000/t-Boxdoz/1-after-remove --description ' Use offline LLMs with your own data. Run open source models like Llama2 or Falcon on your internal computers/servers.' --version 0.1.3 --package /home/leonard/Projekte/jan/jan/electron/dist/jan-linux-amd64-0.1.3.deb --name jan --maintainer 'Jan [email protected]' --url https://github.com/janhq/jan/tree/main/electron --vendor 'Jan [email protected]' --deb-priority optional --license MIT /home/leonard/Projekte/jan/jan/electron/dist/linux-unpacked/=/opt/Jan /home/leonard/Projekte/jan/jan/electron/dist/.icon-set/icon_16x16.png=/usr/share/icons/hicolor/16x16/apps/jan.png /home/leonard/Projekte/jan/jan/electron/dist/.icon-set/icon_32x32.png=/usr/share/icons/hicolor/32x32/apps/jan.png /home/leonard/Projekte/jan/jan/electron/dist/.icon-set/icon_48x48.png=/usr/share/icons/hicolor/48x48/apps/jan.png /home/leonard/Projekte/jan/jan/electron/dist/.icon-set/icon_64x64.png=/usr/share/icons/hicolor/64x64/apps/jan.png /home/leonard/Projekte/jan/jan/electron/dist/.icon-set/icon_128x128.png=/usr/share/icons/hicolor/128x128/apps/jan.png /home/leonard/Projekte/jan/jan/electron/dist/.icon-set/icon_256x256.png=/usr/share/icons/hicolor/256x256/apps/jan.png /home/leonard/Projekte/jan/jan/electron/icons/icon.png=/usr/share/icons/hicolor/512x512/apps/jan.png /run/user/1000/t-Boxdoz/2-Jan.desktop=/usr/share/applications/jan.desktop workingDir= error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed. Exit code: 1 Command: /nix/store/4bgg8j8275adawqbc5rkm4fv48dgg2i3-nodejs-18.18.2/bin/node Arguments: /nix/store/yickii092b1il40gdjd65nvwx32ss7rb-yarn-1.22.19/libexec/yarn/lib/cli.js build Directory: /home/leonard/Projekte/jan/jan/electron Output:

info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. make: *** [Makefile:50: build] Fehler 1

[nix-shell:~/Projekte/jan/jan]$ ls /home/leonard/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86_64/ fpm lib

[nix-shell:~/Projekte/jan/jan]$

Environment details

  • Operating System: NixOS
  • Jan Version: git master 4.1.2024
  • Processor: ryzon 7 5700 U
  • RAM: 64GB
  • Any additional relevant hardware specifics:
    • available dynamicly linked librarys: programs.nix-ld.enable = true; programs.nix-ld.libraries = with pkgs; [ p7zip fpm gcc libgcc libgccjit stdenv.cc.cc.lib libstdcxx5 ];
  • environement: nix-shell -p gnumake yarn

lomenzel avatar Jan 05 '24 22:01 lomenzel

Herm, can you try:

make clean
make dev

and then paste logs here

freelerobot avatar Jan 06 '24 03:01 freelerobot

yarn run v1.22.19 $ concurrently --kill-others "yarn dev:web" "wait-on http://localhost:3000 && yarn dev:electron" $ yarn workspace jan-web dev $ next dev [0] ▲ Next.js 14.0.1 [0] - Local: http://localhost:3000 [0] [0] ✓ Ready in 2.5s [0] ○ Compiling /page ... [0] ✓ Compiled /page in 10.7s (5523 modules) $ yarn copy:assets && yarn workspace jan dev $ cpx "models/" "electron/models/" && cpx "docs/openapi/" "electron/docs/openapi" $ tsc -p . && electron . [1] /home/leonard/Projekte/jan/jan/node_modules/electron/dist/electron: error while loading shared libraries: libgobject-2.0.so.0: cannot open shared object file: No such file or directory error Command failed with exit code 127. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed. [1] Exit code: 127 [1] Command: /nix/store/4bgg8j8275adawqbc5rkm4fv48dgg2i3-nodejs-18.18.2/bin/node [1] Arguments: /nix/store/yickii092b1il40gdjd65nvwx32ss7rb-yarn-1.22.19/libexec/yarn/lib/cli.js dev [1] Directory: /home/leonard/Projekte/jan/jan/electron [1] Output: [1] info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command. error Command failed with exit code 127. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. [1] wait-on http://localhost:3000 && yarn dev:electron exited with code 127 --> Sending SIGTERM to other processes.. [0] [0] yarn dev:web exited with code 1 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. make: *** [Makefile:33: dev] Fehler 1

[nix-shell:~/Projekte/jan/jan]$

Seems I need another shared library for dev

lomenzel avatar Jan 06 '24 08:01 lomenzel

make clean and make build still results in the original error

lomenzel avatar Jan 06 '24 08:01 lomenzel

i added now a bunch of ld-librarys, make build has still the same error but make dev now ends with:

yarn run v1.22.19 $ concurrently --kill-others "yarn dev:web" "wait-on http://localhost:3000 && yarn dev:electron" $ yarn workspace jan-web dev $ next dev [0] ▲ Next.js 14.0.1 [0] - Local: http://localhost:3000 [0] [0] ✓ Ready in 3s [0] ○ Compiling /page ... [0] ✓ Compiled /page in 10.8s (5523 modules) $ yarn copy:assets && yarn workspace jan dev $ cpx "models/" "electron/models/" && cpx "docs/openapi/" "electron/docs/openapi" $ tsc -p . && electron . [1] Gtk-Message: 10:40:05.530: Failed to load module "appmenu-gtk-module" [1] [165250:0100/000000.190017:ERROR:zygote_linux.cc(623)] Zygote could not fork: process_type gpu-process numfds 3 child_pid -1 [1] [165250:0100/000000.190220:ERROR:zygote_linux.cc(655)] write: Broken pipe (32) [1] /home/leonard/Projekte/jan/jan/node_modules/electron/dist/electron exited with signal SIGTRAP error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed. [1] Exit code: 1 [1] Command: /nix/store/4bgg8j8275adawqbc5rkm4fv48dgg2i3-nodejs-18.18.2/bin/node [1] Arguments: /nix/store/yickii092b1il40gdjd65nvwx32ss7rb-yarn-1.22.19/libexec/yarn/lib/cli.js dev [1] Directory: /home/leonard/Projekte/jan/jan/electron [1] Output: [1] info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. [1] wait-on http://localhost:3000 && yarn dev:electron exited with code 1 --> Sending SIGTERM to other processes.. [0] [0] yarn dev:web exited with code 1 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. make: *** [Makefile:33: dev] Fehler 1

[nix-shell:~/Projekte/jan/jan]$

lomenzel avatar Jan 07 '24 09:01 lomenzel

Hi @lomenzel, the prerequisites for building our app can be found here: https://github.com/janhq/jan?tab=readme-ov-file#pre-requisites. It requires Node.js version 20 or higher. From the log you uploaded, it appears you are using Node.js 18. Could you please upgrade to Node.js 20 and see if that resolves the issue? Thank you.

hiento09 avatar Jan 07 '24 13:01 hiento09

i tried node 20 and 21 both result in the same error

lomenzel avatar Jan 07 '24 14:01 lomenzel

Hello,

Could you possibly use a more common operating system like Ubuntu, Debian, Fedora, or CentOS? I attempted to replicate the issue by installing NixOS on our Proxmox cluster, but unfortunately, it was not successful. I will be closing this ticket here as we currently do not support or test on NixOS. Thank you for your interest in our product.

hiento09 avatar Jan 15 '24 18:01 hiento09