Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 530092 - Add repoman check .. for definition of REQUIRED_USE and *DEPEND when using python-r1
Summary: Add repoman check .. for definition of REQUIRED_USE and *DEPEND when using py...
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Repoman (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 472294 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-11-22 02:56 UTC by Sebastian Pipping
Modified: 2022-07-12 03:29 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Pipping gentoo-dev 2014-11-22 02:56:51 UTC
It turned out easy to forget defining REQUIRED_USE when using the python-r1 eclass, see bug #530086.

Would it be possible to add a repoman test that if python-r1 is inhereted a line defining REQUIRED_USE must be present in the ebuild?

Thanks in advance!
Comment 1 Brian Dolbec (RETIRED) gentoo-dev 2014-11-22 03:07:24 UTC
I don't think REQUIRED_USE is strictly needed to be defined.  Let's hear from the python team first.

Michal, can we get feedback from you wearing both your python and QA hats please?
especially since you coded the eclass to begin with ;)
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-11-22 09:55:35 UTC
I want that check for a long time, just have nobody with time to write it :P.

I think the simplest solution is to grep REQUIRED_USE for existence of any python_targets* flags, and RDEPEND for existence of python_targets*? conditionals. This would cover python-r1 and python-single-r1.

For python-any-r1, no REQUIRED_USE and python:X.Y (or jython, or pypy, or pypy3 :P) DEPEND check. We can also make it complain when python's in RDEPEND since that eclass is used for build-time use of Python only.
Comment 3 Sebastian Pipping gentoo-dev 2014-12-23 21:46:18 UTC
We may either

 a) hard-code-add distutils-r1 and gnome-python-common-r1 to
    the list of eclasses triggering these checks
    (due to inheriting from python-r1) or

 b) or to include all eclasses inheriting python-r1
    dynamically.

Or not?

# grep -l "inherit.*python-r1" /usr/portage/eclass/*.eclass
/usr/portage/eclass/distutils-r1.eclass
/usr/portage/eclass/gnome-python-common-r1.eclass
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-12-25 00:10:58 UTC
(In reply to Sebastian Pipping from comment #3)
> We may either
> 
>  a) hard-code-add distutils-r1 and gnome-python-common-r1 to
>     the list of eclasses triggering these checks
>     (due to inheriting from python-r1) or
> 
>  b) or to include all eclasses inheriting python-r1
>     dynamically.
> 
> Or not?

I think the package metadata contains flattened list of used eclasses. Then you don't have to care what inherits python-r1 / python-single-r1 / python-any-r1 indirectly :).
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-12-28 15:04:46 UTC
*** Bug 472294 has been marked as a duplicate of this bug. ***
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-12-28 15:16:41 UTC
First, let's get summarize how different variables should look like and what can be expected.


1. PYTHON_DEPS

1a. python-r1:

  dev-lang/python-exec:=
  python_targets_pythonX_Y? (
      >=dev-lang/python-X.Y.Z:X.Y[${PYTHON_REQ_USE}]
  )

1b. python-single-r1:

  dev-lang/python-exec:=
  python_single_target_pythonX_Y? (
      >=dev-lang/python-X.Y.Z:X.Y[${PYTHON_REQ_USE}]
  )

1c. python-any-r1

  || (
      >=dev-lang/python-X.Y.Z:X.Y[${PYTHON_REQ_USE}]
  )

or if python_gen_any_dep is used:

  || (
      (
          >=dev-lang/python-X.Y.Z:X.Y[${PYTHON_REQ_USE}]
          dev-foo/bar[python_targets...]
      )
  )

Notes:

- some ebuilds needed to explicitly depend on python-exec to enforce a specific version, so we shouldn't rely on that too much.

- We don't want to accidentally be happy about some stray '>=dev-lang/python-2.6' leftovers.

- As seen above, in python-any-r1 it's legit to use $(python_gen_any_dep) without ${PYTHON_DEPS}.


2. REQUIRED_USE

2a. python-r1:

  || ( python_targets_python2_7 ... )

2b. python-single-r1:

  python_single_target_python2_7? ( python_targets_python2_7 )
  ^^ ( python_single_target_python2_7 ... )

Notes:

- it would be nice not to catch custom 'doc? ( $(python_gen_useflags ...) )' while missing generic ${PYTHON_REQUIRED_USE}.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-12 03:18:18 UTC
repoman support has been removed per bug 835013.

Please file a new bug (or, I suppose, reopen this one) if you feel this check is still applicable to pkgcheck and doesn't already exist.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-12 03:29:50 UTC
pkgcheck's PythonCheck includes this.