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

"Cargo install" should provide download binaries only from crate.io if availibale rather than build these binaries every time when calling cargo install #13994

Open
wy6688 opened this issue Jun 1, 2024 · 3 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-install S-needs-team-input Status: Needs input from team on whether/how to proceed.

Comments

@wy6688
Copy link

wy6688 commented Jun 1, 2024

Problem

"Cargo install" should provide download binaries only from crate.io if availibale rather than build these binaries every time when calling cargo install. since the build process in local computer is very slow, especially when call "cargo install" when build a docker containers.

Proposed Solution

provide "cargo install --no-locall-build" or "cargo install --download_binaries_only"

Notes

No response

@wy6688 wy6688 added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Jun 1, 2024
@wy6688
Copy link
Author

wy6688 commented Jun 1, 2024

Since the "cargo install" only installed tools used by local env, download these tools is lots of faster than build them locally.
In my docker enviroments, every time when I rebuild my dev container, over 99.99999% times is on "cargo install", over 20 minutes.

@epage
Copy link
Contributor

epage commented Jun 1, 2024

An important first step in consideration is #7169 as we would effectively be locking in the lockfile otherwise.

We also have #5931 which would help some but not too much until the follow up idea of a remote cache support and then that could be a potential way of solving this problem.

There is also the question of what the role of cargo install should be. Personally, I don't think we should grow the scope to pull in more general purpose binary package distribution needs (e.g. #2729) and which inclines me to say we shouldn't have a special built built-in pre-built bin install system.

In terms of third-party efforts in this direction, see https://crates.io/crates/cargo-binstall

@epage epage added S-needs-team-input Status: Needs input from team on whether/how to proceed. and removed S-triage Status: This issue is waiting on initial triage. labels Jun 1, 2024
@wy6688
Copy link
Author

wy6688 commented Jun 1, 2024

Thank you so much for your fast reply and help.
The cargo-binstall do works perfect for my case, greatly reduced my dev container rebuild time.
It maybe best integrate or merge this feature as build-in, so as avoid to compile and build cargo-binstall tools also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-install S-needs-team-input Status: Needs input from team on whether/how to proceed.
Projects
None yet
Development

No branches or pull requests

2 participants