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"