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
directory.
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:
[source.crates-io]
replace-with = "my-registry"
[source.my-registry]
directory = "/path/to/the/vendor/directory"
4) Set CARGO_HOME to the directory containing that config file, and
build.
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.