[Pkg-rust-maintainers] Bug#901827: dpkg: Support two-sided version constraint ranges, required to properly translate Cargo dependencies

Ximin Luo infinity0 at debian.org
Tue Jun 19 21:23:00 BST 2018


Josh Triplett:
> On Tue, Jun 19, 2018 at 04:54:00AM +0000, Ximin Luo wrote:
>> Josh Triplett:
>>> I have not seen the proposal or rationale to diverge from the previous
>>> approach discussed on pkg-rust-maintainers at all; do you have a pointer
>>> to where that was proposed and discussed?
>>>
>>
>> It was on IRC and that's where much of the discussion happens, you're
>> missing a lot by not being on it. Also on
>> https://salsa.debian.org/rust-team/debcargo/issues/6 where you can see
>> I was initially against the proposal until I implemented it.
> 
> Is there some means by which discussions on salsa could be automatically
> copied to pkg-rust-maintainers, as BTS bugs are?
> 
> In any case, reading that issue, it's not obvious how this new approach
> allows maintaining multiple versions of crates simultaneously, which
> real rust packages *do* require. I regularly encounter Rust crates which
> have dependency trees pulling in more than one version of a crate. One
> of the points of putting the version number in the name is to allow
> simultaneous installation of multiple versions. (That's not a bug to be
> fixed, that's a feature of Cargo that arises in practice in various
> upstream crates.)
> 

Due to virtual packages, co-installation is entirely a separate thing from generating dependencies, we can support multiple versions of crates simultaneously just by generating differently-named (real) binary package names, like I am already doing in this new approach. (semver_suffix = true, in debcargo.toml)

Anyway, we have a solution on the dpkg bug report that is somewhere halfway between the old and the current approach. I think it will work. It is to declare Provides: A (= X.Y.Z), A-X (= X.Y.Z), A-X.Y (= X.Y.Z) for all packages, then generate a list-of-OR-clauses for every cargo dependency that exactly matches the selected range, e.g. >= 6.1 << 9.5 gets turned into X-6 (>= 6.1) | X-7 | X-8 | X-9 (<< 9.5) and >> 9 simply gets turned into X (>> 9).

We will still omit the version from the package name by default, but give the option to append a version suffix to it, to support co-installation. This allows us to address Sylvestre's concerns as well, and only have duplicate packages when necessary.

If it turns out an old version of a crate is needed (fairly common like 15% of the time) then we can just copy the old config into a new directory and set semver_suffix = true there, which ONLY has the effect of changing the Package: and Source: names, and nothing else (not the dependencies).

> [..]
> 
> And even if dpkg is fixed, you won't be able to make use of that fix
> until that dpkg appears in a stable Debian.
> 

I know, people have said that like 7 times. That's perfectly fine.

X

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



More information about the Pkg-rust-maintainers mailing list