libnacl icon indicating copy to clipboard operation
libnacl copied to clipboard

libsodium 1.0.19 is released: OSError: Could not locate nacl lib, searched for libsodium.so, libsodium.so.23, libsodium.so.18...

Open vt-alt opened this issue 1 year ago • 3 comments

FYI, libsodium 1.0.19 is released at Sep 13 2023, with soname changed to libsodium.so.26. This change makes module to fail with:

======================================================================
ERROR: unit.test_aead (unittest.loader._FailedTest.unit.test_aead)
----------------------------------------------------------------------
ImportError: Failed to import test module: unit.test_aead
Traceback (most recent call last):
  File "/usr/lib64/python3.11/unittest/loader.py", line 407, in _find_test_path
    module = self._get_module_from_name(name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/unittest/loader.py", line 350, in _get_module_from_name
    __import__(name)
  File "/usr/src/RPM/BUILD/python3-module-libnacl-1.7.1/tests/unit/test_aead.py", line 2, in <module>
    import libnacl.aead
  File "/usr/src/RPM/BUILD/python3-module-libnacl-1.7.1/libnacl/__init__.py", line 85, in <module>
    nacl = _get_nacl()
           ^^^^^^^^^^^
  File "/usr/src/RPM/BUILD/python3-module-libnacl-1.7.1/libnacl/__init__.py", line 81, in _get_nacl
    raise OSError(msg)
OSError: Could not locate nacl lib, searched for libsodium.so, libsodium.so.23, libsodium.so.18, libsodium.so.17, libsodium.so.13, libsodium.so.10, libsodium.so.5, libsodium.so.4,

Perhaps, __SONAMES list should be updated.

vt-alt avatar Sep 16 '23 01:09 vt-alt

  1. You message seems disappeared, maybe GitHub glitch?
  2. Sorry I didn't find any template when issue is opened. I used version 1.7.1 at the moment of filing but error is the same for 2.1.0 which I try to use now.
  3. I don't use Salt, I tried to update the ALT Linux python3-module-libnacl package for use with the new libsodium version (also updating from 1.7.1 to 2.1.0).

The dependency on libsodium is removed some versions ago, but it is used if available.

That's interesting! But it said Python ctypes wrapper for libsodium and libnacl does not have any non-python hard deps outside of libsodium. Also unittest fails without libsodium installed. Should I remove dependency for libsodium for the package? (But I wished tests do not fail in that case.)

vt-alt avatar Sep 18 '23 22:09 vt-alt

Assigned myself and then noticed not a salt repo issue, so removed myself. Salt has stopped needing libsodium as a dependency a few releases back, but will make use of it if present. This issue is more for the libnacl repository, which with Salt 3006.2 now using PyNaCl, doesn't matter as much to Salt anymore.

dmurphy18 avatar Sep 18 '23 23:09 dmurphy18

It may be a dumb question but if libnacl is compatible with libsodium v1.0.19, why not updating __SONAMES to look for libsodium.so.26 ?

Can't use libnacl on Alpine Linux v3.19 due to this issue.

roshii avatar May 19 '24 15:05 roshii