MuhammedKalkan / OpenLens

OpenLens Binary Build Repository
4.07k stars 272 forks source link

Linux aarch64 rpm won't install #103

Closed griffint61 closed 1 year ago

griffint61 commented 1 year ago

Trying to install the aarch64 rpm on AlmaLinux 9.1 (arm edition) gives this error:

Error: 
 Problem: conflicting requests
  - package open-lens-6.3.0-1.arm64 does not have a compatible architecture
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

I tried the three most recent builds, include 6.4.0-alpha.2

MuhammedKalkan commented 1 year ago

can you try with beta.9

griffint61 commented 1 year ago

I tried beta.12. The error is:

Error: 
 Problem: conflicting requests
  - package open-lens-6.4.0_beta.12-1.arm64 does not have a compatible architecture
MuhammedKalkan commented 1 year ago

try 6.4.0 release

griffint61 commented 1 year ago

Same error as before.

I was able to repair the rpm using the rpmrebuild utility as follows:

This was on done with AlmaLinux 9.1 system running on arm64.

griffint61 commented 1 year ago

The "repaired" RPM doesn't actually work. During startup the error is:

innerError Error: Cannot find module '../build/Debug/pty.node'
Require stack:
- /opt/OpenLens/resources/app.asar/node_modules/@k8slens/core/node_modules/node-pty/lib/unixTerminal.js
- /opt/OpenLens/resources/app.asar/node_modules/@k8slens/core/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
- 

I think what it really wants is ../build/Release/pty.node, which does actually exist.

jkroepke commented 1 year ago

If ../build/Release/pty.node is there, what about ldd ../build/Release/pty.node

Normaly, node-pty will look for Release first and on error, it tries to load Debug.

https://github.com/microsoft/node-pty/blob/aa26f321395e09913fd1829adff068bd647740a1/src/unixTerminal.ts#L15-L27

griffint61 commented 1 year ago

File pty.node exists under the Release directory.

ldd says it is "not a dynamic executable".

file says it is an "ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked"

So it looks to be the wrong architecture. It should be ARM 64. That would explain it.

I found the Release error later in the output. The way the try/catch is structured in UnixTerminal.ts, it reports out the Debug error (innerError) before reporting the Release error (outerError). Anyway the Release error is:

Error: /opt/OpenLens/resources/app.asar.unpacked/node_modules/@k8slens/core/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:5:1812)
    at Module._extensions..node (node:internal/modules/cjs/loader:1203:18)
    at Object.func [as .node] (node:electron/js2c/asar_bundle:5:2039)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:829:12)
    at c._load (node:electron/js2c/asar_bundle:5:13343)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/opt/OpenLens/resources/app.asar/node_modules/@k8slens/core/node_modules/node-pty/lib/unixTerminal.js:26:11)
    at Module._compile (node:internal/modules/cjs/loader:1118:14)
jkroepke commented 1 year ago

Hi,

i guess there are multiple errors here...

Maybe the arm64 vs aarch64 mismatch, it seems like an upstream error. Lens is using electron-builder to build rpm.

Here is a condition for if rpm, then aarch64: https://github.com/electron-userland/electron-builder/blob/f6944a3c123f0cee050cbd481cb0916ea46de46f/packages/builder-util/src/arch.ts#L79-L81

but some line above, an additional check for rpm is missing:

https://github.com/electron-userland/electron-builder/blob/f6944a3c123f0cee050cbd481cb0916ea46de46f/packages/builder-util/src/arch.ts#L19-L20

Maybe also is result into additional error. But this is an error, that we can not fix and even the Lens upstream project is not able to resolve the issue. It needs to be reported here: https://github.com/electron-userland/electron-builder

Similar error reported: https://github.com/MuhammedKalkan/OpenLens/issues/52


I may expect something similar with the second error, e.g. that the pty.node is an x86 binary. It seems like there are issues on cross compile, see also: https://github.com/electron-userland/electron-builder/pull/7465

