Summary: | RESTRICT_PYTHON_ABIS should respect PYTHON_DEPEND | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Ryan Hill (RETIRED) <rhill> |
Component: | Eclasses | Assignee: | Python Gentoo Team <python> |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | tomka |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 393581 |
Description
Ryan Hill (RETIRED)
2011-12-11 10:10:12 UTC
Fixed differently in Progress Overlay on 2011-06-28 (with minor fixes later). The fix was incompatible, so it is used only in EAPI >=4. The behavior remains unchanged in EAPI <=3. In EAPI >=4: - In packages not supporting installation for multiple Python ABIs: PYTHON_DEPEND is used to specify conditions of dependency on Python, range of versions of Python and USE dependencies. - In packages supporting installation for multiple Python ABIs: PYTHON_DEPEND is used to specify conditions of dependency on Python and USE dependencies. If dependency on Python is unconditional and without USE dependencies, then default value is sufficient, so ebuilds don't need to set PYTHON_DEPEND. PYTHON_RESTRICTED_ABIS (previously named RESTRICT_PYTHON_ABIS) is used to specify accepted versions of Python. Example 1: EAPI="4" PYTHON_MULTIPLE_ABIS="1" PYTHON_RESTRICTED_ABIS="2.4 2.5 *-jython *-pypy-*" Generated DEPEND/RDEPEND contains: || ( dev-lang/python:3.3 dev-lang/python:3.2 dev-lang/python:3.1 dev-lang/python:2.7 dev-lang/python:2.6 ) Example 2: EAPI="4" PYTHON_DEPEND="A? ( B? ( <<[ncurses,xml]>> ) )" PYTHON_MULTIPLE_ABIS="1" PYTHON_RESTRICTED_ABIS="2.4 2.5 *-jython *-pypy-*" Generated DEPEND/RDEPEND contains: A? ( B? ( || ( dev-lang/python:3.3[ncurses,xml] dev-lang/python:3.2[ncurses,xml] dev-lang/python:3.1[ncurses,xml] dev-lang/python:2.7[ncurses,xml] dev-lang/python:2.6[ncurses,xml] ) ) ) That looks even more complicated and unintuitive than the current situation. So now we need to set both PYTHON_DEPEND and RESTRICT_PYTHON_ABIS, except when we use EAPI 4, in which case we need to remember to set a different variable named PYTHON_RESTRICTED_ABIS and only use PYTHON_DEPEND to set USE dependencies using some newly invented arcane syntax? That is the opposite of fixed. This is what needs to happen (assume multiple ABIS for all): --- EAPI="2" PYTHON_DEPEND="2:2.6" inherit python --- Package is built with python 2.6 and 2.7. --- EAPI="4" PYTHON_DEPEND="2:2.6" inherit python --- Package is built with python 2.6 and 2.7. --- EAPI="4" PYTHON_DEPEND="2:2.6 3:3.1" inherit python --- Package is built with python 2.6, 2.7, 3.1 and 3.2. --- EAPI="4" PYTHON_DEPEND="2:2.6 3:3.1" inherit python --- USE_PYTHON="2.5 2.6 2.7 3.2". Package is built with python 2.6, 2.7, and 3.2. That's it. More complicated situations will require a more complicated syntax, but the easy stuff should be easy. I shouldn't need to keep a reference manual handy to figure out how to write a simple dependency. Since this bug thread is somewhat moving into a discussion, I'd like to chip in. Some of the python herd (and hobbyists such as myself) has been collaborating on a document that collects ideas in a similar fashion. You can read this document here: http://piratepad.net/gxpXCcNNvv In there there's a suggestion on PYTHON_TARGETS that moves from a restrict an allow point of view. Not sure what the greater goal is with this ticket - if this indeed is a bug, please disregard above. (In reply to comment #2) > That looks even more complicated and unintuitive than the current situation. Read SPECIFICATION OF DEPENDENCIES section in: http://people.apache.org/~Arfrever/Gentoo_Python_Supplementary_Guide_for_Developers (If you want additional help in learning of the new syntax, then you can ask for help in #gentoo-progress IRC channel.) > to set a different variable named PYTHON_RESTRICTED_ABIS It is easy to support both old and new name of this variable. Okay, that's nice, but that doesn't address the bug I filed. Version not in PYTHON_DEPEND, don't build with version. This seems like common sense. (In reply to comment #5) PYTHON_DEPEND="2:2.6" doesn't inform if given package supports e.g. PyPy 1.7. In packages supporting installation for multiple Python ABIs, the list of supported Python ABIs should be specified only by patterns of unsupported Python ABIs in RESTRICT_PYTHON_ABIS/PYTHON_RESTRICTED_ABIS. RESTRICT_PYTHON_ABIS/PYTHON_RESTRICTED_ABIS allows to restrict Python ABIs of CPython, Jython and PyPy. E.g. RESTRICT_PYTHON_ABIS="2.*-jython" restricts Python ABIs of Jython 2.*. In packages supporting installation for multiple Python ABIs, PYTHON_DEPEND should be used only to specify USE conditionals and USE dependencies, so many ebuilds wouldn't set PYTHON_DEPEND at all. All right then. So much for interfaces being easy to use and hard to use wrong. |