JezerM / nody-greeter

LightDM greeter that allows to create wonderful themes with web technologies. Made in Node.js
https://web-greeter-page.vercel.app
GNU General Public License v3.0
125 stars 8 forks source link

npm run build failing #31

Closed Crylia closed 1 year ago

Crylia commented 1 year ago

Environment

Steps to reproduce

Installed by building myself as describes in this repo

Literally no idea whats happening

Crylia commented 1 year ago

node -v: v16.17.0 npm -v: 8.15.0

Crylia commented 1 year ago

Noticed this when trying to run npm run build

╰─ npm run build

> nody-greeter@1.5.1 build
> npm run build:tsc && node make build

> nody-greeter@1.5.1 build:tsc
> tsc --build && npm run build:themes

> nody-greeter@1.5.1 build:themes
> npm run build:theme:gruvbox && npm run build:theme:dracula

> nody-greeter@1.5.1 build:theme:gruvbox
> tsc --build themes/themes/gruvbox

> nody-greeter@1.5.1 build:theme:dracula
> tsc --build themes/themes/dracula

Building with prefix: /usr
Bindings copied
✔ Bindings compiled succesfully
Resources copied
Installing packages with 'npm ci --production -s'
Error: Command failed: npm ci --production -s
    at checkExecSyncError (node:child_process:871:11)
    at Object.execSync (node:child_process:943:15)
    at create_build (/home/crylia/nody-greeter/build.js:157:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async build (/home/crylia/nody-greeter/build.js:352:3) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 135427,
  stdout: null,
  stderr: null
}
Node-gtk binding for electron found!
Binding copied
INSTALL_ROOT (build/unpacked) prepared
Creating 'asar' package in '/home/crylia/nody-greeter/build/unpacked/opt/nody-greeter/resources/app.asar'
✔ "asar" package created
SUCCESS!

I also switched to a different nodejs version for this one to rule that out (v18.9.0 and 8.19.1 for npm)

JezerM commented 1 year ago

Ah, this happens sometimes when re-building, but it's unusual. Just delete everything inside build/nody-asar and try again.

Crylia commented 1 year ago

I did it now a few times and also recloned but I'm still getting this error after npm run build:

✔ Bindings compiled succesfully
Resources copied
Installing packages with 'npm ci --production -s'
Packages installed
Node-gtk binding for electron found!
Binding copied
INSTALL_ROOT (build/unpacked) prepared
Creating 'asar' package in '/home/crylia/nody-greeter/build/unpacked/opt/nody-greeter/resources/app.asar'
⠦ Creating package.../home/crylia/nody-greeter/node_modules/asar/lib/filesystem.js:101
      throw new Error(`${p}: file "${link}" links out of the package`)
            ^

Error: /home/crylia/nody-greeter/build/nody-asar/node_modules/node-gtk/build/node_gyp_bins/python3: file "../../../../../usr/bin/python3.10" links out of the package
    at Filesystem.insertLink (/home/crylia/nody-greeter/node_modules/asar/lib/filesystem.js:101:13)
    at handleFile (/home/crylia/nody-greeter/node_modules/asar/lib/asar.js:132:20)
    at next (/home/crylia/nody-greeter/node_modules/asar/lib/asar.js:148:11)
    at next (/home/crylia/nody-greeter/node_modules/asar/lib/asar.js:149:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async build_asar (/home/crylia/nody-greeter/build.js:345:3)
    at async build (/home/crylia/nody-greeter/build.js:355:3)

Node.js v18.9.0
JezerM commented 1 year ago

That is an error from node-gyp-bins, related to #29. I have yet to find a solution for it.

jdkleuver commented 1 year ago

I'm getting the same error message:

✔ Bindings compiled succesfully
Resources copied
Installing packages with 'npm ci --production -s'
Packages installed
Node-gtk binding for electron found!
Binding copied
INSTALL_ROOT (build/unpacked) prepared
Creating 'asar' package in '/home/jack/code/nody-greeter/build/unpacked/opt/nody-greeter/resources/app.asar'
⠴ Creating package.../home/jack/code/nody-greeter/node_modules/asar/lib/filesystem.js:101
      throw new Error(`${p}: file "${link}" links out of the package`)
            ^

Error: /home/jack/code/nody-greeter/build/nody-asar/node_modules/node-gtk/build/node_gyp_bins/python3: file "../../../../../../usr/bin/python3.10" links out of the package
    at Filesystem.insertLink (/home/jack/code/nody-greeter/node_modules/asar/lib/filesystem.js:101:13)
    at handleFile (/home/jack/code/nody-greeter/node_modules/asar/lib/asar.js:132:20)
    at next (/home/jack/code/nody-greeter/node_modules/asar/lib/asar.js:148:11)
    at next (/home/jack/code/nody-greeter/node_modules/asar/lib/asar.js:149:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async build_asar (/home/jack/code/nody-greeter/build.js:345:3)
    at async build (/home/jack/code/nody-greeter/build.js:355:3)

Node.js v18.12.1

node -v: v18.12.1 npm -v: 9.2.0

Is there any known resolution for this yet?

JezerM commented 1 year ago

Check out if the latest commit 27495a5ccca1e2fa01b77f2134da482d4afde218 solves this issue.

jdkleuver commented 1 year ago

I was able to build successfully on the latest commit, I haven't tested it yet though

jdkleuver commented 1 year ago

Can confirm that it now works correctly when I run with --debug, however I'm having an unrelated issue where it refuses to run as root without --no-sandbox and I'm not sure how I can pass that option to the greeter through the lightdm.conf file.

JezerM commented 1 year ago

You can't run a browser, at least a chromium one, with root privilegies without adding the --no-sandbox flag. So, the same happens with web-greeter/nody-greeter.

Though, you don't need to add this flag in any config file as LightDM will run the greeter with its own user that doesn't have root privilegies. Hence, that "issue" should never occur in a real LightDM environment.

jdkleuver commented 1 year ago

My LightDM seems to try to run it as root, I get the following message in /var/log/lightdm/seat0-greeter.log

[1223/112240.943023:FATAL:electron_main_delegate.cc(290)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

So maybe my LightDM is not configured right

JezerM commented 1 year ago

Which distro u using?

jdkleuver commented 1 year ago

Gentoo, I fixed it now, I had to enable the non-root USE flag. But now it is all working fine!

JezerM commented 1 year ago

Oh, nais!