[Pkg-rust-maintainers] Bug#936029: apt fails to resolve multiple levels of provides

Julian Andres Klode jak at debian.org
Thu Aug 29 16:20:51 BST 2019


On Thu, Aug 29, 2019 at 03:00:00PM +0000, Ximin Luo wrote:
> Control: reopen -1
> Control: retitle -1 better error messages when failing to resolve multiple levels of provides
> 
> Julian Andres Klode:
> > On Thu, Aug 29, 2019 at 02:27:45AM -0700, Ximin Luo wrote:
> >> Package: apt
> >> Version: 1.8.3
> >> Severity: important
> >>
> >> Dear Maintainer,
> >>
> >> apt is having trouble resolving the (correct) dependencies of a certain rust package:
> >>
> >> $ sudo apt install librust-rand+default-dev
> >> [..]
> >> Some packages could not be installed. This may mean that you have
> >> requested an impossible situation or if you are using the unstable
> >> distribution that some required packages have not yet been created
> >> or been moved out of Incoming.
> >> The following information may help to resolve the situation:
> >>
> >> The following packages have unmet dependencies:
> >>  librust-rand+default-dev : Depends: librust-rand-dev (= 0.6.4-2)
> >>                             Depends: librust-rand+std-dev (= 0.6.4-2)
> >> E: Unable to correct problems, you have held broken packages.
> >> exit code 100
> >>
> > 
> > There's a conflict between librust-rand-chacha-0.1-dev depending on
> > librust-rand-core-0.3-dev and librust-rand-pcg-0.1-dev depending on
> > librust-rand-core-0.4-dev (which conflicts with other versioned librust-rand-core)
> > 
> >   MarkInstall librust-rand+default-dev:amd64 < none -> 0.6.4-2 @un puN Ib > FU=1                                                                                                                                                                                                            
> >     MarkInstall librust-rand-dev:amd64 < none -> 0.6.4-2 @un uN Ib > FU=0                                                                                                                                                                                                                   
> >       MarkInstall librust-autocfg-dev:amd64 < none -> 0.1.4-1 @un uN > FU=0                                                                                                                                                                                                                 
> >       MarkInstall librust-libc-dev:amd64 < none -> 0.2.62-1 @un uN > FU=0                                                                                                                                                                                                                   
> >       MarkInstall librust-rand-chacha-0.1-dev:amd64 < none -> 0.1.1-2+b1 @un uN Ib > FU=0                                                                                                                                                                                                   
> >         MarkInstall librust-rand-core-0.3-dev:amd64 < none -> 0.3.0-1+b1 @un uN > FU=0                                                                                                                                                                                                      
> >       MarkInstall librust-rand-hc-0.1-dev:amd64 < none -> 0.1.0-1 @un uN > FU=0                                                                                                                                                                                                             
> >       MarkInstall librust-rand-isaac-0.1-dev:amd64 < none -> 0.1.1-1 @un uN > FU=0                                                                                                                                                                                                          
> >       MarkInstall librust-rand-pcg-0.1-dev:amd64 < none -> 0.1.2-1 @un uN Ib > FU=0                                                                                                                                                                                                         
> >         MarkInstall librust-rand-core-0.4-dev:amd64 < none -> 0.4.0-2+b1 @un uN Ib > FU=0                                                                                                                                                                                                   
> >           MarkDelete librust-rand-core-0.3-dev:amd64 < none -> 0.3.0-1+b1 @un uN > FU=0        
> > 
> > 
> > This happens because librust-rand+default-dev depends on librust-rand-pcg-0.1+default-dev
> > which is a virtual package provided by librust-rand-pcg-0.1-dev and
> > librust-rand-pcg-dev.
> > 
> > Depending on virtual packages that have more than one provider without specifying
> > a preferred provider (e.g. librust-rand-pcg-dev|librust-rand-pcg-0.1+default-dev)
> > is not correct.
> > 
> > Please fix your packaging.
> > 
> 
> Thanks for diagnosing. We forgot to upgrade rust-rand-pcg to version 0.2 when uploading rust-rand-pcg-0.1, and I have just done the former so the error should go away soon.
> 
> If apt had printed more details about the error (e.g. at the minimum, an advisory note on how to enable the debugging output you 
> gave above) then we could have diagnosed this issue without filing a bug report about it. So I'll reopen this bug report and retitle 
> it for improving the error message.

That would be a bad user experience. Normal users don't trigger
issues like that. Also, read the README - it's in there.

And in general: We do not accept "the solver is broken" as a bug report - if it fails
to solve your problem, reformulate the problem until it can be solved. Fixing the solver
is next to impossible, and it does not help you anyway, as you need it to work with apt
in stable.

> 
> It's also the first time I'm hearing about the restriction "Depending on virtual packages that have more than one provider without 
> specifying a preferred provider (e.g. librust-rand-pcg-dev|librust rand-pcg-0.1+default-dev) is not correct." -- where is that 
> documented? This should also be part of the error message.
> 

I don't think it's written anywhere, but the behavior is undefined. I mean, this does not
need writing down - if you give it one name provided by two, nobody can tell you which
package will get installed. For non-greedy solvers this works fine as it can recover from
choices that don't lead anywhere, but apt is not smart enough to do that, and that's fine.

The rules for Depends: A | B - roughly: we try (in order)

(0) check if B is installed, if so, we are done
(1) try to install the package named A
(2) try to install a package providing A
(3) try to install the package named B
(4) try to install a package providing B

There are cases where this works better, so it's not always necessarily an
issue - it's also not something we can really warn anyone about.

-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en



More information about the Pkg-rust-maintainers mailing list