LPGhatguy / aftman

Aftman, the prodigal sequel to Foreman
MIT License
157 stars 16 forks source link

`aftman self-install` fails when libssl/libcrypto is not present on Linux #43

Closed jheinem1 closed 1 year ago

jheinem1 commented 1 year ago

Expected Behavior

aftman self-install should either install or prompt the user to install missing dependencies.

Actual Behavior

aftman self-install fails to install unless a very specific build of libssl and libcrypto are present in /usr/lib/.

Without openssl installed:

> ./aftman self-install
./aftman: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

With apt (or other incompatible) build of openssl installed and manually moved to /usr/lib/:

./aftman self-install
./aftman: symbol lookup error: /lib/libssl.so.1.1: undefined symbol: EVP_idea_cbc, version OPENSSL_1_1_0

With "correct" build of openssl installed

I found that the build of libssl and libcrpyo used by Steam were what aftman was expecting. Here's the steps to find and move these into the appropriate directory:

  1. Ensure you have Steam installed (proton may also be required, I haven't checked)
  2. Run find / -type f -name "libcrypto.so.1.1" 2>/dev/null (/dev/null simply removes error logs) for libcrypto and libssl respectively. Make sure the path contains something along the lines of SteamLinuxRuntime_soldier!
  3. Once you've located the path to one of the libcrypto or libssl builds on your system, e.g. ~/.steam/debian-installation/steamapps/common/SteamLinuxRuntime_soldier/var/tmp-M2O211/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1, use sudo cp <steam_libssl_dir> /usr/lib/ to copy the libssl and libcrypto build to your system library.
  4. Run sudo ldconfig to refresh libraries, though this isn't strictly necessary
  5. Run aftman self-install normally, and it should work!

Steps to reproduce

I've only confirmed this to affect debian/ubuntu, however neither libssl nor libcrypto are installed by default, and aftman does not appear to use the openssl package without modification, so the steps to reproduce are simply:

  1. Boot up any modern version of Ubuntu
  2. Try to use aftman self-install

It should also be noted that this will affect aftman's ability to install packages as well, even if manually installed. Building manually will work, however the package binaries aftman installs (e.g. rojo) will also fail to run with similar errors.

LPGhatguy commented 1 year ago

This is a common problem when building binaries for Linux and there's not a whole lot we can do. Newer versions of Ubuntu will fix support for newer versions of OpenSSL, which breaks support for older, still supported versions of Ubuntu.

Loading those dynamic dependencies dynamically and lazily is not a realistic option. Most projects are not going to be in a position to detect missing dynamic dependencies and help the user install them: there are just too many different system configurations.

As you've found, Steam games generally have the Linux binary distribution problem solved by using the Steam Runtime. It includes a number of libraries that games can assume will be installed. It is sad that the state of packaging on Linux has made that necessary, but that's where we are today.

If you're looking for great support for your particular distro, maintaining a PPA or building from source is your best bet.