Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 743412 - Handling of := slot operator should not cause emerge to fail when a version candidate is available
Summary: Handling of := slot operator should not cause emerge to fail when a version c...
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-18 22:45 UTC by David Carlos Manuelda
Modified: 2020-09-19 19:04 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info output (emergeinfo.txt,18.23 KB, text/plain)
2020-09-18 22:46 UTC, David Carlos Manuelda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Carlos Manuelda 2020-09-18 22:45:28 UTC
Today, when trying to install app-office/libreoffice-bin-6.4.6.2-r1 I noticed that emerge was failing due to slot version not satisfied.

Digging to the issue I found out:
* I have =dev-libs/boost-1.74.0 installed
* Libreoffice bin depends on dev-libs/boost:0/1.72.0
* Have other software using boost, like for example dev-cpp/lucene++ depending on dev-libs/boost:=

If I manually emerge =dev-libs/boost-1.72.0-r1, then do a emerge @preserved-rebuild I can install this version of libreoffice-bin

So, if libreoffice-bin needs exactly 1.72.0 version, and all the others just need the same slot without any version forcing, why can't portage just select this version and trigger rebuild force of affected packages instead of just failing?

Reproducible: Always
Comment 1 David Carlos Manuelda 2020-09-18 22:46:07 UTC
Created attachment 661266 [details]
emerge --info output
Comment 2 David Carlos Manuelda 2020-09-18 22:46:41 UTC
This is the exact error message:

!!! Multiple package instances within a single package slot have been pulled
!!! into the dependency graph, resulting in a slot conflict:

dev-libs/boost:0

  (dev-libs/boost-1.72.0-r1:0/1.72.0::gentoo, ebuild scheduled for merge) USE="bzip2 icu lzma nls python threads zlib zstd -context -debug -doc -mpi -numpy -static-libs -tools" ABI_X86="(64) -32 (-x32)" PYTHON_TARGETS="python3_7 -python2_7 -python3_6 -python3_8" pulled in by
    dev-libs/boost:0/1.72.0 required by (app-office/libreoffice-bin-6.4.6.2-r1:0/0::gentoo, ebuild scheduled for merge) USE="-gnome -java -kde" ABI_X86="(64)" PYTHON_SINGLE_TARGET="python3_7"
                  ^^^^^^^^^                                                                                                                                                                                                                                                                                                       

  (dev-libs/boost-1.74.0:0/1.74.0::gentoo, installed) USE="bzip2 icu lzma nls python threads zlib zstd -context -debug -doc -mpi -numpy -static-libs -tools" ABI_X86="(64) -32 (-x32)" PYTHON_TARGETS="python3_7 -python2_7 -python3_6 -python3_8 -python3_9" pulled in by
    dev-libs/boost:0/1.74.0= required by (dev-cpp/lucene++-3.0.7-r2:0/0::gentoo, installed) USE="-debug" ABI_X86="(64)"
                  ^^^^^^^^^^                                                                                                                                                                     
    >=dev-libs/boost-1.60:0/1.74.0= required by (media-video/mkvtoolnix-49.0.0:0/0::gentoo, installed) USE="dbus dvd nls pch qt5 -debug -test" ABI_X86="(64)"
                         ^^^^^^^^^^                                                                                                                                                                                                                                                                                                                      
    >=dev-libs/boost-1.62.0:0/1.74.0=[threads] required by (dev-util/source-highlight-3.1.9:0/0::gentoo, installed) USE="-doc -static-libs" ABI_X86="(64)"
                           ^^^^^^^^^^                                                                                                                                                                                                                  
    dev-libs/boost:0/1.74.0=[nls] required by (app-i18n/poedit-2.3.1:0/0::gentoo, installed) USE="" ABI_X86="(64)"
                  ^^^^^^^^^^
Comment 3 David Carlos Manuelda 2020-09-18 22:52:18 UTC
Also, the error message is missleading, for example, it says:

dev-libs/boost:0/1.74.0=[nls] required by (app-i18n/poedit-2.3.1:0/0::gentoo, installed) USE="" ABI_X86="(64)"

But inspecting poedit ebuild, I could find that the dependency is not :0/1.74.0 as it suggest the message, but rather it is dev-libs/boost:=[nls]

