Fix for issue 470 - #471
Merged
tinder-maxwellelliott merged 2 commits intoAug 24, 2026
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #470