public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/3] distutils-r1.eclass: Strip the trailing slash from D
@ 2016-05-29 13:25 Mike Gilbert
  2016-05-29 13:25 ` [gentoo-dev] [PATCH 2/3] distutils-r1.eclass: Move creation of .pydistutils.cfg to esetup.py Mike Gilbert
  2016-05-29 13:25 ` [gentoo-dev] [PATCH 3/3] distutils-r1.eclass: Do not modify the HOME variable Mike Gilbert
  0 siblings, 2 replies; 3+ messages in thread
From: Mike Gilbert @ 2016-05-29 13:25 UTC (permalink / raw)
  To: gentoo-dev; +Cc: python

This just looks nicer in build logs.
---
 eclass/distutils-r1.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index afd29ed..171762c 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -555,8 +555,8 @@ distutils-r1_python_install() {
 		done
 	fi
 
-	local root=${D}/_${EPYTHON}
-	[[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D}
+	local root=${D%/}/_${EPYTHON}
+	[[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D%/}
 
 	esetup.py install --root="${root}" "${args[@]}"
 
-- 
2.8.3



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-dev] [PATCH 2/3] distutils-r1.eclass: Move creation of .pydistutils.cfg to esetup.py
  2016-05-29 13:25 [gentoo-dev] [PATCH 1/3] distutils-r1.eclass: Strip the trailing slash from D Mike Gilbert
@ 2016-05-29 13:25 ` Mike Gilbert
  2016-05-29 13:25 ` [gentoo-dev] [PATCH 3/3] distutils-r1.eclass: Do not modify the HOME variable Mike Gilbert
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Gilbert @ 2016-05-29 13:25 UTC (permalink / raw)
  To: gentoo-dev; +Cc: python

Also remove .pydistutils.cfg from HOME before returning.

This config should only be needed when we are invoking setup.py. The
esetup.py wrapper provides a normalized way for doing this; if ebuilds
call setup.py without the wrapper, they are now also responsible for
setting the build directory if necessary.

This change allows us to stop overriding the HOME variable, and prevents
leakage of eclass-specifc configuration to the general ebuild
environment.
---
 eclass/distutils-r1.eclass | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 171762c..334ce73 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -242,10 +242,19 @@ esetup.py() {
 	local die_args=()
 	[[ ${EAPI} != [45] ]] && die_args+=( -n )
 
+	[[ ${BUILD_DIR} ]] && _distutils-r1_create_setup_cfg
+
 	set -- "${PYTHON:-python}" setup.py "${mydistutilsargs[@]}" "${@}"
 
 	echo "${@}" >&2
-	"${@}" || die "${die_args[@]}" || return ${?}
+	"${@}" || die "${die_args[@]}"
+	local ret=${?}
+
+	if [[ ${BUILD_DIR} ]]; then
+		rm "${HOME}"/.pydistutils.cfg || die "${die_args[@]}"
+	fi
+
+	return ${ret}
 }
 
 # @FUNCTION: distutils_install_for_testing
@@ -436,7 +445,6 @@ _distutils-r1_copy_egg_info() {
 distutils-r1_python_compile() {
 	debug-print-function ${FUNCNAME} "${@}"
 
-	_distutils-r1_create_setup_cfg
 	_distutils-r1_copy_egg_info
 
 	esetup.py build "${@}"
@@ -511,9 +519,6 @@ distutils-r1_python_install() {
 	# enable compilation for the install phase.
 	local -x PYTHONDONTWRITEBYTECODE=
 
-	# re-create setup.cfg with install paths
-	_distutils-r1_create_setup_cfg
-
 	# python likes to compile any module it sees, which triggers sandbox
 	# failures if some packages haven't compiled their modules yet.
 	addpredict "${EPREFIX}/usr/$(get_libdir)/${EPYTHON}"
-- 
2.8.3



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-dev] [PATCH 3/3] distutils-r1.eclass: Do not modify the HOME variable
  2016-05-29 13:25 [gentoo-dev] [PATCH 1/3] distutils-r1.eclass: Strip the trailing slash from D Mike Gilbert
  2016-05-29 13:25 ` [gentoo-dev] [PATCH 2/3] distutils-r1.eclass: Move creation of .pydistutils.cfg to esetup.py Mike Gilbert
@ 2016-05-29 13:25 ` Mike Gilbert
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Gilbert @ 2016-05-29 13:25 UTC (permalink / raw)
  To: gentoo-dev; +Cc: python

This was only necessary when we ran phases in parallel.
Also, PMS says this variable should not be modified.
---
 eclass/distutils-r1.eclass | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 334ce73..c545290 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -637,12 +637,6 @@ distutils-r1_run_phase() {
 	# in the sys.path_importer_cache)
 	mkdir -p "${BUILD_DIR}/lib" || die
 
-	# We need separate home for each implementation, for .pydistutils.cfg.
-	if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
-		local -x HOME=${HOME}/${EPYTHON}
-		mkdir -p "${HOME}" || die
-	fi
-
 	# Set up build environment, bug #513664.
 	local -x AR=${AR} CC=${CC} CPP=${CPP} CXX=${CXX}
 	tc-export AR CC CPP CXX
-- 
2.8.3



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-29 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-29 13:25 [gentoo-dev] [PATCH 1/3] distutils-r1.eclass: Strip the trailing slash from D Mike Gilbert
2016-05-29 13:25 ` [gentoo-dev] [PATCH 2/3] distutils-r1.eclass: Move creation of .pydistutils.cfg to esetup.py Mike Gilbert
2016-05-29 13:25 ` [gentoo-dev] [PATCH 3/3] distutils-r1.eclass: Do not modify the HOME variable Mike Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox