added a section to the readme about the collapse_features setting, why it exist and how to use it

This commit is contained in:
Alexander Kjäll 2022-08-20 12:05:56 +00:00
parent 8539664ccd
commit c9063851ca
3 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,2 @@
[Project]
VersionControlSupport=kdevgit

View File

@ -226,6 +226,30 @@ conditions for (2), e.g. https://github.com/hsivonen/simd/issues/25
obvious so documentation is less necessary, and dependent crates all do it obvious so documentation is less necessary, and dependent crates all do it
correctly already.) correctly already.)
Setting collapse_features in debcargo.conf
------------------------------------------
Rust and Debian have a two different levels of abstraction when handling dependencies and the
relationship between them. In rust the lowest level is a feature, and in Debian it's the binary
package.
This means that the following dependency chain is not a problem in rust:
- crate A with feature AX depends on crate B with feature BY
- crate B with feature BX depends on crate A with feature AY
This is a perfectly valid situation in the rust+cargo ecosystem. Notice that
there is no dependency cycle on the per-feature level, and this is enforced by
cargo; but if collapse_features is used then package A+AX+AY would cyclicly
depend on package B+BX+BY.
This is reflected in the Debian packages by producing `Provides` lines for all combinations
of features, and this can become a quite large section.
Setting `collapse_features = true` in debcargo.toml removes this behaviour and is recommended,
but it can lead to dependency cycles of debian packages, if that happens those must be
broken up by having some or all of the packages set this feature to false.
Changed orig tarballs Changed orig tarballs
--------------------- ---------------------

4
debcargo-conf.kdev4 Normal file
View File

@ -0,0 +1,4 @@
[Project]
CreatedFrom=
Manager=KDevCustomBuildSystem
Name=debcargo-conf