Since GitHub is not proving any arm based runner, we are not able to solve that error. So local builds are the only rescue here.

Not sure, if only rpm is affected here or deb, too......


@MuhammedKalkan maybe its an good idea to disable linux arm build, since they are not usable.

jkroepke commented 1 year ago

@griffint61 The bug seems fixed upstream now. I guess it needs to released first in electron-builder and the new release needs to be included in Lens.

Thats everything what we can provide here.

dhaluza commented 1 year ago

A similar error is present in the arm64.deb package. please fix it. `open-lens innerError Error: Cannot find module '../build/Debug/pty.node' Require stack:

ds@debian:/opt/OpenLens$ ls -la итого 195432 drwxr-xr-x 4 root root 4096 мая 8 18:03 . drwxr-xr-x 5 root root 4096 мая 8 14:46 .. -rw-r--r-- 1 root root 128901 апр 13 04:45 chrome_100_percent.pak -rw-r--r-- 1 root root 180555 апр 13 04:45 chrome_200_percent.pak -rwxr-xr-x 1 root root 1092488 апр 13 04:45 chrome_crashpad_handler -rwsr-xr-x 1 root root 53200 апр 13 04:45 chrome-sandbox -rw-r--r-- 1 root root 10404784 апр 13 04:45 icudtl.dat -rwxr-xr-x 1 root root 242472 апр 13 04:45 libEGL.so -rwxr-xr-x 1 root root 2548480 апр 13 04:45 libffmpeg.so -rwxr-xr-x 1 root root 6158832 апр 13 04:45 libGLESv2.so -rwxr-xr-x 1 root root 17360552 апр 13 04:45 libvk_swiftshader.so -rwxr-xr-x 1 root root 5900816 апр 13 04:45 libvulkan.so.1 -rw-r--r-- 1 root root 1096 апр 13 04:45 LICENSE.electron.txt -rw-r--r-- 1 root root 5368255 апр 13 04:45 LICENSES.chromium.html drwxr-xr-x 2 root root 4096 мая 8 18:03 locales -rwxr-xr-x 1 root root 144481480 апр 13 04:45 open-lens drwxr-xr-x 5 root root 4096 мая 8 18:03 resources -rw-r--r-- 1 root root 5137800 апр 13 04:45 resources.pak -rw-r--r-- 1 root root 341936 апр 13 04:45 snapshot_blob.bin -rw-r--r-- 1 root root 665184 апр 13 04:45 v8_context_snapshot.bin -rw-r--r-- 1 root root 107 апр 13 04:45 vk_swiftshader_icd.json ds@debian:/opt/OpenLens$ cd resources ds@debian:/opt/OpenLens/resources$ ls -la итого 267064 drwxr-xr-x 5 root root 4096 мая 8 18:03 . drwxr-xr-x 4 root root 4096 мая 8 18:03 .. -rw-r--r-- 1 root root 273444966 апр 13 04:45 app.asar drwxr-xr-x 3 root root 4096 мая 8 18:03 app.asar.unpacked drwxr-xr-x 2 root root 4096 мая 8 18:03 arm64 drwxr-xr-x 3 root root 4096 мая 8 18:03 templates

`

jkroepke commented 1 year ago

@dhaluza thanks for sharing this, we not able to fix this.

jkroepke commented 1 year ago

Checkout the new 9.5 version, maybe its fixed.

DmarshalTU commented 10 months ago

same in 6.5:

sudo dnf install OpenLens-6.5.2-366.aarch64.rpm              
Last metadata expiration check: 0:12:51 ago on Sun 04 Feb 2024 04:15:08 PM PST.
allow_vendor_change is disabled. This option is currently not supported for downgrade and distro-sync commands
Error: 
 Problem: conflicting requests
  - package open-lens-6.5.2_366-1.arm64 from @commandline does not have a compatible architecture