Skip to content

Worker pool fails to start when clice is executed via PATH: "no such file or directory" #358

@tsurumi-yizhou

Description

@tsurumi-yizhou

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

  1. Build clice and copy the binary to ~/.clice/
  2. Add ~/.clice to PATH: export PATH="$HOME/.clice:$PATH"
  3. Run clice from any directory other than ~/.clice/:
    cd /tmp
    clice --mode=pipe
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions