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

Support cargo install --all #4101

Open
RalfJung opened this issue May 25, 2017 · 13 comments
Open

Support cargo install --all #4101

RalfJung opened this issue May 25, 2017 · 13 comments
Labels
A-workspaces Area: workspaces C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-install S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

Comments

@RalfJung
Copy link
Member

There seems to be no easy way currently to install all binaries from all crates in a given workspace. Instead, cargo install has to be called for all of them separately. It would be nice if cargo install supported a --all flag to recurse into all crates of the workspace.

Does this seem to make sense?

@alexcrichton
Copy link
Member

Makes sense to me!

I got scared that you might have meant cargo install --all as "install all binaries from crates.io please" but I like this interpretation better :)

@RalfJung
Copy link
Member Author

I got scared that you might have meant cargo install --all as "install all binaries from crates.io please"

That one sounds like... a nice Easter egg? ;)

@est31
Copy link
Member

est31 commented May 26, 2017

Maybe it could be called cargo install --all-workspace ?

@RalfJung
Copy link
Member Author

I suggested --all for consistency with cargo build. But unfortunately, cargo install is already working somewhat differently than build, test etc. (e.g., it doesn't take --package but instead takes --path).

@carols10cents carols10cents added A-workspaces Area: workspaces C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-install labels Oct 3, 2017
@matthiasbeyer
Copy link
Contributor

I second this! Would be really nice to have the --all feature! 👍

@matthiasbeyer
Copy link
Contributor

I'm working on this, PR will be filed in a few minutes.

@rushmorem
Copy link

For some workspaces, it makes sense to install from only one specific package. For example:

cargo install --git https://github.com/habitat-sh/habitat --package hab --tag 0.58.0

In fact, I tried to run this exact command just a moment ago, which is what led me here.

@matthiasbeyer Would it be feasible to include this functionality in the same PR or should I open a separate issue?

@matthiasbeyer
Copy link
Contributor

I'm on a sabbatical and cannot contribute code right now, so I suppose opening a new PR would be the way to go.

@dwijnand dwijnand changed the title Suppport cargo install --all Support cargo install --all Feb 1, 2019
@sophiajt
Copy link

sophiajt commented Mar 2, 2020

Hi from the Nushell team!

We ship Nu with a set of plugins, and we're having to work around not having this feature using some (admittedly a little gross) hackery. We'd love to see this happen.

Happy to help implement it, if it helps!

@ehuss
Copy link
Contributor

ehuss commented Mar 3, 2020

It might be helpful to spell out the exact desired behavior. Something along these lines:

Support the normal package selection flags (-p, -all, --workspace, --exclude) when used with the --path flag. Passing a bare arg would be the same as -p. This may cause some complexities since -p is a pkgspec, and install args are names only, what are the possible problems here? What is the behavior with --git? cargo install inherently does not have a workspace-oriented view with --git, so it may introduce some complexities with it. Should --git just not support those flags? Should it be an error for registry sources?

Implementation may be tricky because install is inherently unaware of workspaces at the high level. It may require some redesign of how it is implemented, which may not be easy.

@chenrui333
Copy link

Any update on this thread? It would be good to have something like this cargo install --package xx working.

@proski
Copy link

proski commented Oct 23, 2023

I don't think a special flag like --all should be needed. cargo build knows what to build without --all, why should cargo install --path . need it?
On top of that, there is workspace.default-members: https://doc.rust-lang.org/cargo/reference/workspaces.html#the-default-members-field
The documentation is unclear what operations it should apply to. It doesn't apply to cargo install apparently, which might be a bug.

@0xBYTESHIFT

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-workspaces Area: workspaces C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-install S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Projects
None yet
Development

No branches or pull requests