Skip to content

PATH prefix ordering undefined; install creates ambiguity when multiple binaries exist #2014

Description

@Widthdom

Summary

The check_path() function at line 865 checks if INSTALL_DIR is anywhere in PATH (:${PATH}: substring search) but doesn't verify it's early enough in the PATH precedence order to actually be invoked. If a user has an older binary in /usr/bin and installs a new one to ~/.local/bin but ~/.local/bin comes after /usr/bin in PATH, the shell will invoke the older version without warning. The install script suggests prepending INSTALL_DIR to PATH (line 876) but doesn't verify this suggestion was followed, nor does it detect if an earlier PATH entry shadows the newly installed binary.

Where

  • install.sh:865-892 (check_path function)
  • install.sh:876 (PATH prepend suggestion)
  • install.sh:668-673 (existing binary detection)

Suggested approach

  1. After successful install, resolve the active binary path via command -v or type -p and verify it points to the newly installed $EXISTING_BIN
  2. If it returns a different path, warn that a shadowing binary exists earlier in PATH
  3. Parse PATH entries in order (: delimited) and check each for an executable
  4. If shadowing is detected, print the full chain of binaries found and their versions
  5. Offer automated PATH reordering (with user consent) to prepend INSTALL_DIR if not already first
  6. Test the resolved binary path against the installed binary path to confirm no shadowing remains

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions