Skip to content

Commit

Permalink
distutils-r1.eclass: Handle missing BUILD_DIR for any-r1 API
Browse files Browse the repository at this point in the history
When any-r1 API is used for *_all sub-phases, an implementation that
was not selected by the user may be used.  In this case,
DISTUTILS_IN_SOURCE_BUILD will not create the BUILD_DIR for this
implementation; however, the phase runner will still try to enter it
and fail.  Handle this gracefully by falling back to ${S}.

Closes: https://bugs.gentoo.org/701506
Signed-off-by: Michał Górny <[email protected]>
  • Loading branch information
mgorny committed Dec 1, 2019
1 parent 1a16ffb commit f9b70d3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion eclass/distutils-r1.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,11 @@ distutils-r1_run_phase() {
debug-print-function ${FUNCNAME} "${@}"

if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
# only force BUILD_DIR if implementation is explicitly enabled
# for building; any-r1 API may select one that is not
# https://bugs.gentoo.org/701506
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]] &&
has "${EPYTHON/./_}" ${PYTHON_TARGETS}; then
cd "${BUILD_DIR}" || die
fi
local BUILD_DIR=${BUILD_DIR}/build
Expand Down

0 comments on commit f9b70d3

Please sign in to comment.