On Wed, 2016-02-10 at 17:43 +0000, Khem Raj wrote: > out of tree builds can break the assumption about setup.py being in > the > current directory, seen especially with devtool when using > externalsrc > many python modules cant build since it cant find setup.py in devtool > workspace > > Signed-off-by: Khem Raj <[email protected]> > --- > meta/classes/distutils.bbclass | 27 +++++++++++++++++---------- > meta/classes/distutils3.bbclass | 26 +++++++++++++++++++------- > 2 files changed, 36 insertions(+), 17 deletions(-) > > diff --git a/meta/classes/distutils.bbclass > b/meta/classes/distutils.bbclass > index cd06713..d9e0086 100644 > --- a/meta/classes/distutils.bbclass > +++ b/meta/classes/distutils.bbclass > @@ -8,44 +8,51 @@ DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} > \ > --install-data=${D}/${datadir}" > > distutils_do_compile() { > - STAGING_INCDIR=${STAGING_INCDIR} \ > - STAGING_LIBDIR=${STAGING_LIBDIR} \ > - BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ > - ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} > setup.py build ${DISTUTILS_BUILD_ARGS} || \ > - bbfatal "${PYTHON_PN} setup.py build execution failed." > + cwd=$PWD;cd ${S} > + STAGING_INCDIR=${STAGING_INCDIR} \ > + STAGING_LIBDIR=${STAGING_LIBDIR} \ > + BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ > + ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} > ${S}/setup.py build --build-base=${B} ${DISTUTILS_BUILD_ARGS} || \ > + bbfatal "${PYTHON_PN} setup.py build execution failed." > + cd $cwd > }
I still can't help feeling we're putting far too much boiler plate into these functions and putting in too many redundant checks, "just to be sure". If we really want to add the cd and so on, the [dirs] function flag should be used rather than playing with cwd like this IMO. Cheers, Richard -- _______________________________________________ Openembedded-core mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-core
