Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 370565 - Portage should treat "${flag}? ( )" and "|| ( )" in unexpanded dependencies as error
Summary: Portage should treat "${flag}? ( )" and "|| ( )" in unexpanded dependencies a...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
: 628466 (view as bug list)
Depends on:
Blocks: 358927
  Show dependency tree
 
Reported: 2011-06-07 21:43 UTC by Arfrever Frehtes Taifersar Arahesis (RETIRED)
Modified: 2017-11-05 11:12 UTC (History)
1 user (show)

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


Attachments
portage-detect_invalid_dependencies.patch (portage-detect_invalid_dependencies.patch,618 bytes, patch)
2011-06-09 13:29 UTC, Arfrever Frehtes Taifersar Arahesis (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-06-07 21:43:48 UTC
IUSE="A"
DEPEND="A? ( )"
RDEPEND="${DEPEND}"
Comment 1 Sebastian Luther (few) 2011-06-08 05:16:08 UTC
I guess you mean "A? ( )". This is not invalid. This case has to be dealt with for deps like: "a? ( b? ( B ) c? ( C ) )", where b and c are disabled.
Comment 2 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-06-08 13:55:54 UTC
(In reply to comment #1)
> I guess you mean "A? ( )". This is not invalid. This case has to be dealt with
> for deps like: "a? ( b? ( B ) c? ( C ) )", where b and c are disabled.

But when value literally specified in unexpanded DEPEND/RDEPEND/PDEPEND contains "${flag}? ( )", then why would it have to be valid?
Comment 3 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-06-09 13:21:25 UTC
"|| ( )" also should be treated as error.
Comment 4 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-06-09 13:29:12 UTC
Created attachment 276377 [details, diff]
portage-detect_invalid_dependencies.patch

This patch seems to work.
Comment 6 Zac Medico gentoo-dev 2011-06-10 09:31:09 UTC
This is fixed in 2.1.10.1 and 2.2.0_alpha39.
Comment 8 Ulrich Müller gentoo-dev 2017-08-22 13:16:30 UTC
*** Bug 628466 has been marked as a duplicate of this bug. ***
Comment 9 Ulrich Müller gentoo-dev 2017-08-22 13:37:01 UTC
The new behaviour contradicts PMS:
https://projects.gentoo.org/pms/6/pms.html#x1-810008.2.3

However: The change in Portage was made in 2011, which means that ebuilds cannot rely on any definite behaviour with respect to empty dependency groups. Presumably this also implies that virtually all ebuild repositories will be compliant with Portage and won't use such empty groups.

(Also, the spec for empty any-of and exactly-one-of groups is not what one would expect: Nullary OR and nullary XOR operation should evaluate to false, while PMS says they should evaluate to true.)

So, what do you think about:
- Retroactively change PMS to ban empty dependency groups, in all specification style variables.
- Make Portage behaviour consistent for all variables. AFAICS, it does not allow empty groups in DEPEND and LICENSE, but allows them in REQUIRED_USE.


(In reply to Zac Medico from comment #5)
> http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1faa9bddc2859c73ce8984b43eca816c30bdb5f1

Updated URL, for reference:
https://gitweb.gentoo.org/proj/portage.git/commit/?id=1faa9bddc2859c73ce8984b43eca816c30bdb5f1
Comment 10 Ulrich Müller gentoo-dev 2017-08-24 05:11:25 UTC
Proposed patch:
https://archives.gentoo.org/gentoo-pms/message/ace2912fbbc582a08067c02ce400fedb

I intend to submit this to the council agenda in September for approval.
Comment 11 Ulrich Müller gentoo-dev 2017-08-30 12:29:04 UTC
(In reply to Ulrich Müller from comment #10)
> I intend to submit this to the council agenda in September for approval.

Submitted and retracted again, because it appears to be controversial.

Portage team, please revert commit 1faa9bddc2859c73ce8984b43eca816c30bdb5f1.
Comment 12 Ulrich Müller gentoo-dev 2017-10-08 19:09:07 UTC
Updated version approved in today's Council meeting:

<dilfridge> 1) PMS changes as detailed in https://archives.gentoo.org/gentoo-pms/message/a612bdc64f7aa3e556b129a67493da1b
<dilfridge> 2) note that PMS team comes up with a proposal for the next EAPI to define a behavior that seems correct in terms of resolver and our uses
* dilfridge yes
* K_F yes
* slyfox abstains
* ulm yes
* mgorny yes
* WilliamH yes
<dilfridge> ok that's 5 yes, 1 abstention, 1 absent, motion passed
Comment 13 Larry the Git Cow gentoo-dev 2017-10-08 19:13:55 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/pms.git/commit/?id=693019a78e99a0329b0609c01b0bad3e4b037027

commit 693019a78e99a0329b0609c01b0bad3e4b037027
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2017-10-02 16:52:41 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2017-10-08 19:11:24 +0000

    Ban empty groups in dependency specifications.
    
    The specification for empty groups was originally added to match
    historical Portage behaviour. However, Portage was changed in 2011
    to treat empty dependency groups as an error, therefore ebuilds cannot
    rely on any definite behaviour. Consequently, empty groups are not used
    by any ebuild or eclass in the Gentoo repository.
    
    Note that the explicit handling for empty groups is still retained for
    the case of implicit empty groups resulting from collapsing USE
    conditionals in any-of groups et al.
    
    This is a retroactive change for all EAPIs.
    
    Bug: https://bugs.gentoo.org/370565

 dependencies.tex | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)}
Comment 14 Larry the Git Cow gentoo-dev 2017-10-15 14:20:36 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/pms.git/commit/?id=04e3e077a99e337cb9b9f0d6e710037ba488b6bb

commit 04e3e077a99e337cb9b9f0d6e710037ba488b6bb
Author:     Ulrich Müller <ulm@kph.uni-mainz.de>
AuthorDate: 2017-10-10 10:19:31 +0000
Commit:     Ulrich Müller <ulm@kph.uni-mainz.de>
CommitDate: 2017-10-10 10:28:30 +0000

    Appendix: Document retroactive ban of empty dependency groups.
    
    Bug: https://bugs.gentoo.org/370565

 appendices.tex   | 6 ++++++
 dependencies.tex | 1 +
 2 files changed, 7 insertions(+)}