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

Validation action doesn't install OS-level libsodium #1224

Closed
qstokkink opened this issue Oct 12, 2023 · 2 comments · Fixed by #1225
Closed

Validation action doesn't install OS-level libsodium #1224

qstokkink opened this issue Oct 12, 2023 · 2 comments · Fixed by #1225
Labels
priority: medium Enhancements, features or exotic bugs

Comments

@qstokkink
Copy link
Collaborator

qstokkink commented Oct 12, 2023

Validation works just fine on ubuntu-latest. However, Windows and Mac still fail, causing other runners to cancel.

screenshot1

screenshot2

On Windows:

Run python run_all_tests.py -a
Traceback (most recent call last):
  File "D:\a\py-ipv8\py-ipv8\run_all_tests.py", line 261, in <module>
    test_class_names = find_all_test_class_names()
  File "D:\a\py-ipv8\py-ipv8\run_all_tests.py", line 246, in find_all_test_class_names
    test_class_names.extend(derive_test_class_names(found_test))
  File "D:\a\py-ipv8\py-ipv8\run_all_tests.py", line 230, in derive_test_class_names
    module_instance = importlib.import_module(module_name)
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "D:\a\py-ipv8\py-ipv8\ipv8\test\test_community.py", line 6, in <module>
    from ..community import Community, CommunitySettings
  File "D:\a\py-ipv8\py-ipv8\ipv8\community.py", line 21, in <module>
    from .lazy_community import EZPackOverlay, lazy_wrapper, lazy_wrapper_unsigned
  File "D:\a\py-ipv8\py-ipv8\ipv8\lazy_community.py", line 7, in <module>
    from .keyvault.crypto import default_eccrypto
  File "D:\a\py-ipv8\py-ipv8\ipv8\keyvault\crypto.py", line 9, in <module>
    from .private.libnaclkey import LibNaCLSK
  File "D:\a\py-ipv8\py-ipv8\ipv8\keyvault\private\libnaclkey.py", line 1, in <module>
    import libnacl
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\libnacl\__init__.py", line 87, in <module>
    nacl = _get_nacl()
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\libnacl\__init__.py", line 36, in _get_nacl
    raise OSError(msg)
OSError: Could not locate nacl lib, searched for libsodium
Error: Process completed with exit code 1.

On Mac:

Run python run_all_tests.py -a
Launching in 8 processes ... awaiting results ... test suite process crash! Segfault?

======================================================================

======================================================================
Summary:
[FAILED] Ran 0 tests in 0.0 seconds (0 seconds total in tests).
Error: Process completed with exit code 1.

At least the Windows failure relates to libsodium not being installed next to the Python dependencies. The Mac failure is assumed to be the same. Our own docs show what should be run.

The Tribler workflow shows how this can be done: https://github.com/Tribler/tribler/blob/main/.github/workflows/pytest.yml

@qstokkink qstokkink added the priority: medium Enhancements, features or exotic bugs label Oct 12, 2023
@qstokkink
Copy link
Collaborator Author

qstokkink commented Oct 13, 2023

I'm contemplating a python-cryptography-based workaround to implement LibNaCLSK and LibNaCLPK (ref).

@qstokkink
Copy link
Collaborator Author

The cryptography-based workaround works for Windows (implemented in #1225). However, MacOS still mysteriously crashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium Enhancements, features or exotic bugs
Development

Successfully merging a pull request may close this issue.

1 participant