Skip to content

install.sh doesn't put ant on PATH — ant --version fails on a fresh shell after a successful install (install.ps1 already adds to PATH) #194

Description

@JimCollinson

Problem

After a successful install.sh run, ant can be missing from PATH, so the very next documented step — ant --version — fails with command-not-found. The quickstart and the new agent-tools page on developers.autonomi.com both show ant --version immediately after the install line, so this is a first-contact failure on exactly the onboarding path.

The install directory is not reliably on PATH, and on macOS neither default is clean on a fresh machine:

  • Linux default ~/.local/bin — user-writable, but not on $PATH on some distros/shells until the user adds it.
  • macOS: the script's own default is /usr/local/bin (on the default PATH, but root-owned and not writable without Homebrew, so the cp fails with no sudo). Setting INSTALL_DIR="$HOME/.local/bin" — which the docs/site use to avoid that permission failure — makes the install succeed, but ~/.local/bin is not on the default macOS PATH.

install.sh does detect this and prints a warning plus the export PATH="…" line, so it's friction rather than silent breakage. But install.ps1 already solves the equivalent on Windows — it installs to %LOCALAPPDATA%\ant\bin and adds that to the user PATH permanently ([Environment]::SetEnvironmentVariable("Path", …, "User")). The two platforms have different contracts: Windows lands the tool ready to run; unix leaves the user a manual step.

Impact

Fresh-machine developers and their agents follow "install, then ant --version" and hit command-not-found on macOS/Linux until they edit PATH by hand — the weakest moment of the onboarding flow, and the one the developer site leads with.

Suggested fix

Bring install.sh to parity with install.ps1:

  • Default to a user-writable dir ($HOME/.local/bin) so it never needs sudo.
  • Offer to add that dir to PATH, opt-in, the way rustup does: detect the shell ($SHELL~/.zshrc on modern macOS, else ~/.bashrc / ~/.profile), append an export PATH="$HOME/.local/bin:$PATH" line if it isn't already present, print exactly what it will change, and support a --no-modify-path escape that falls back to today's print-the-line behaviour.

Verified

install.sh at ant-cli-v0.3.6 reads INSTALL_DIR (default ~/.local/bin on Linux, /usr/local/bin on macOS via default_install_dir) and prints the PATH warning when that dir isn't on $PATH — confirmed from source and a Linux run (5 Sept 2026). The macOS specifics (/usr/local/bin not user-writable on Apple Silicon; ~/.local/bin not on the default PATH) are standard macOS behaviour, not run on a Mac in this check.

Related, separate

  • Distribute the ant CLI via npm #190 (distribute ant via npm) would sidestep this for the npm route — npm install -g uses a bin dir already on PATH — so if Distribute the ant CLI via npm #190 lands first this becomes moot for most users; the install.sh parity is still worth having for the curl | bash route.
  • The already-noted "checksum verification inside install.sh / install.ps1" follow-up.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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