In my opinion, the message is missleading as make := appear as a concrete slot-version dep, which is not true.
Comment 4 David Carlos Manuelda 2020-09-18 22:56:58 UTC
I would suggest a slot dependency check as something like the following (that is inspired in current case):

Make a list of slot-version specific packages, in this case it would be something like:

media-video/mkvtoolnix -> dev-libs/boost:=
dev-cpp/lucene++ -> dev-libs/boost:=
dev-util/source-highlight -> dev-libs/boost:=
app-i18n/poedit -> dev-libs/boost:=
app-office/libreoffice-bin -> dev-libs/boost:0/1.72.0

Now extract version specific requirements:

* If there are none, continue
* If there is exactly one, put that in the emerge list, and force rebuild the rest
* If there are more, fail with current message

Would something like this make sense?
Comment 5 Zac Medico gentoo-dev 2020-09-18 23:09:56 UTC
This looks like a possible duplicate of bug 559354 in the sense that a command like `emerge libreoffice-bin` does not give emerge permission to rebuild reverse dependencies of boost, whereas a command like `emerge -uD @world libreoffice-bin` would give it permission to rebuild anything necessary.

(In reply to David Carlos Manuelda from comment #3)
> But inspecting poedit ebuild, I could find that the dependency is not
> :0/1.74.0 as it suggest the message, but rather it is dev-libs/boost:=[nls]

The expansion from dev-libs/boost:=[nls] to dev-libs/boost:0/1.74.0=[nls] at build time is an intentional behavior which is specified by PMS:

https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-820008.3.3

The dev-libs/boost:0/1.74.0=[nls] dependency indicates which version of boost your installed version of app-i18n/poedit was built against, and it has to rebuilt when you upgrade to a significantly different version of boost.
Comment 6 Zac Medico gentoo-dev 2020-09-18 23:15:31 UTC
(In reply to David Carlos Manuelda from comment #4)
> Now extract version specific requirements:
> 
> * If there are none, continue
> * If there is exactly one, put that in the emerge list, and force rebuild
> the rest
> * If there are more, fail with current message
> 
> Would something like this make sense?

Yeah, `emerge -uD @world libreoffice-bin` would do something like that. The problem is that a command like `emerge libreoffice-bin` does not give permission to rebuild reverse dependencies of boost (see bug 559354).
Comment 7 David Carlos Manuelda 2020-09-18 23:32:31 UTC
Thanks for your quick reply!

In fact, looking at the bug you pointed to, seems this is related or even yes, a duplicate.

You started it with a "It's common for users to assume that they can run `emerge -u foo` and have it succeed"

And yes, seems it is common as I thought also like that :)
Comment 8 David Carlos Manuelda 2020-09-18 23:35:24 UTC
Anyway Zac, can the message be improved to point out that manual action is available? That would save a lot of time digging into the ebuilds to see whether a package depends on an specific slot or it was just as you said, expanded at runtime?
Comment 9 Zac Medico gentoo-dev 2020-09-19 19:04:24 UTC
(In reply to David Carlos Manuelda from comment #8)
> Anyway Zac, can the message be improved to point out that manual action is
> available? That would save a lot of time digging into the ebuilds to see
> whether a package depends on an specific slot or it was just as you said,
> expanded at runtime?

The two cases are already distinguishable in the output. For example, compare these two boost dependencies:

    dev-libs/boost:0/1.72.0 required by (app-office/libreoffice-bin-6.4.6.2-r1:0/0::gentoo, ebuild scheduled for merge) USE="-gnome -java -kde" ABI_X86="(64)" PYTHON_SINGLE_TARGET="python3_7"
                  ^^^^^^^^^    

    dev-libs/boost:0/1.74.0= required by (dev-cpp/lucene++-3.0.7-r2:0/0::gentoo, installed) USE="-debug" ABI_X86="(64)"
                  ^^^^^^^^^^    

The one that was expanded at build time was dev-libs/boost:0/1.74.0=, indicated by the trailing '=' character which indicates that it's an expansion of dev-libs/boost:= (slot operator).

The emerge man page has some documentation for the := slot operator. I suppose we could give a short warning message that refers to the := slot operator documentation whenever a slot operator dependency like this is displayed.