Skip to content

Fix for issue 470 - #471

Merged
tinder-maxwellelliott merged 2 commits into
Tinder:masterfrom
maxwellE:claude/bazel-diff-issue-470-reproducer-6vmnkn
Aug 24, 2026
Merged

Fix for issue 470#471
tinder-maxwellelliott merged 2 commits into
Tinder:masterfrom
maxwellE:claude/bazel-diff-issue-470-reproducer-6vmnkn

Conversation

@tinder-maxwellelliott

Copy link
Copy Markdown
Collaborator

Fixes #470

claude added 2 commits August 24, 2026 01:33
…path

Tinder#470: the Rust CLI parses --workspacePath through
parse_normalized_path, which folds away every CurDir component. A path
made entirely of such components ("." , "./", "nested/..") normalizes to
the empty PathBuf, so BazelOptions::command() chdir's the child into ""
and every Bazel spawn dies with ENOENT -- reported against the Bazel
binary, which exists, rather than against the workspace.

Two ignored tests capture it: one on the parser (root cause), one that
spawns a stub Bazel through the same options the CLI builds (symptom).
Both are #[ignore]d so CI stays green until the bug is fixed; run them
with `cargo test --bin bazel-diff -- --ignored issue_470`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SRpkjiihF9yeX6VPo6xBSa
Tinder#470: the Rust CLI parsed path arguments with
normalize_path, which folds away `.` and `..` lexically. On a relative
path that is wrong in two ways -- a path made only of such components
(".", "./", "nested/..") collapsed to the empty PathBuf, and a leading
".." popped nothing so "../sibling" silently became "sibling".

The empty path is the one users hit: BazelOptions::command() does
`command.current_dir(&self.workspace)`, so the child's chdir("") failed
and std::process::Command reported it as a spawn failure -- naming the
Bazel binary, which exists and is executable, rather than the workspace:

    [Error] failed to execute /path/to/bazel: No such file or directory

parse_normalized_path now anchors the argument to the process working
directory with std::path::absolute before normalizing, so a relative
--workspacePath means what it says, matching the Kotlin CLI. The same
parser backs --cacheDir, which had the same hole. An empty path never
named a directory and is now rejected up front by clap, with a message
naming the flag, instead of reaching chdir.

The two ignored reproducers added in the previous commit become
regression tests: one on the parser, one spawning a stub Bazel through
the options the CLI actually builds. Both fail without this change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SRpkjiihF9yeX6VPo6xBSa
@tinder-maxwellelliott
tinder-maxwellelliott merged commit 9802a0e into Tinder:master Aug 24, 2026
25 checks passed
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.

Rust CLI: relative --workspacePath (e.g. ".") becomes the empty path — every child bazel spawn dies with ENOENT

2 participants