Describe the bug
When running clice from a directory that is in the system PATH (e.g., ~/.clice/clice added to PATH), the server fails to start w
ith the error:
failed to start worker pool: no such file or directory
The root cause is that resolve_self_path() in src/clice.cc uses std::filesystem::absolute(argv[0]) to determine the executable p
ath. When argv[0] is just "clice" (no path separators), absolute() resolves it relative to the current working directory, not th
e actual location of the executable in PATH. This causes spawn_worker() to fail when trying to launch worker processes.
To Reproduce
- Build clice and copy the binary to ~/.clice/
- Add ~/.clice to PATH: export PATH="$HOME/.clice:$PATH"
- Run clice from any directory other than ~/.clice/:
cd /tmp
clice --mode=pipe
- See error: failed to start worker pool: no such file or directory
Expected behavior
clice should correctly resolve its executable path regardless of how it is invoked (absolute path, relative path, or via PATH).
When argv[0] contains no path separators, it should search the PATH environment variable to find the actual executable location.
Desktop:
- OS: macOS 15
- Version latest main branch
Describe the bug
When running clice from a directory that is in the system PATH (e.g., ~/.clice/clice added to PATH), the server fails to start w
ith the error:
failed to start worker pool: no such file or directory
The root cause is that resolve_self_path() in src/clice.cc uses std::filesystem::absolute(argv[0]) to determine the executable p
ath. When argv[0] is just "clice" (no path separators), absolute() resolves it relative to the current working directory, not th
e actual location of the executable in PATH. This causes spawn_worker() to fail when trying to launch worker processes.
To Reproduce
cd /tmp
clice --mode=pipe
Expected behavior
clice should correctly resolve its executable path regardless of how it is invoked (absolute path, relative path, or via PATH).
When argv[0] contains no path separators, it should search the PATH environment variable to find the actual executable location.
Desktop: