chevah / pythia

Chevah's Python 3 distribution
MIT License
4 stars 2 forks source link

Build libxcrypt. #64

Open dumol opened 2 years ago

dumol commented 2 years ago

Unless glibc is built with --disable-crypt, it includes /usr/lib/libcrypt.so.1, which we link against.

However, at least on current Arch Linux and Amazon Linux 2022 (still in preview mode), this is not the case. Consequently, there's this error when trying to run our generic Linux runtime:

bash-5.1# ./bin/admin-commands.sh initialize --init-admin admin --init-password pass
Traceback (most recent call last):
  File "/opt/sftpplus/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/opt/sftpplus/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/opt/sftpplus-lnx-x64-4.17.0/lib/python2.7/site-packages/chevah/slim_server/__main__.py", line 10, in <module>
    from chevah.compat import local_filesystem
  File "/opt/sftpplus/lib/python2.7/site-packages/chevah/compat/__init__.py", line 15, in <module>
    from chevah.compat.unix_users import (
  File "/opt/sftpplus/lib/python2.7/site-packages/chevah/compat/unix_users.py", line 13, in <module>
    import crypt
ImportError: libcrypt.so.1: cannot open shared object file: No such file or directory

Current workaround is to install the OS-provided libxcrypt package, e.g. on Amazon Linux 2022 the package is named libxcrypt-compat.

A comprehensive solution would be to just build libxcrypt statically for generic Linux, as we do with other libs.

adiroiban commented 2 years ago

Thanks. For now it can be low priority, as we don't support Arch and Amazon 2022 is not yet public

dumol commented 3 weeks ago

Nowadays, this also affects RHEL 9 and derivatives.