-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Enable 'cargo install' to install binary-crates according to a spec of dependencies #5120
Comments
Thanks for the report! This sounds like a neat feature, albeit somewhat weighty in terms of design! |
As there hasn't been any activity here in over 6 months I've marked this as stale and if no further activity happens for 7 days I will close it. I'm a bot so this may be in error! If this issue should remain open, could someone (the author, a team member, or any interested party) please comment to that effect? The team would be especially grateful if such a comment included details such as:
Thank you for contributing! If you're reading this comment from the distant future, fear not if this was closed automatically. If you believe it's still an issue please leave a comment and a team member can reopen this issue. Opening a new issue is also acceptable! |
I am still interested in. My current workaround is having a shell script which installs all necessary stuff to enable project dev workflows. It should be finally tracked by cargo instead. |
I appreciate the sentiment here but this feels like trying to make cargo into a full-blown package manager which I don't think is reasonable. |
Hi.
I'm worried about the same thing.
I guess this feature should not be implemented when the rust lang team want cargo to provide minimum package manager feature. |
Hi, I reported #12764. My use case is a little different: the binary crate is not a cargo plugin and I don't want to install it globally. See my issue. TL;DR I think that we should implement cargo build --bin ... --from-dep ...
cargo run --from-dep ...
cargo install --bin ... --from-dep ... in that order. |
See also #2267 |
As the use case is the same as #2267, I'm closing in favor of that so we have one place for discussing solutions and coming to an agreement on the design. |
Related proposal #13359 |
Indeed, simplicity is a reasonable design concern. In that case, perhaps the trick is writing some documentation about how to configure |
Currently, workflow for rust developers is something like the following:
I noticed that new setup of a development machine or CI box requires consistent installation / synchronization of the required tools and their versions, which is part 1 of the workflow in the example above.
I have raised more detailed problem description here and it seems there was no a solution found.
I see that required tools and their versions are perfect match for dependencies specification in the Cargo.toml file. For example, cargo could support
install-dependencies
section, like the following:If it was available, the workflow could become something like this:
Notice
cargo install
without arguments. It means cargo would read from the toml file and installs accordingly toinstall-dependencies
. This gives 2 benefits:Having the above functionality (running
cargo install
without arguments) would bring cargo to be on par withnpm install
(note: yes, I knownpm install
also installs package and dev dependencies, but I am not suggesting this for cargo, hence newinstall-dependencies
section is proposed for the toml file only for binary-crate tools).However, cargo can do even better than
npm
in this area.cargo install
could be invoked implicitly on the first run of unknown command. This way the workflow becomes as simple as this:This way all commands, either cargo native or 3rd party or aliases, look the same, their source and nature are not that important anymore. All 3rd party tools and their compatible versions are declared by a project on per project basis and installed automatically on need basis (for example, once first unknown command is invoked).
The text was updated successfully, but these errors were encountered: