-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Allow passing a crate name to cargo fetch #2998
Comments
Hm |
Well, I was thinking of mirroring the
|
Hm so while conceptually that makes sense I'm not sure it fits in with Cargo's model of dependency fetching. That is, it's never necessary to |
Yep, I totally agree with your point. Having that feature wouldn't target people using cargo directly, it would really be packager-oriented. |
Yes but even for packagers it's not useful? After |
Well, as cargo fetches deps into CARGO_HOME, when running cargo build, it checks if they're present, and fetches them if they're not. |
Unfortunately that's not actually true. Projects aren't intended to be installed from crates.io, the source needs to be acquired from elsewhere for these kinds of builds. |
Where does the cargo tool fetch the sources from (not that this would change anything regarding my issue)? Maybe doing what I want in "cargo fetch" isn't the right solution. What would be a proper solution to split everything network-related from a crate installation into one command, then everything else in another? Would something like "cargo download" be better ? To summarize exactly what I'd like to achieve here:
I'm not trying to do cargo's work by hand, the least I do that, the happier I am. I just really need to split the network-related stuff. |
crates.io
This is intended to be used against a |
@Keruspe You probably want to look at what we've been doing for Yocto, Gentoo and Debian since you are searching for a solution to the same problem. I opened a similar ticket #2861. But you should really look at #2857 and #2811. There's probably some other issues to look at but you're effectively asking for the same thing. |
I don't follow Exherbo development but I know its derived from Gentoo with an updated PMS. I've implemented support for directory registries with an eclass and it should be possible for Exherbo to use that for the support you need. See gentoo/gentoo#2918. |
I believe this has been solved by #2857, |
It would be nice to be able to do somehting like
cargo fetch foobar
to fetch foobar's dependencies.I'm the rust packager for the Exherbo distribution, which is source based. An install is divided into steps: fetch, unpack, configure, compile, test, install
Only the fetch phase is allowed to use the network.
For now I added a hack disabling the sandbox just for the
CARGO_HOME=... cargo fetch
command, but it would be great if we could simply move that to the fetch phase, when we don't have unpacked the tarball yet (and thus when we don't have access to Cargo.toml yet).The text was updated successfully, but these errors were encountered: