Summary
kwave.download_binaries writes the downloaded binary via urlretrieve without setting the executable bit. On Linux / macOS pip installs, the binary lands at 0644 and kspaceFirstOrder-CUDA --version fails with Permission denied (exit 126).
This has likely been latently broken for a long time — masked by either (a) users hitting the _is_binary_present cache path from a prior install where perms got set by pip install itself extracting an executable from a wheel, or (b) typical end users never running the binary directly (the cpp backend goes through subprocess.run which exposes the failure).
Reproduction
Fresh venv on Linux (Colab, Ubuntu 22.04):
pip install -q "k-wave-python==<some version pinning Linux binaries>"
BIN=$(python -c 'import kwave, os; print(os.path.join(kwave.BINARY_PATH, "kspaceFirstOrder-CUDA"))')
$BIN --version
# bash: ...: Permission denied
# exit=126
ls -l $BIN shows -rw-r--r--.
Fix
In kwave/__init__.py download_binaries, after urlretrieve(url, binary_filepath):
import stat
if PLATFORM != "windows":
current = os.stat(binary_filepath).st_mode
os.chmod(binary_filepath, current | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
Surfaced while validating v1.4.0 binaries for v0.6.2 release (#739); needs to land before tag.
Summary
kwave.download_binarieswrites the downloaded binary viaurlretrievewithout setting the executable bit. On Linux / macOS pip installs, the binary lands at 0644 andkspaceFirstOrder-CUDA --versionfails withPermission denied(exit 126).This has likely been latently broken for a long time — masked by either (a) users hitting the
_is_binary_presentcache path from a prior install where perms got set bypip installitself extracting an executable from a wheel, or (b) typical end users never running the binary directly (the cpp backend goes throughsubprocess.runwhich exposes the failure).Reproduction
Fresh venv on Linux (Colab, Ubuntu 22.04):
ls -l $BINshows-rw-r--r--.Fix
In
kwave/__init__.pydownload_binaries, afterurlretrieve(url, binary_filepath):Surfaced while validating v1.4.0 binaries for v0.6.2 release (#739); needs to land before tag.