cargo install clearly needs a target dir, and honors the CARGO_TARGET_DIR env var. But for some reason it does not accept the --target-dir flag, unlike the other commands.
Would be nice to make this consistent. :)
@alexcrichton mentioned in https://github.com/rust-lang/cargo/issues/4725#issuecomment-350373564 that you would prefer not to add the flag at that time. I wonder if your mind has changed on that? I don't see any particular downsides to adding it, and it would provide consistency with all the other build commands.
I believe that comment was more in reference to "let's not add a single flag for just cargo install", but now that --target-dir is everywhere except cargo install then makes sense to me to add support there.
Would like to work on this!
Great! Let us know if you have any questions.
Hello Im considering working on this issue, where exactly would this new flag be added I'm thinking it would be in the same file as https://github.com/rust-lang/cargo/pull/8344/commits/3fbd5aefd4bf47047924ce01e49106b78286146c or would there be a more suitable place ?
@AlvinKuruvilla I think @bl2e mentioned they were working on this. @bl2e are you still working on it?
Some brief instructions:
arg_target_dir function that needs to be called in the install command. install.rs. There are some existing tests for target-dir behavior there already. More details about running and writing tests can be found in CONTRIBUTING.md and cargo-test-support.Yes still working on it.
Should be closed as of #8391?
Yes, thanks!