Debian Rust packaging team
This page is about Rust packaging.
Team project and packaging repos (on salsa): https://salsa.debian.org/rust-team
Team mailing list: https://lists.debian.org/debian-rust/
Public IRC channel: #debian-rust on irc.oftc.net
How to package a Rust application/crates: https://salsa.debian.org/rust-team/debcargo-conf/blob/master/README.rst
How to package a GTK Rust application: Gnome/Rust_Packaging
TODO
Get involved!
Get in touch with us via ML or IRC and join rust-team on salsa :)
Contribute to packaging, bug fixing and testing
Report bugs, QA pitfalls, and stuff missing from drafts and TODO
Packages
Packaging of all team maintained Rust crates is done in a single git repo ("monorepo"), stored in which are only files under debian/ that need manual inspection; we use debcargo to automatically generate the rest.
To help, git clone git@salsa.debian.org:rust-team/debcargo-conf and follow instructions in README.rst to set up the packaging, then you can start packaging individual crates. There are also some tips in rust_hacks.md.
If you are a DD, you can directly apply to join the salsa team to obtain push access; otherwise, we'd appreciate a few merge requests so we can review the initial work and help you get familiar in the process.
For more details about what debcargo does, you can read through the Debian Rust packaging policy.
Binary packages (such as applications) should be maintained also with the rust team if they are available as crates. Please file an ITP for those, not for regular crates. Examples: lsd, exa, bat ...
Programs written in Rust using the gtk-rs framework should rather be maintained with the debian gnome team. Examples: shortwave, podcasts, obfuscate
Toolchain (rustc, cargo)
Staying up-to-date - see "Maintaining this package" section of rustc's README.source and "Updating the package" section of cargo's README.source
Library unbundling - see "Embedded libraries" section of rustc's README.source
?Runtime soname and stability
General info
Bootstrapping a new distribution
rustc and cargo both Build-Depends on each other. In order to break the loop, we use Build Profiles.
For rustc, see "Bootstrapping" section of rustc's README.source.
For cargo, we currently don't have an automated way to do it. If you need to do this, the following steps should work: install upstream's cargo binary to /usr/local, install the other Build-Depends, and then dpkg-buildpackage -d.
Porting to a new architecture
Use sbuild --host=$arch --profiles=nocheck $pkg, it should Just Work. $pkg is either rustc or cargo to use what's already in the FTP archive, or a path to a .dsc of your choice.
If it doesn't work, you might need to also give --extra-repository="deb http://incoming.debian.org/debian-buildd buildd-unstable main". This is the work-around that most-often fixes things, so just try it blindly even if you don't understand the below. Technically, this is required when (e.g.) there was recently a new GCC or binutils upload, but not all architectures were built and uploaded to the main FTP yet so some architectures are out-of-sync version-wise on Debian unstable.
If it still doesn't work, and sbuild complains about missing build-dependencies, and these are core packages not directly related to rustc such as gcc, binutils or perl-related packages, you can:
check the relevant buildd logs (e.g. gcc-8, binutils). If it says "Building" for either the source or the target architecture, you will need to wait until the builds are done i.e. if both entries say "Installed". Then the incoming trick above should work. That's just an unfortunate aspect of how cross-building with sbuild works today, sadly.
check the transition tracker (e.g. perl). If there is a transition going on you'll have to wait until it is done, or alternatively use a Debian testing schroot instead of Debian unstable - but be aware that some necessary packages may be out-of-date there (such as the previous version of rustc itself) in which case you'll have to download them and supply them manually to sbuild using --extra-package=.
If it still doesn't work, check that the binary package crossbuild-essential-$arch exists for the desired architecture. If it doesn't, add this to your ~/.sbuildrc:
changing the entries to match your desired architecture. The valid packages are listed here and here. If using the latter, you'll also need to add Debian-Ports to your APT sources.list.
If it still doesn't work, then file a bug to src:rustc, src:cargo, or debcargo as appropriate. You can also try glaubitz's method which involves more manual steps, though it is probably out-of-date by the time you read this.
For more details about rustc cross-compiling see "Cross-compiling" section of rustc's README.Debian.
People
We always welcome new contributors, and we are mostly available on IRC for quick questions. Feel free to ping us and join the team:
- Luca Bruno (IRC: kaeso)
- Sylvestre Ledru (IRC: sylvestre)
- Ximin Luo (IRC: infinity0)