Skip to content

Look up uv only in absolute PATH directories - #84

Open
morisil wants to merge 2 commits into
mainfrom
issue-72-path-empty-entry
Open

morisil wants to merge 2 commits into
mainfrom
issue-72-path-empty-entry

Conversation

@morisil

@morisil morisil commented Nov 11, 2026

Copy link
Copy Markdown
Member

Fixes #72

uv is now looked up only in absolute PATH directories: an empty entry (PATH=/usr/bin:, ::), ., or another relative entry no longer resolves to the JVM working directory, where a planted uv would run as the installer of every dependency.

  • executableCandidates(name, path, windows) keeps only absolute PATH directories; on Windows it considers only uv.exe (an extension-less shim there fails with error 193), elsewhere only uv.
  • findOnPath also requires a regular file, so a directory named uv is not picked.
  • Testable without touching the process environment (PATH value and platform as parameters).
  • KDoc and README say which entries are skipped and why.

Review

1 round — no blocking findings (Windows forms C:\tools, UNC paths, trailing separators keep working; drive-relative C:tools / root-relative \tools are now skipped, as they're relative too). Polish applied: regular-file check, .exe on Windows, wording.

Follow-ups

🤖 Generated with Claude Code

https://claude.ai/code/session_01FJmHQ3jHRbVdpwUiNUkApG

morisil and others added 2 commits November 11, 2026 23:40
An empty or relative PATH entry (e.g. PATH=/usr/bin:) resolved against
the JVM working directory, so a uv planted there ran as the installer.
Only absolute PATH directories are now considered. The lookup takes the
PATH value as a parameter, so it is testable without the environment.

Fixes #72

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FJmHQ3jHRbVdpwUiNUkApG
A directory named uv passed isExecutable() and was chosen as the
installer, failing without the pip fallback. On Windows, an
extension-less uv shell shim was tried before uv.exe and failed to run.
Also word the skipped PATH entries accurately, and the README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FJmHQ3jHRbVdpwUiNUkApG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uv is found in the working directory through an empty or relative PATH entry

1 participant