[Pkg-rust-maintainers] Bug#913408: Bug#901827: dpkg: Support two-sided version constraint ranges, required to properly translate Cargo dependencies
Ximin Luo
infinity0 at debian.org
Sat Nov 10 23:16:00 GMT 2018
Control: severity 901827 important
Control: block 913408 by 901827
Ximin Luo:
> Guillem Jover:
>> [..]
>>
>> So you could have package slab-X.Y and then depend on just that, or if
>> for some reason you need to have coinstallability down to the minor
>> version, then slab-X.Y.Z, in which case that package would provide
>> slab-X.Y (= X.Y.Z). In addition, all of these would also provide
>> slab-X (= X.Y.Z) and slab (= X.Y.Z) and probably also slab, so that
>> you can represent all the range types.
>>
>> Cargo deps (A) dpkg deps (A-X.Y || A-X.Y.Z)
>> A A
>> A (>= 6) A (>= 6)
>> A (>= 6.1) A (>= 6.1)
>> A (>= 6.1.3) A (>= 6.1.3)
>> A (>= 6, << 7) A-6
>> A (>= 6.1, << 6.2) A-6.1
>> A (= 6) A-6
>> A (= 6.1) A-6.1
>>
>
> Thanks for being specific here. After thinking after it for a bit, I think this might work. The key is to only generate a single item within in the comma-separated list of AND-clauses in the dpkg dependency, where the item itself is a "|"-separated OR-clause. It would be pretty ugly in some circumstances:
>
> Cargo deps dpkg deps
> A (>= 6.1, << 9.5) ----> A-6 (>= 6.1) | A-7 | A-8 | A-9 (<< 9.5)
>
> but I think I have a decently-simple way of achieving this in debcargo.
>
This translation scheme works for Depends and Build-Depends, however it does not work for Replaces and Breaks, please see #913408 for an example of the problem.
In the abstract example above, since A-5 (= 5.1.1) replaces files from a previously-uploaded A (= 5.1.1), it must declare Replaces+Breaks: A (= 5). But in reality, there may be multiple Debian uploads of 5.1.1 including security uploads and backports. So we really need to declare:
Breaks: A (>= 5.1.1~~, << 5.1.2~~)
Replaces: A (>= 5.1.1~~, << 5.1.2~~)
but this is not possible in Debian today. Note that this:
Breaks: A (>= 5.1.1~~), A (<< 5.1.2~~)
Replaces: A (>= 5.1.1~~), A (<< 5.1.2~~)
won't work as it is equivalent to Breaks: A, Replaces: A which is not what we want.
X
--
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git
More information about the Pkg-rust-maintainers
mailing list