[Pkg-rust-maintainers] Rust for Linux and host-only libraries

Miguel Ojeda miguel.ojeda.sandonis at gmail.com
Fri Apr 19 19:44:12 BST 2024


On Fri, Apr 19, 2024 at 8:13 PM Fabian Grünbichler
<debian at fabian.gruenbichler.email> wrote:
>
> Yes, all crates packaged by the Rust team (and most packaged for consumption by other packages/as build-deps by people outside of the team) ship their (patched for distro use) sources in a subdir there. The patches (except for wholesale exclusions of bundled C code and similar things, which is done via orig tarball repacking) are also shipped there, so the delta is easily reviewable. The whole directory structure can be used as (partial) drop-in for crates.io by configuring cargo accordingly (in Debian packaging this is done by a cargo wrapper shipped in /usr/share/cargo/bin/cargo, but that one is probably not suitable as-is for kernel stuff - it or rather its output might serve as an example for the needed cargo config runes though ;))

Thanks for the quick reply!

I see -- in principle, we only need the sources, i.e. we would not
compile the crates using Cargo. Are the patches applied to the sources
already, or are they applied by that cargo wrapper you mention at
build time? (Well, assuming users should use the patched versions).

> Not really - other than that directory being in the format the cargo expects for registry replacement, which is the same structure as `cargo vendor` creates. There is no index or .pc equivalent - the Cargo.toml file inside each crate has all the info and more in a standardized fashion after all :)
>
> I don't except this to change anytime soon (basically - only if stable dynamic linking becomes feasible and we stop shipping the sources in binary packages altogether ;) or if cargo itself completely revamps how it supports vendoring). If we know people/projects outside of Debian packaging are using this, adding a comment in the tooling that currently decides those paths (and their contents/structure) so that we know we should discuss or at least give a heads up about any planned fundamental changes should be easy to do :)

Sounds great.

I am not sure yet how we will approach it, but we would give the users
the option to customize the path, of course.

> Don't hesitate to reach out if you have further questions or go ahead with using the packaged crate sources!
>
> While there is considerable overlap w.r.t. subscribers, there is a second Debian rust list for discussions (debian-rust at lists.debian.org) - this one here gets all the automated notifications for all team maintained packages, so is rather high volume and things can get overlooked sometimes.

Thanks!

Cheers,
Miguel



More information about the Pkg-rust-maintainers mailing list