[Pkg-rust-maintainers] Packaging software written in Rust?
Josh Triplett
josh at joshtriplett.org
Mon May 23 15:25:32 UTC 2016
[Please CC me on replies.]
Do we have any guidelines on packaging software written in Rust, and in
particular software built using Cargo?
Software packaged for Debian can't let Cargo pull down packages from the
network. Given that, do we have an established procedure to package
Rust library crates (from crates.io or otherwise), and then to point
Cargo exclusively at the packaged crates? Preferably in a way that only
involves passing options to Cargo, without making any changes to
Cargo.toml?
Rust doesn't have a stable library ABI ("yet", I hope), so I don't think
it makes sense yet to package shared Rust libraries; however, I think we
can create -dev packages for crates, and then build-depend on those. (A
simple script, perhaps packaged as a cargo helper command, could
automatically translate the dependencies in Cargo.toml into
Build-Depends suitable to update debian/control.) We'll then need to
rebuild dependent packages whenever we update to a new version of rustc,
or potentially whenever their dependencies change; the latter depends on
cargo's handling of pre-compiled library dependencies, as normally cargo
rebuilds the entire dependency tree rooted at a binary to keep its
dependencies consistent, and we may need to maintain that property
ourselves within the Debian archive. The current transition tracking
mechanism (https://release.debian.org/transitions/) should handle that;
Rust will likely end up on the list of "Permanent trackers" alongside
Haskell and OCaml.
In terms of future automation, we'll want to build a dh_cargo at some
point, and it can just pass a standard set of options and paths to
cargo. Depending on the handling of library dependencies, we may also
want to provide a substvar for debian/control, so that library -dev
packages can have automatic Depends on their dependencies.
- Josh Triplett
More information about the Pkg-rust-maintainers
mailing list