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

Feature Request: Allow cargo to specify the directory to run in #1485

Closed
strega-nil opened this issue Apr 5, 2015 · 7 comments
Closed

Feature Request: Allow cargo to specify the directory to run in #1485

strega-nil opened this issue Apr 5, 2015 · 7 comments

Comments

@strega-nil
Copy link

This would just be a nice feature for interfacing with other build systems, like Make. Currently, you have to

cd dir && cargo build

whereas, in this case you could just

cargo build --directory dir

This would be nice for integration with things like vim's make command, because cargo currently gives the wrong file: as if dir is the base directory, not dir/...

@alexcrichton
Copy link
Member

This is actually already possible! If you do cargo build --manifest-path=dir/Cargo.toml it should do the trick.

@strega-nil
Copy link
Author

Thanks! I'm sorry for wasting y'all's time 😝

@alexcrichton
Copy link
Member

No worries, thanks for the issue regardless!

@1480c1
Copy link

1480c1 commented Sep 21, 2020

Sorry for the necro, but a quick question, does the --manifest-path=dir/Cargo.toml thing also apply to commands other than build, like for example third-party cargo sub-commands? I personally am searching for something similar to make's, ninja's, and git's -C option that applies command wide and this was one of the first results that popped up

@bobbbay
Copy link

bobbbay commented Sep 21, 2020

@1480c1 I would most recommend you test it out yourself! 😉

@mikhail-putilov
Copy link

mikhail-putilov commented Sep 26, 2023

It's such a pity that every tool has its own name for the same concept: maven requires '-f', git '-C' and cargo '--manifest-path' ☹️

@weihanglo
Copy link
Member

This is already possible via an unstable flag -C. See #10098 for more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants