Support --target-dir#627
Open
ychampion wants to merge 1 commit into
Open
Conversation
Expose the documented cargo-arg workaround as a first-class CLI option and preserve Cargo's path semantics across check, build, and test phases. Constraint: Keep the configuration schema unchanged; additional_cargo_args remains the config-file equivalent. Rejected: Add a target_dir config key | issue sourcefrog#407 requests drop-in CLI compatibility and the existing passthrough already covers configuration. Confidence: high Scope-risk: narrow Tested: all-feature unit/integration suite excluding two root-invalid permission tests; all-target/all-feature Clippy; cargo fmt; end-to-end target-directory smoke Not-tested: build_dir permission-denial tests cannot exercise EACCES while running as root.
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 #407.
Problem
cargo mutants --target-dir ...is rejected even though Cargo accepts the same option. The existing--cargo-arg=--target-dir=...workaround works, but preventscargo mutantsfrom being used as a drop-in replacement in scripts that already set a target directory.Change
--target-dir <DIRECTORY>as a build optionValidation
unexpected argument '--target-dir'errorcargo test target_dir_is_passed_to_all_cargo_commands -- --nocaptureenv -u NO_COLOR TERM=xterm-256color cargo test --all-features -- --skip build_dir::test::fail_to_overwrite --skip build_dir::test::fail_to_overwrite_dir_permission_denied- 287 unit and 138 integration tests passed; the skipped permission tests cannot exerciseEACCESwhile running as rootcargo clippy --all-targets --all-features -- -D warningscargo fmt --all -- --check--checksmoke againstsmall_well_testedverified the requested directory in the baseline Cargo command and completed all four mutants