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?
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 :)
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? ;)
Maybe it could be called cargo install --all-workspace ?
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).
I second this! Would be really nice to have the --all feature! :+1:
I'm working on this, PR will be filed in a few minutes.
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?
I'm on a sabbatical and cannot contribute code right now, so I suppose opening a new PR would be the way to go.
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!
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.
Most helpful comment
Makes sense to me!
I got scared that you might have meant
cargo install --allas "install all binaries from crates.io please" but I like this interpretation better :)