[Pkg-rust-maintainers] Packaging advice/help wanted for anki, which has just started using some Rust

Julian Gilbey jdg at debian.org
Tue Jan 21 21:50:16 GMT 2020

On Tue, Jan 21, 2020 at 09:27:25PM +0100, Wolfgang Silbermayr wrote:
> Hi Julian,

Hi Wolfgang,

That's an amazing answer - thanks so much!  It's clearly going to be a
bunch of work to upgrade this package...

> On 1/21/20 11:00 AM, Julian Gilbey wrote:
> > I maintain the Python-based package "anki", which has been almost no
> > problem up to now.  But upstream have just started incorporating some
> > Rust code into it, and I've never used Rust myself.  The build
> > mechanism they have written involves downloading and compiling Rust
> > modules (I think that's what it's doing) using rustup.
> This is clearly not something we want to have inside the build process.
> rustup is a tool we might want to package in the future, but just for
> users who want to manage user installations of their rust toolbox, most
> certainly not for installing a toolchain during package build process.

Yes, indeed!

> > Here's a piece
> > of the Makefile as an example:
> > [...]
> The snippets listed here should not be necessary for the build process.
> The `toolchain install` subcommand installs a specific toolchain into
> the user directory (in this case pinned to a nightly given by the
> contents of the rust-toolchain file). The `component add` subcommand
> adds the rustfmt and clippy tools into the previously installed
> toolchain. These tools are helpful for development of rust code, but not
> necessary for the build process:
> * cargo fmt / rustfmt formats the code, or if called with --check as
>   here, informs about code not formatted according to the style defined
>   in `rustfmt.toml`.
> * cargo clippy is a linting tool for rust code.
> So I assume the package can be built without the whole rustup foo.

That's very useful information!  So yes, we can exclude that part of
the process.

> > (This is a little weird, as there's no rule to make rust-toolchain.
> > Perhaps an error in the Makefile?)
> Maybe they reference the `rust-toolchain` file in the same directory? So
> the `.build/tools` target depends on changes inside that file.

Duh, of course!!

> [...]
> > Also, is there a Debian Rust Policy?  I haven't been able to find one
> > on a quick scan.
> There is some general information in [0] and a policy in [1]. It has
> been some time since the policy page got updated, so some details might
> not be completely up-to-date.

I'll take a look.

> A quick summary of how we package Rust code:
> [...]

OK, that will keep me busy :-)  Oh, why did they have to leave the
"straightforward" Python world and start using a whole new toolchain?!

Best wishes,


More information about the Pkg-rust-maintainers mailing list