MuhammedKalkan / OpenLens

OpenLens Binary Build Repository
4.07k stars 272 forks source link

Linux arm64 deb points to x86_64 pty.node #159

Closed thatguyatgithub closed 1 year ago

thatguyatgithub commented 1 year ago

Fresh install is not working with version 6.5.2-309-309

> open-lens   
innerError Error: Cannot find module '../build/Debug/pty.node'
Require stack:
- /opt/OpenLens/resources/app.asar/node_modules/node-pty/lib/unixTerminal.js
- /opt/OpenLens/resources/app.asar/node_modules/node-pty/lib/index.js
- /opt/OpenLens/resources/app.asar/node_modules/@k8slens/core/static/build/library/main.js
- /opt/OpenLens/resources/app.asar/static/build/main.js
- 
    at Module._resolveFilename (node:internal/modules/cjs/loader:963:15)
    at n._resolveFilename (node:electron/js2c/browser_init:2:109751)
    at Module._load (node:internal/modules/cjs/loader:811:27)
    at f._load (node:electron/js2c/asar_bundle:2:13330)
    at Module.require (node:internal/modules/cjs/loader:1035:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/opt/OpenLens/resources/app.asar/node_modules/node-pty/lib/unixTerminal.js:30:15)
    at Module._compile (node:internal/modules/cjs/loader:1141:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1196:10)
    at Module.load (node:internal/modules/cjs/loader:1011:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/opt/OpenLens/resources/app.asar/node_modules/node-pty/lib/unixTerminal.js',
    '/opt/OpenLens/resources/app.asar/node_modules/node-pty/lib/index.js',
    '/opt/OpenLens/resources/app.asar/node_modules/@k8slens/core/static/build/library/main.js',
    '/opt/OpenLens/resources/app.asar/static/build/main.js',
    undefined
  ]
}
A JavaScript error occurred in the main process
Uncaught Exception:
Error: /opt/OpenLens/resources/app.asar.unpacked/node_modules/node-pty/build/Release/pty.node: cannot open shared object file: No such file or directory
    at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:1822)
    at Module._extensions..node (node:internal/modules/cjs/loader:1226:18)
    at Object.func [as .node] (node:electron/js2c/asar_bundle:2:2049)
    at Module.load (node:internal/modules/cjs/loader:1011:32)
    at Module._load (node:internal/modules/cjs/loader:846:12)
    at f._load (node:electron/js2c/asar_bundle:2:13330)
    at Module.require (node:internal/modules/cjs/loader:1035:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/opt/OpenLens/resources/app.asar/node_modules/node-pty/lib/unixTerminal.js:26:11)
    at Module._compile (node:internal/modules/cjs/loader:1141:14)
[193532:0607/233710.223407:ERROR:gbm_wrapper.cc(255)] Failed to export buffer to dma_buf: No such file or directory (2)
[193532:0607/233710.223555:ERROR:gbm_wrapper.cc(255)] Failed to export buffer to dma_buf: No such file or directory (2)
[193532:0607/233710.223647:ERROR:gbm_wrapper.cc(255)] Failed to export buffer to dma_buf: No such file or directory (2)
[193532:0607/233710.223677:ERROR:gbm_wrapper.cc(255)] Failed to export buffer to dma_buf: No such file or directory (2)
[193532:0607/233710.223697:ERROR:gbm_wrapper.cc(255)] Failed to export buffer to dma_buf: No such file or directory (2)
[193532:0607/233710.223717:ERROR:gbm_wrapper.cc(255)] Failed to export buffer to dma_buf: No such file or directory (2)
[193532:0607/233710.223735:ERROR:gbm_wrapper.cc(255)] Failed to export buffer to dma_buf: No such file or directory (2)
[193532:0607/233710.224444:ERROR:gbm_wrapper.cc(255)] Failed to export buffer to dma_buf: No such file or directory (2)
[193532:0607/233710.224464:ERROR:gbm_wrapper.cc(255)] Failed to export buffer to dma_buf: No such file or directory (2)
[193532:0607/233710.224483:ERROR:gbm_wrapper.cc(255)] Failed to export buffer to dma_buf: No such file or directory (2)
[193532:0607/233710.224503:ERROR:gbm_wrapper.cc(255)] Failed to export buffer to dma_buf: No such file or directory (2)
[193532:0607/233710.224523:ERROR:gbm_wrapper.cc(255)] Failed to export buffer to dma_buf: No such file or directory (2)
[193532:0607/233710.224541:ERROR:gbm_wrapper.cc(255)] Failed to export buffer to dma_buf: No such file or directory (2)
[193532:0607/233710.224560:ERROR:gbm_wrapper.cc(255)] Failed to export buffer to dma_buf: No such file or directory (2)

