-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
In addition to CARGO_TARGET_DIR env var, support --target-dir command line option #5308
Comments
Seems reasonable to me to implement! |
Speaking generally, in my opinion command-line arguments are more explicit and user-friendly than environment variables. They are easier to change or discover, and are less likely to have unintended side-effects. |
So, if anyone wants to implement this, here are some pointers to code:
|
@matklad I would be interested in working on this. What would be the best way to direct questions? |
@smithsps awesome! You can ask the questions right here, and we have an IRC channel as well! |
Do we only need to create a single test in build that accompanies the existing one? Or do we need one with every command we include arg_target_dir? |
A single dest would be enogh! |
To check in, I've got a working solution. I'll probably pull request shortly, but I still need to double check the correct subcommands and their various description. |
Add target directory parameter --target-dir Implements: #5308 Adds a target directory parameter, that acts in the same manner as the environment variable `CARGO_TARGET_DIR`, to the following subcommands: - `bench` - `build` - `check` - `clean` - `doc` - `package` - `publish` - `run` - `rustc` - `rustdoc` - `test`
Fixed by #5393 |
Indeed, thanks! |
@nirbheek you wanted this for messon integration. Could you elaborate on why do you think it is better than an environmet variable?
@rust-lang/cargo it seems that such addition would be E-easy and straightforward? The only complication I can think of are build scripts which invoke cargo recursively for whatever reason, but we can just set the env car for them manually. Should we implement this? If yes, I’ll write some mentoring instructions :)
The text was updated successfully, but these errors were encountered: