[Pkg-rust-maintainers] Bug#860116: RFH: cargo -- Rust package manager

Josh Triplett josh at joshtriplett.org
Thu Apr 20 01:00:36 UTC 2017

On Wed, Apr 19, 2017 at 11:11:00PM +0000, Ximin Luo wrote:
> Ximin Luo:
> > [..]
> I've made some more process and have pushed 0.17.0 to git. However we're getting build errors and I don't know how to proceed:
> https://anonscm.debian.org/cgit/pkg-rust/cargo.git/tree/debian/TODO
> https://anonscm.debian.org/cgit/pkg-rust/cargo.git/tree/debian/cargo-vendor-pack.py
> I'm not familiar with the Cargo repo formats, and I don't know how d/cargo-vendor-pack.py should be fixed. Help would be appreciated.
> Josh, is this anything related to how your dh-cargo works? Any code that we can reuse?

Not directly, until we're ready to package all the individual crate
dependencies (which we'll want to do at some point).  But you can
definitely use the same mechanism; it'd be much easier to generate a
directory registry than the full Cargo index format.  Rather than
generating an index file and repo, just:

1) Copy every crate directory, verbatim, into a subdirectory of a vendor

2) Create a file .cargo-checksum.json in the crate directory, containing
   {"package":"$SHA256","files":{}} , where $SHA256 is the sha256 of the
   .crate file.

3) Create a directory containing a file "config", containing:

replace-with = "my-registry"

directory = "/path/to/the/vendor/directory"

4) Set CARGO_HOME to the directory containing that config file, and

debcargo can help a bit with this.  Run it on a crate, move
debian/cargo-checksum.json to .cargo-checksum.json , aggregate
debian/copyright, remove the rest of debian/ , and put the resulting
directory into the registry directory.

...and looking at git from 20 minutes ago, it looks like you've switched
over to directory registries now.

More information about the Pkg-rust-maintainers mailing list