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

Add a local filesystem registry type #2212

Closed
brson opened this issue Dec 16, 2015 · 7 comments
Closed

Add a local filesystem registry type #2212

brson opened this issue Dec 16, 2015 · 7 comments

Comments

@brson
Copy link
Contributor

brson commented Dec 16, 2015

For the purpose of packaging Rust applications, Debian (and likely other distros) wants to also package all of the application's dependencies. They have tried doing this be rewriting registry dependencies into path dependencies and found it burdensome. What we want them to be able to do is construct a directory tree on the local filesystem that cargo understands as a new type of registry, and override cargo to use it instead of crates.io

The layout of this directory structure needs to be easily reproduced through scripting.

@sfackler
Copy link
Member

This might be covered by https://github.com/alexcrichton/cargo-vendor ?

@warner
Copy link

warner commented Dec 20, 2015

I've found myself wanting a way to use cargo offline (on a plane): telling it to skip the registry-update step and just use the cached index+tarballs that it fetched last time. A filesystem registry type might be an elegant way to accomplish that, if the filesystem and "normal" registries share the same format (and even the same disk location), but the filesystem type doesn't do an update each time you run cargo. Then I could switch between online and offline modes by just editing the prefix of the [registry] index= field in .cargo/config.

@marcbowes
Copy link
Contributor

Isn't this already supported (poorly)? You can set registry.index to the filesystem by using file://. The only niggle is that you have to do a git commit in the filesystem registry.

@alexcrichton
Copy link
Member

@marcbowes sorta, yeah, but it's pretty painful and not exactly intended for that purpose :)

@marcbowes
Copy link
Contributor

Agreed on the painful (this is what I'm doing at work). I just wanted to point out that you can work around this without rewriting Cargo.toml files.

@joshtriplett
Copy link
Member

@warner I encountered the same problem on a plane. I made a minor tweak to my Cargo.toml file, and cargo then refused to proceed without updating, which it couldn't do offline. I'd like to download an offline snapshot of a pile of Cargo dependencies, so that I can always build.

@carols10cents
Copy link
Member

I believe the main request in this issue is addressed by https://github.com/alexcrichton/cargo-vendor and https://github.com/alexcrichton/cargo-local-registry, and the offline issues are covered by #1882 and #3479.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants