Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maybe include glibc in appimage, for better(?) compatibility #7997

Closed
RichardGantz opened this issue Oct 2, 2022 · 11 comments
Closed

maybe include glibc in appimage, for better(?) compatibility #7997

RichardGantz opened this issue Oct 2, 2022 · 11 comments

Comments

@RichardGantz
Copy link

RichardGantz commented Oct 2, 2022

The following error is thrown after the start of electrum-4.3.2-x86_64.AppImage on Linux Mint Tricia 19.3:

/tmp/.mount_electrM7XUA6/usr/bin/python3: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.28' not found (required by /tmp/.mount_electrM7XUA6/usr/lib/libpython3.9.so.1.0)

This may be because the Linux Mint 19.3 distribution did not manage to update GLIBC to a version beyond 2.27

Would it be possible to include the needed GLIBC v2.28 in the AppImage?

Thank you so much for all your efforts for all of us.
Thank you!
richard

@SomberNight
Copy link
Member

Right... We've recently (#7926, in 4.3.2) changed the builder image base from ubuntu 18.04 to debian 10.
ubuntu 18.04 ships glibc 2.27
debian 10 ships glibc 2.28
looks like Linux Mint 19.3 is ~based on ubuntu 18.04

so the 4.3.2 appimage does not run on ubuntu 18.04 :/

I don't know what the consequences of bundling glibc would be. It is not done by default when using appimagetool.

related:
qbittorrent/qBittorrent#17283
https://discourse.appimage.org/t/specify-required-glibc-version-in-appimage/2413

@SomberNight SomberNight changed the title electrum-4.3.2-x86_64.AppImage does not start on Linux Mint Tricia 19.3 maybe include glibc in appimage, for better(?) compatibility Oct 5, 2022
@JazzTp
Copy link

JazzTp commented Nov 5, 2022

Ubuntu 18.04 here, same problem of course.

I wonder if there is any a chance that two versions of the AppImage are built and offered for download, e.g.

electrum-4.3.2-x86_64.AppImage
electrum-4.3.2-x86_64_GLIBC2.28.AppImage

(This glibc problem is alas what makes Linux "a moving target" to be avoided for many hardware vendors, e.g. of audio interfaces. It would be great if the Linux community could find a solution.)

@JazzTp
Copy link

JazzTp commented Feb 10, 2023

I admit that I had arrived here looking for solutions for the same problem with another application, MuseScore4, which requires glibc-2.29.

It turns out that they also distribute MuseScore4 as Flatpak, which solved the problem, their software installed via Flatpak works fine on Ubuntu 18.04.5.

Before finding that out, I had learned how to get and build and install other glibc versions without breaking the system.
I had tried that out with both MuseScore4 (glibc-2.29) and Electrum 4.3.4 (glibc-2.28).