File is present but it's built against x86_64 instead of target arch, Linux arm64 in this case:

        not a dynamic executable

─> file /opt/OpenLens/resources/app.asar.unpacked/node_modules/node-pty/build/Release/pty.node    
/opt/OpenLens/resources/app.asar.unpacked/node_modules/node-pty/build/Release/pty.node: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=eeb4c2c5dd10b9aaf3d07790fe81f90565ba2a34, not stripped
jkroepke commented 1 year ago

At the moment, it feels like an issue in the builder framework which is not in our control

> electron-builder --publish onTag --arm64
  • electron-builder  version=23.6.0 os=5.15.0-1038-azure
  • publishing will be skipped  reason=current build is a part of pull request solution=set env PUBLISH_FOR_PULL_REQUEST to true to force code signing
There are serious security concerns with PUBLISH_FOR_PULL_REQUEST=true (see the  CircleCI documentation (https://circleci.com/docs/1.0/fork-pr-builds/) for details)
If you have SSH keys, sensitive env vars or AWS credentials stored in your project settings and untrusted forks can make pull requests against your repo, then this option isn't for you.
  • loaded configuration  file=package.json ("build" field)
  • rebuilding native dependencies  dependencies=node-pty@0.10.1 platform=linux arch=arm64
  • packaging       platform=linux arch=arm64 electron=22.3.3 appOutDir=dist/linux-arm64-unpacked
  • downloading     url=https://github.com/electron/electron/releases/download/v22.3.3/electron-v22.3.3-linux-arm64.zip size=94 MB parts=4
  • downloaded      url=https://github.com/electron/electron/releases/download/v22.3.3/electron-v22.3.3-linux-arm64.zip duration=1.174s
  • building        target=AppImage arch=arm64 file=dist/OpenLens-6.5.2-314.arm64.AppImage
  • building        target=deb arch=arm64 file=dist/OpenLens-6.5.2-314.arm64.deb
  • building        target=rpm arch=arm64 file=dist/OpenLens-6.5.2-314.aarch64.rpm

 >  NX   Successfully ran target build:app for project open-lens and 36 tasks it depends on

   Nx read the output from the cache instead of running the command for 36 out of 37 tasks.

./open-lens/dist/linux-arm64-unpacked/resources/app.asar.unpacked/node_modules/node-pty/build/Release/pty.node:          ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=eeb4c2c5dd10b9aaf3d07790fe81f90565ba2a34, not stripped
./open-lens/dist/linux-arm64-unpacked/resources/app.asar.unpacked/node_modules/node-pty/bin/linux-x64-110/node-pty.node: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=eeb4c2c5dd10b9aaf3d07790fe81f90565ba2a34, not stripped
thatguyatgithub commented 1 year ago

Should I file this issue on https://github.com/lensapp/lens ? What do you suggest me doing?

jkroepke commented 1 year ago

You can try this, however not sure if they interest into cross-compile issues.


And the issue might be not in lens, except they are using outdated version. The root cause maybe in the tool electron-builder, which should handle the re-compile.

thatguyatgithub commented 1 year ago

And the issue might be not in lens, except they are using outdated version. The root cause maybe in the tool electron-builder, which should handle the re-compile.

Okey, makes tons of sense, do you have any clue what could I do to workaround this? I'm really really needing to make it work and it seems I'm so close that I want to cry.

jkroepke commented 1 year ago

Build lens on your local system could help

Grinch321 commented 1 year ago

Hello @jkroepke Did you able to built it on your local computer?

jkroepke commented 1 year ago

Yes. I able to build it on my mac machine

jkroepke commented 1 year ago

About the issue, I looked a bit deeper into it and I could figure out that just running "npm rebuild" wont work too. The error is somewhere outside electron-builder and lens... I can not identity the issue, why cross-compile works on Mac, but not on Linux

jkroepke commented 1 year ago

@thatguyatgithub @Grinch321

I created a possible solution in #160 .

Are you able to validate, if the arm64 binary build are working?

You can find the binary in https://github.com/MuhammedKalkan/OpenLens/actions/runs/5283410533 -> OpenLens-ubuntu-20.04

thatguyatgithub commented 1 year ago

Woohoo! You are a god! It workkks!

jkroepke commented 1 year ago

thanks for the confirmation

thatguyatgithub commented 1 year ago

Are you kidding, thanks to you for your awesome magic! <3 Thanks a bunch!

Grinch321 commented 1 year ago

it's working on my Chromebook , finally I will have lens on it. Many thanks to you)

Robing commented 1 year ago

@jkroepke I have the same issue,you builded the binary is Expired,do you have any url to download the binary? thx

jkroepke commented 1 year ago

Yeah sure, here https://github.com/MuhammedKalkan/OpenLens/releases/tag/v6.5.2-366