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

Bug 780807

Summary: distutils-r1.eclass: DISTUTILS_OPTIONAL=1 doesn't work as expected when DISTUTILS_SINGLE_IMPL=1 is also set.
Product: Gentoo Linux Reporter: Alfred Wingate <parona>
Component: EclassesAssignee: Python Gentoo Team <python>
Status: RESOLVED FIXED    
Severity: normal CC: gentoo, ionen, parona, sam
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/36945
Whiteboard:
Package list:
Runtime testing required: ---

Description Alfred Wingate 2021-04-07 11:02:53 UTC
Setting DISTUTILS_SINGLE_IMPL=1 together with DISTUTILS_OPTIONAL=1 doesn't work as expected due to python-single-r1 eclass exporting pkg_setup  unconditionally and therefore contradicts with what is said in eclass documentation.

> "... and no phase functions will be exported."

Essentially means that you can't have optional single python implementation distutils-r1 use in an ebuild.

Reproducible: Always

Steps to Reproduce:
1. Create an distutils-r1 ebuild DISTUTILS_OPTIONAL=1 and DISTUTILS_SINGLE_IMPL=1
2. Try to merge with empty or unset PYTHON_SINGLE_TARGET
Actual Results:  
Experience failure in pkg_setup due to unset PYTHON_SINGLE_TARGET

Expected Results:  
It should succeed without an error.

# A very basic ebuild that experiences the issue

EAPI=7

DISTUTILS_SINGLE_IMPL=1
DISTUTILS_OPTIONAL=1
PYTHON_COMPAT=(python3_{7..9})

inherit distutils-r1
SLOT="0"
Comment 1 Larry the Git Cow gentoo-dev 2024-06-14 12:26:24 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d344e223068c8d9eb695ba464facb4451bb07d5c

commit d344e223068c8d9eb695ba464facb4451bb07d5c
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2024-06-01 09:14:26 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2024-06-14 12:26:05 +0000

    distutils-r1.eclass: Doc DISTUTILS_OPTIONAL + DISTUTILS_SINGLE_IMPL
    
    Closes: https://bugs.gentoo.org/780807
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 eclass/distutils-r1.eclass | 5 +++++
 1 file changed, 5 insertions(+)