specify architectures for features.
Some features are only supported on a subset of architectures. In particular this becomes an issue with rustls. rustls itself is written in native rust, but it depends on ring which is written in a mixture of rust, C and asm and currently only supports x86* and arm*.
Currently we have three ways of handling this, all of them suboptimal.
- Build packages even though they are non-functional, there are some cases where we have to do this due to https://github.com/rust-lang/cargo/issues/4544 but I feel it's something we should keep to a minimum.
- Add the packages to build-depends so the whole crate is only built on architectures where all features are supported. This effectively means that anything that uses the crate has it's architectures artificially limited even if it doesn't use the features in question.
- Remove the feature completely, this means that anything that needs the feature can't be packaged.
- Override debian/control, this is a pain to maintain.
It thus seems like it would be useful to be able to specify architecture restrictions for a feature, likely with something like
[packages."lib+rustls"]
architectures = ["i386", "amd64", "armel", "armhf", "arm64"]
If the features are not collapsed this would translate to architecture restrictions on the feature package. If they are collapsed it would translate to architecture restrictions on the depends and provides associated with the feature.
Architecture specifications would also need to be added to the relevant autopkgtests.