Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 522652

Summary: Rebuild not triggered with RDEPEND="|| ( other_package some_package:= )" and --dynamic-deps=n
Product: Portage Development Reporter: Arfrever Frehtes Taifersar Arahesis <arfrever.fta>
Component: Core - DependenciesAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 155723, 484436    
Attachments: dep_zapdeps: fix bug #522652

Description Arfrever Frehtes Taifersar Arahesis 2014-09-12 16:47:55 UTC
Rebuild is not triggered with RDEPEND="|| ( other_package some_package:= )" and --dynamic-deps=n.
some_package is installed. other_package is not installed.
Problem does not occur when some_package:= is first in || ( ).
It is irrelevant if := was appended to other_package.

# cat app-misc/A/A-1.ebuild
EAPI="5"
SLOT="0/1"
KEYWORDS="*"
# cat app-misc/A/A-2.ebuild
EAPI="5"
SLOT="0/2"
KEYWORDS="*"
# cat app-misc/B/B-0.ebuild
EAPI="5"
SLOT="0"
KEYWORDS="*"
RDEPEND="app-misc/A:="
# cat app-misc/C/C-0.ebuild
EAPI="5"
SLOT="0"
KEYWORDS="*"
RDEPEND="|| ( app-misc/X app-misc/A:= )"
# emerge -1 =app-misc/A-1
...
# emerge app-misc/{B,C}
...
# cat /var/db/pkg/app-misc/C-0/RDEPEND
|| ( app-misc/X app-misc/A:0/1= )
# emerge -ptv --dynamic-deps=y app-misc/A

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild  rR    ] app-misc/C-0::local  0 KiB
[ebuild  rR    ] app-misc/B-0::local  0 KiB
[ebuild  r  U  ]  app-misc/A-2:0/2::local [1:0/1::local] 0 KiB

Total: 3 packages (1 upgrade, 2 reinstalls), Size of downloads: 0 KiB

The following packages are causing rebuilds:

  (app-misc/A-2:0/2::local, ebuild scheduled for merge) causes rebuilds for:
    (app-misc/B-0:0/0::local, ebuild scheduled for merge)
    (app-misc/C-0:0/0::local, ebuild scheduled for merge)
# emerge -ptv --dynamic-deps=n app-misc/A

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild  rR    ] app-misc/B-0::local  0 KiB
[ebuild  r  U  ]  app-misc/A-2:0/2::local [1:0/1::local] 0 KiB

Total: 2 packages (1 upgrade, 1 reinstall), Size of downloads: 0 KiB

The following packages are causing rebuilds:

  (app-misc/A-2:0/2::local, ebuild scheduled for merge) causes rebuilds for:
    (app-misc/B-0:0/0::local, ebuild scheduled for merge)
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-09-12 16:52:49 UTC
Use of := within || is self-contradictory, meaningless and forbidden. Patch for repoman check will be appreciated.
Comment 2 Zac Medico gentoo-dev 2014-09-12 17:12:56 UTC
(In reply to Michał Górny from comment #1)
> Use of := within || is self-contradictory, meaningless and forbidden.

Sure, but since app-misc/X is not installed, it suggests that this test case may represent an opportunity to improve our || dep handling for other cases that are not forbidden. So, I'd like to re-open this bug for further investigation.
Comment 3 Zac Medico gentoo-dev 2014-09-12 20:21:24 UTC
There's a working test case here:

	https://github.com/zmedico/portage/commits/bug_522652

The debug log shows it select X.

Parent:    (app-misc/C-0:0/0::test_repo, installed)
Depstring: || ( app-misc/X app-misc/A:0/1= )
Priority:  runtime
Candidates: ['app-misc/X']

The unsatisfied app-misc/X dependency is placed in _initially_unsatisfied_deps and ignored.

I will work on creating a similar test case that does not involve any forbidden || ( bar foo:= ) usage. For example, this wouldn't be forbidden:

	|| ( app-misc/X <app-misc/A-2 )
Comment 4 Zac Medico gentoo-dev 2014-09-12 20:57:07 UTC
(In reply to Zac Medico from comment #3)
> I will work on creating a similar test case that does not involve any
> forbidden || ( bar foo:= ) usage. For example, this wouldn't be forbidden:
> 
> 	|| ( app-misc/X <app-misc/A-2 )

In my bug_522652 branch on github, there's a modified version of the previous test, using the above deps that are not forbidden. It demonstrates similar undesirable behavior that we can fix (dep_zapdeps is at fault).
Comment 5 Zac Medico gentoo-dev 2014-09-13 02:46:47 UTC
Created attachment 384644 [details, diff]
dep_zapdeps: fix bug #522652

For cases such as || ( X <A-2 ), where X is unsatisfiable and A-1 is installed, fix dep_zapdeps to make the correct choice.

I've split the || ( X A:= ) test case into a separate patch which is in this branch:

	https://github.com/zmedico/portage/tree/bug_522652
Comment 7 Zac Medico gentoo-dev 2014-09-17 14:56:11 UTC
This is fixed in 2.2.13.