[Pkg-rust-maintainers] d-0012-cargo-always-return-dev-channel.patch

Fabian Grünbichler debian at fabian.gruenbichler.email
Sat May 30 07:48:26 BST 2026


On Fri, May 29, 2026, at 11:26 PM, Crystal Durham wrote:
> For what reason is the debian packaged Cargo patched to always consider 
> itself as a development version? If it's to avoid reporting itself as a 
> stable build despite being patched from upstream, I would like to 
> suggest reporting a channel of "debian" instead.
>
> The fact that Cargo believes itself to be a development version means 
> that users of the cargo apt package can use unstable Cargo features 
> without the intended extra friction of using an unstable source channel 
> (as this patch is present in debian/stable). This feels like it goes 
> against the ask that patched versions using the same name as upstream 
> only carry minor patches for the purpose of adapting them to the 
> packaging ecosystem.

The patch was contributed by Canonical, AFAIK (though maybe I am missing
something and the original authorship was lost in the cargo->rustc
merge).

When building packages, we call cargo with `-Zavoid-dev-deps`. The cargo
package is mainly for building packages, though it is of course also
useful for end users :)

There's a few other things that are probably used as well somewhere, such
as `build-std`, and I suspect the SBOM feature might be interesting to
evaluate at some point as well.

> My suggestion would be to gate this change in behavior behind an 
> environment variable (e.g. DEBIAN_ENABLE_UNSTABLE_CARGO) like is done 
> with RUSTC_BOOTSTRAP, setting that where unstable flags are used for 
> packaging, to avoid accidental reliance on unstable features slipping 
> in.

That would be possible, yes. It would be even better if upstream had
support for that, similar to RUSTC_BOOTSTRAP.

I am not too worried about misuse, most of the things are fairly benign,
even if they are technically unstable, and those that aren't mostly
require RUSTC_BOOTSTRAP as well, since they enable unstable features in
rustc ;)

Fabian



More information about the Pkg-rust-maintainers mailing list