Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"cargo install --target-dir" does not work #8263

Closed
RalfJung opened this issue May 21, 2020 · 9 comments
Closed

"cargo install --target-dir" does not work #8263

RalfJung opened this issue May 21, 2020 · 9 comments
Labels
A-cli Area: Command-line interface, option parsing, etc. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-install E-easy Experience: Easy

Comments

@RalfJung
Copy link
Member

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. :)

@RalfJung RalfJung added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label May 21, 2020
@ehuss
Copy link
Contributor

ehuss commented May 24, 2020

@alexcrichton mentioned in #4725 (comment) 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.

@alexcrichton
Copy link
Member

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.

@ehuss ehuss added A-cli Area: Command-line interface, option parsing, etc. E-easy Experience: Easy labels May 26, 2020
@bl2e
Copy link
Contributor

bl2e commented May 27, 2020

Would like to work on this!

@ehuss
Copy link
Contributor

ehuss commented May 27, 2020

Great! Let us know if you have any questions.

@AlvinKuruvilla
Copy link

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 3fbd5ae or would there be a more suitable place ?

@ehuss
Copy link
Contributor

ehuss commented Jun 11, 2020

@AlvinKuruvilla I think @bl2e mentioned they were working on this. @bl2e are you still working on it?

Some brief instructions:

  • There is an arg_target_dir function that needs to be called in the install command.
  • Install has special consideration for the target dir, so this code will need to be updated.
  • At least one test should be added (perhaps more to test different source behavior). Tests would go in 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.
  • The documentation needs to be updated. There is some discussion of how to update the man pages in the docs README. The help item also needs to be updated.

@bl2e
Copy link
Contributor

bl2e commented Jun 11, 2020

Yes still working on it.

bors added a commit that referenced this issue Jun 23, 2020
Enable "--target-dir" in "cargo install"

Issue #8263
@thiagoarrais
Copy link

Should be closed as of #8391?

@ehuss
Copy link
Contributor

ehuss commented Jun 29, 2020

Yes, thanks!

@ehuss ehuss closed this as completed Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area: Command-line interface, option parsing, etc. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-install E-easy Experience: Easy
Projects
None yet
Development

No branches or pull requests

6 participants