[Pkg-rust-maintainers] [Debian Wiki] Update of "Teams/RustPackaging/Policy" by Infinity0

Ximin Luo infinity0 at debian.org
Tue Feb 6 17:38:00 UTC 2018


Hey Josh,

All versions of debcargo [1] have generated a Provides: +default for all library crates. This breaks for packages where the default feature pulls in extra dependencies on top of the bare create - examples are git2, num-bigint, semver.

I had thought the packaging policy needs updating but it is actually fine, so I've just tweaked the wording to be a bit clearer about it. It is debcargo itself that needs to generate explicit Package: stanzas for +default when they pull in more dependencies than the bare crate does, e.g. [2]. Vasudev says he's currently working on a fix.

This was detected by running `cargo build` as part of dh_auto_test, so I think it is good to continue doing this for all crates in the future.

X

[1] I checked as far back as 1.3.0 + 3 commits (b5b880b), before that it requires older openssl which I didn't bother installing.
[2] https://anonscm.debian.org/git/pkg-rust/debcargo.git/tree/tests/sh/configs/git2-0.6/debian/control?id=pu/cargo-build-everything

Josh Triplett:
> Can you elaborate a bit on the goal here?
> 
> On Tue, Feb 06, 2018 at 12:42:09PM -0000, Debian Wiki wrote:
>> Dear Wiki user,
>>
>> You have subscribed to a wiki page or wiki category on "Debian Wiki" for change notification.
>>
>> The "Teams/RustPackaging/Policy" page has been changed by Infinity0:
>> https://wiki.debian.org/Teams/RustPackaging/Policy?action=diff&rev1=20&rev2=21
>>
>> Comment:
>> make it clear that it is not always appropriate to Provides: the `default` feature
>>
>>   
>>   A library crate must also generate binary packages for every Cargo "feature" it declares, named `librust-cratename-version+featurename-dev`.  Cargo crate names do not allow a plus sign (`+`) in them, so this package name will not conflict with the package name for any other Rust library crate or feature package.  If the feature name contains underscores (`_`), the corresponding binary package name must replace them with dashes (`-`).
>>   
>> - Each feature package must pull in all the dependencies needed to build a package that depends on that feature of the crate, including any dependencies on other features of the same crate.  If a feature package pulls in no additional dependencies, the main `librust-cratename-version-dev` package can use a versioned Provides to supply that feature package.  The `librust-cratename-version-dev` should normally incorporate any dependencies required to build the `default` feature of the crate, and use a versioned Provides to supply the `librust-cratename-version+default-dev` package as well as any feature packages for features that require no additional dependencies beyond `default`.
>> + Each feature package must pull in all the dependencies needed to build a package that depends on that feature of the crate, including any dependencies on other features of the same crate.  If a feature package pulls in no additional dependencies, the main `librust-cratename-version-dev` package can use a versioned Provides to supply that feature package.  (For example, the `librust-cratename-version-dev` would normally incorporate any dependencies required to build the `default` feature of the crate, and use a versioned Provides to supply the `librust-cratename-version+default-dev` package as well as any feature packages for features that require no additional dependencies beyond `default`.)
>>   
>>   Each feature package must have a versioned dependency on the same version of the main `librust-cratename-version-dev` package.  If a feature of the crate depends on another feature of the same crate, the corresponding feature package for the first feature must have a dependency on the same version of the feature package for the second feature.
>>   


-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git



More information about the Pkg-rust-maintainers mailing list