I'm not sure if it is a bug or a feature, so I put it as a feature here in the first place.
I'm writing an ebuild and I tried to use the following condition:
RDEPEND="|| ( media-plugins/alsa-plugins[abi_x86_32(-)] !media-sound/pulseaudio )"
It should say:
If pulseaudio is installed, then alsa-plugins should be installed with the 32bit use flag OR pulseaudio should not be installed
In theory, the any of many condition should be able to cover this?
But I get a blocker only:
Calculating dependencies... done!
[ebuild U ~] games-fps/ut2003-2225-r9007::own [2225-r9006::own] USE="-dedicated" 9,805 KiB
[blocks B ] media-sound/pulseaudio ("media-sound/pulseaudio" is blocking games-fps/ut2003-2225-r9007)
Total: 1 package (1 upgrade), Size of downloads: 9,805 KiB
Conflict: 1 block (1 unsatisfied)
* Error: The above package list contains packages which cannot be
* installed at the same time on the same system.
This bug should clarify if the above condition should be possible, or if it is a valid feature request, or if there is another way to specify such a statement.
This bug should not cover that I'm try to extend an ebuild for an old 32bit application, and that I may be able to solve the sound bug with the application if I configure pulseaudio correctly to not be involved with this 32bit application, if it is not installed in 32bit.
There have been a number of recent changes in the relevant code, so you may get a different result with the portage-2.3.24 (see bug 645002).
The reason it chooses the blocker is that this choice "costs less" because it doesn't have to install media-plugins/alsa-plugins[abi_x86_32(-)], but the cost calculation has changed in portage-2.3.24, so what portage version are you using?
Also, the way that you are using the blocker looks questionable, but it might work as intended with portage-2.3.24.
(In reply to Zac Medico from comment #1)
> There have been a number of recent changes in the relevant code, so you may
> get a different result with the portage-2.3.24 (see bug 645002).
> The reason it chooses the blocker is that this choice "costs less" because
> it doesn't have to install media-plugins/alsa-plugins[abi_x86_32(-)]
But it chooses it even if media-plugins/alsa-plugins[abi_x86_32(-)] is fullfilled already, is this as intended?
> the cost calculation has changed in portage-2.3.24, so what portage version
> are you using?
Tested with 2.3.19-r1 (~)2.3.24-r
> Also, the way that you are using the blocker looks questionable, but it
> might work as intended with portage-2.3.24.
I did not found any documentation to do what I want to do. Is there a best practise guide? (maybe I need to switch to gentoo forum with this question, but at least this bug should sort out if portage works as intended in this case and/or if https://devmanual.gentoo.org/general-concepts/dependencies/index.html needs a update?)
Created attachment 521060 [details]
The attached unit test reproduces the problem. This patch suppresses the problem:
> diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py
> index 2896e2389..b4614be0c 100644
> --- a/pym/portage/dep/dep_check.py
> +++ b/pym/portage/dep/dep_check.py
> @@ -562,10 +562,10 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None,
> # added to the digraph, in order to distinguish between
> # those packages and installed packages that may need
> # to be uninstalled in order to resolve blockers.
> - if not any(pkg in graph for pkg in
> - graph_db.match_pkgs(atom)):
> - all_in_graph = False
> - break
> + #if not any(pkg in graph for pkg in
> + # graph_db.match_pkgs(atom)):
> + # all_in_graph = False
> + # break
> circular_atom = None
> if not (parent is None or priority is None) and \
> (parent.onlydeps or
Generally, blockers are used to indicate a conflict of some kind, and the presence of some package (such as media-plugins/alsa-plugins) typically does not make this sort of conflict "disappear".