Basically (notice that this didn't work out), after retrieving glibc-2.28 and building and installing it into a non-root tree (which was trivial (*) per se once I found the info on how to do it, and took less than 5 minutes if building using all the CPU cores on this old PC), I'd launch a script containing:

#!/bin/bash

previous="$LD_LIBRARY_PATH"


if [ "$LD_LIBRARY_PATH" == "" ]
then
	export LD_LIBRARY_PATH="/home/myUser/.local/lib/glibc-2.28/lib:/usr/lib"
else
	export LD_LIBRARY_PATH="/home/myUser/.local/lib/glibc-2.28/lib:$LD_LIBRARY_PATH"
fi

/home/myUser/.local/lib/glibc-2.28/lib/ld-linux-x86-64.so.2 --library-path /home/myUser/.local/lib/glibc-2.28/lib ~/pathToManuallyInstalledAppImages/electrum-4.3.4-x86_64.AppImage

export LD_LIBRARY_PATH="$previous"

Result:

/home/myUser/pathToManuallyInstalledAppImages/electrum-4.3.4-x86_64.AppImage: error while loading shared libraries: /home/myUser/pathToManuallyInstalledAppImages/electrum-4.3.4-x86_64.AppImage: ELF file ABI version invalid

I upgraded the system and rebuilt glibc-2.28, same error.

Maybe I should search for glibc-2.28 binaries built on a glibc-2.28 Linux, or install Fedora (11?) [EDIT: Debian 10] on another disk/PC and build glibc-2.28 on it (if it's not already coming with glibc-2.28).

Anyways, I searched for info and here I found a link to this page explaining the origin of that version matching requirement (something of doubtful utility IMO introduced in 2010 to allow one binary build to cover optimizations for different variants of sparc64 CPUs instead of automating the build of different binaries, making Linux even more of a moving target).

Anyways the only "solution" I found was to switch to a more recent Linux distribution, which I don't want to do on this PC, so it's not a solution (the "moving target" philosophy contributes to hardware vendors taking the decision not to provide their software for Linux as well, e.g. Focusrite).

(*) I see that there's a less trivial way to build glibc, which includes also building gcc, in this page chapter "Setup 2: crosstool-NG pristine setup".

Of course I wouldn't take that path without having checked how that works, in order to be sure that I'm only creating a "local" glibc-2.28 and I'm not damaging the system.


Exactly the same happened with MuseScore4 and glibc-2.29, except that later I realized that they offer a Flatpak alternative which works fine (including MIDI input/output via USB and audio output).

After the (extremely slow) download of the necessary components, this turns the startup script into:

flatpak run org.musescore.MuseScore

Bottom line:

Maybe Electrum could offer a flatpak alternative as well, but I don't have any idea what amount of work / trouble that would imply so I'm not really asking, I'm just reporting about a similar situation for which that alternative was offered, and the developers will evaluate (if they haven't already).

I am well aware that Electrum already offers python (3.8) source code among the download options.

@JazzTp
Copy link

JazzTp commented Feb 10, 2023

Update: I wanted to give a quick try and run Electrum via python3.8.

I went to the Electrum download page and followed the instructions, starting with the dependencies:

$ sudo apt-get install python3-pyqt5 libsecp256k1-0 python3-cryptography
[sudo] password for myUser: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libsecp256k1-0 is already the newest version (0.1~20170810-1).
python3-pyqt5 is already the newest version (5.10.1+dfsg-1ubuntu2).
python3-cryptography is already the newest version (2.1.4-1ubuntu1.4).
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.

I downloaded and built python3.8 from source as explained in this page, I used the "altinstall" recommendation not to override the system python (that might be part of the problem).

I downloaded the Electrum Python sources and checked the signature (but used curl because with wget I was getting time out error after a long while [that happened for the first time a few weeks ago on another website and in that case as well curl did it]).

I extracted and tried to run Electrum:

$ python3.8 Electrum-4.3.4/run_electrum
Error: at least one of ('pycryptodomex', 'cryptography') needs to be installed.

I double-checked the dependencies, same result.
I tried again to launch, same result.

I installed python3-pycryptodome (3.4.7-1ubuntu1), without the ending x, same error trying to launch Electrum.

Is there a python command I should issue to install at least one of ('pycryptodomex', 'cryptography') so that the python3.8 altinstall can use it?

@SomberNight
Copy link
Member

Is there a python command I should issue to install at least one of ('pycryptodomex', 'cryptography') so that the python3.8 altinstall can use it?

The python3-* apt packages are packaged for the system python. I think the easiest solution is to use pip instead of apt here.

$ python3.8 -m pip install --user cryptography pyqt5

@JazzTp
Copy link

JazzTp commented Feb 10, 2023

Is there a python command I should issue to install at least one of ('pycryptodomex', 'cryptography') so that the python3.8 altinstall can use it?

The python3-* apt packages are packaged for the system python. I think the easiest solution is to use pip instead of apt here.

$ python3.8 -m pip install --user cryptography pyqt5

Thank you @SomberNight!
I'll report later, for now it seems stuck here:

$ python3.8 -m pip install --user cryptography pyqt5
Collecting cryptography
  Downloading https://files.pythonhosted.org/packages/6a/f5/a729774d087e50fffd1438b3877a91e9281294f985bda0fd15bf99016c78/cryptography-39.0.1.tar.gz (603kB)
     |████████████████████████████████| 604kB 117kB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting pyqt5
  Downloading https://files.pythonhosted.org/packages/5c/46/b4b6eae1e24d9432905ef1d4e7c28b6610e28252527cdc38f2a75997d8b5/PyQt5-5.15.9.tar.gz (3.2MB)
     |████████████████████████████████| 3.2MB 2.8MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... \

I'll leave the PC on it for a while (but eventually might ctrl-c that and issue the same command again).

@SomberNight
Copy link
Member

Hmm. It's weird that it's trying to build from source instead of using a pre-built wheel (which is the default behaviour).
What CPU architecture do you have on this machine? I guess it is not amd64/x86_64.

@JazzTp
Copy link

JazzTp commented Feb 10, 2023

Hmm. It's weird that it's trying to build from source instead of using a pre-built wheel (which is the default behaviour). What CPU architecture do you have on this machine? I guess it is not amd64/x86_64.

It's AMD64, but I got warnings about the version of pip recommending an upgrade, which I did like this (no sudo => permissions error):

sudo -H time python3.8 -m pip install --upgrade pip

Afterwards I could install cryptography and pyqt5 very quickly, thank you.

Electrum starts, apparently it lacks libraries for Ledger / Trezor devices:

$ python3.8 Electrum-4.3.4/run_electrum 
  4.23 | E | p/plugin.Plugins | cannot load plugin for: bitbox02
Traceback (most recent call last):
  File "/home/myUser/Electrum-4.3.4/electrum/plugin.py", line 122, in load_plugin
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/myUser/Electrum-4.3.4/electrum/plugins/bitbox02/qt.py", line 22, in <module>
    from .bitbox02 import BitBox02Plugin
  File "/home/myUser/Electrum-4.3.4/electrum/plugins/bitbox02/bitbox02.py", line 5, in <module>
    import hid
ModuleNotFoundError: No module named 'hid'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/myUser/Electrum-4.3.4/electrum/plugin.py", line 173, in get_hardware_support
    p = self.get_plugin(name)
  File "/home/myUser/Electrum-4.3.4/electrum/plugin.py", line 207, in get_plugin
    self.load_plugin(name)
  File "/home/myUser/Electrum-4.3.4/electrum/plugin.py", line 125, in load_plugin
    raise Exception(f"Error loading {name} plugin: {repr(e)}") from e
Exception: Error loading bitbox02 plugin: ModuleNotFoundError("No module named 'hid'")
  4.23 | E | plugins.coldcard.coldcard | error importing coldcard plugin deps
Traceback (most recent call last):
  File "/home/myUser/Electrum-4.3.4/electrum/plugins/coldcard/coldcard.py", line 29, in <module>
    import hid
ModuleNotFoundError: No module named 'hid'
  4.24 | E | plugins.jade.jade | error importing Jade plugin deps
Traceback (most recent call last):
  File "/home/myUser/Electrum-4.3.4/electrum/plugins/jade/jade.py", line 34, in <module>
    from .jadepy.jade import JadeAPI
  File "/home/myUser/Electrum-4.3.4/electrum/plugins/jade/jadepy/__init__.py", line 1, in <module>
    from .jade import JadeAPI
  File "/home/myUser/Electrum-4.3.4/electrum/plugins/jade/jadepy/jade.py", line 1, in <module>
    import cbor
ModuleNotFoundError: No module named 'cbor'
  4.29 | W | gui.qt.installwizard.InstallWizard | error getting device infos for coldcard: Missing libraries for coldcard. //     ModuleNotFoundError("No module named 'ckcc'") // Make sure you install it with python3
  4.29 | W | gui.qt.installwizard.InstallWizard | error getting device infos for digitalbitbox: Missing libraries for digitalbitbox. // Make sure you install it with python3
  4.29 | W | gui.qt.installwizard.InstallWizard | error getting device infos for jade: Missing libraries for jade. //     ModuleNotFoundError("No module named 'cbor'") // Make sure you install it with python3
  4.29 | W | gui.qt.installwizard.InstallWizard | error getting device infos for keepkey: Missing libraries for keepkey. // Make sure you install it with python3
  4.29 | W | gui.qt.installwizard.InstallWizard | error getting device infos for ledger: Missing libraries for ledger. //     ModuleNotFoundError("No module named 'ledger_bitcoin'") // Make sure you install it with python3
  4.29 | W | gui.qt.installwizard.InstallWizard | error getting device infos for safe_t: Missing libraries for safe_t. //     ModuleNotFoundError("No module named 'safetlib'") // Make sure you install it with python3
  4.29 | W | gui.qt.installwizard.InstallWizard | error getting device infos for trezor: Missing libraries for trezor. //     ModuleNotFoundError("No module named 'trezorlib'") // Make sure you install it with python3
(failed reverse-i-search)`nano': python3.8 Electrum-4.3.4/ru^Celectrum 

I'm going to see if I can install all those requirements the same way.

@JazzTp
Copy link

JazzTp commented Feb 10, 2023

Update:

$ python3.8 -m pip install --user ckcc
ERROR: Could not find a version that satisfies the requirement ckcc (from versions: none)
ERROR: No matching distribution found for ckcc
$ python3.8 -m pip install --user cbor
Collecting cbor
  Using cached cbor-1.0.0.tar.gz (20 kB)
  Preparing metadata (setup.py) ... done
Installing collected packages: cbor
  DEPRECATION: cbor is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for cbor ... done
Successfully installed cbor-1.0.0
$ python3.8 -m pip install --user ledger_bitcoin
Collecting ledger_bitcoin
  Using cached ledger_bitcoin-0.1.2-py3-none-any.whl (75 kB)
Collecting packaging>=21.3
  Using cached packaging-23.0-py3-none-any.whl (42 kB)
Collecting ledgercomm>=1.1.0
  Downloading ledgercomm-1.1.2-py3-none-any.whl (10 kB)
Collecting typing-extensions>=3.7
  Using cached typing_extensions-4.4.0-py3-none-any.whl (26 kB)
Installing collected packages: typing-extensions, packaging, ledgercomm, ledger_bitcoin
Successfully installed ledger_bitcoin-0.1.2 ledgercomm-1.1.2 packaging-23.0 typing-extensions-4.4.0
$ python3.8 -m pip install --user safetlib
ERROR: Could not find a version that satisfies the requirement safetlib (from versions: none)
ERROR: No matching distribution found for safetlib
$ python3.8 -m pip install --user trezorlib
ERROR: Could not find a version that satisfies the requirement trezorlib (from versions: none)
ERROR: No matching distribution found for trezorlib

@JazzTp
Copy link

JazzTp commented Feb 10, 2023

Update: I launched it again anyways to see possible incompatibilities in what could be installed.
( Well, the flatpak way is probably easier for the user :D )

$ python3.8 Electrum-4.3.4/run_electrum 
  3.31 | E | p/plugin.Plugins | cannot load plugin for: bitbox02
Traceback (most recent call last):
  File "/home/myUser/Electrum-4.3.4/electrum/plugin.py", line 122, in load_plugin
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/myUser/Electrum-4.3.4/electrum/plugins/bitbox02/qt.py", line 22, in <module>
    from .bitbox02 import BitBox02Plugin
  File "/home/myUser/Electrum-4.3.4/electrum/plugins/bitbox02/bitbox02.py", line 5, in <module>
    import hid
ModuleNotFoundError: No module named 'hid'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/myUser/Electrum-4.3.4/electrum/plugin.py", line 173, in get_hardware_support
    p = self.get_plugin(name)
  File "/home/myUser/Electrum-4.3.4/electrum/plugin.py", line 207, in get_plugin
    self.load_plugin(name)
  File "/home/myUser/Electrum-4.3.4/electrum/plugin.py", line 125, in load_plugin
    raise Exception(f"Error loading {name} plugin: {repr(e)}") from e
Exception: Error loading bitbox02 plugin: ModuleNotFoundError("No module named 'hid'")
  3.32 | E | plugins.coldcard.coldcard | error importing coldcard plugin deps
Traceback (most recent call last):
  File "/home/myUser/Electrum-4.3.4/electrum/plugins/coldcard/coldcard.py", line 29, in <module>
    import hid
ModuleNotFoundError: No module named 'hid'
  3.33 | E | plugins.jade.jade | error importing Jade plugin deps
Traceback (most recent call last):
  File "/home/myUser/Electrum-4.3.4/electrum/plugins/jade/jade.py", line 34, in <module>
    from .jadepy.jade import JadeAPI
  File "/home/myUser/Electrum-4.3.4/electrum/plugins/jade/jadepy/__init__.py", line 1, in <module>
    from .jade import JadeAPI
  File "/home/myUser/Electrum-4.3.4/electrum/plugins/jade/jadepy/jade.py", line 16, in <module>
    from .jade_serial import JadeSerialImpl
  File "/home/myUser/Electrum-4.3.4/electrum/plugins/jade/jadepy/jade_serial.py", line 1, in <module>
    import serial
ModuleNotFoundError: No module named 'serial'
  3.37 | E | plugins.ledger.ledger | error importing ledger plugin deps
Traceback (most recent call last):
  File "/home/myUser/Electrum-4.3.4/electrum/plugins/ledger/ledger.py", line 39, in <module>
    import hid
ModuleNotFoundError: No module named 'hid'
  3.38 | W | plugins.ledger.qt.Plugin | Library version for 'ledger' is incompatible.
Installed: 0.1.2, Needed: 0.1.1 <= x < inf
  3.38 | W | gui.qt.installwizard.InstallWizard | error getting device infos for coldcard: Missing libraries for coldcard. //     ModuleNotFoundError("No module named 'ckcc'") // Make sure you install it with python3
  3.38 | W | gui.qt.installwizard.InstallWizard | error getting device infos for digitalbitbox: Missing libraries for digitalbitbox. // Make sure you install it with python3
  3.38 | W | gui.qt.installwizard.InstallWizard | error getting device infos for jade: Missing libraries for jade. //     ModuleNotFoundError("No module named 'serial'") // Make sure you install it with python3
  3.38 | W | gui.qt.installwizard.InstallWizard | error getting device infos for keepkey: Missing libraries for keepkey. // Make sure you install it with python3
  3.38 | W | gui.qt.installwizard.InstallWizard | error getting device infos for ledger: Library version for 'ledger' is incompatible. // Installed: 0.1.2, Needed: 0.1.1 <= x < inf // Make sure you install it with python3
  3.39 | W | gui.qt.installwizard.InstallWizard | error getting device infos for safe_t: Missing libraries for safe_t. //     ModuleNotFoundError("No module named 'safetlib'") // Make sure you install it with python3
  3.39 | W | gui.qt.installwizard.InstallWizard | error getting device infos for trezor: Missing libraries for trezor. //     ModuleNotFoundError("No module named 'trezorlib'") // Make sure you install it with python3

The Electrum 4.3.1 AppImage is working correctly on Ubuntu 18.04.6 as far as I can tell.

@RichardGantz
Copy link
Author

RichardGantz commented Jun 27, 2023

After an upgrade from Linux Mint 19.3 to 20.3 the AppImages run fine.
Since in my realm there are no more Linux Mint 19.3 Installations, i will close this issue now.
Thank you very much for your attention and all your help and workarounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants