Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/v0.7.0_validate_changed_files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
run: |
source "$UNIQUE_VENV_PATH/bin/activate"
python -m pip install --upgrade pip
pip install uv poetry toml
pip install uv poetry toml meson-python

# ────────────────────────────────────────────────────────────────────────
# Step: Ruff Format (package_path only)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
c_ubyte,
c_ulonglong,
)
from ctypes.util import find_library
from functools import lru_cache
from typing import Any, Dict, Iterable, Literal, Optional

Expand Down Expand Up @@ -90,12 +91,33 @@ def _load_libsodium() -> CDLL:
if env and os.path.exists(env):
return CDLL(env)

# Try to locate libsodium via the system's library resolver
libname = find_library("sodium")
if libname:
try:
return CDLL(libname)
except OSError:
pass

# Try system-installed libsodium
names: list[str]
if sys.platform.startswith("linux"):
names = ["libsodium.so.23", "libsodium.so"]
names = [
"libsodium.so.26",
"libsodium.so.25",
"libsodium.so.24",
"libsodium.so.23",
"libsodium.so",
]
elif sys.platform == "darwin":
names = ["libsodium.23.dylib", "libsodium.dylib", "lib/libsodium.dylib"]
names = [
"libsodium.26.dylib",
"libsodium.25.dylib",
"libsodium.24.dylib",
"libsodium.23.dylib",
"libsodium.dylib",
"lib/libsodium.dylib",
]
elif sys.platform.startswith("win"):
names = ["libsodium.dll", "sodium.dll"]
else:
Expand Down
Loading