> On Feb 10, 2016, at 10:29 AM, Richard Purdie wrote: > > 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 >> --- >> 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”. it could be, but I thought there are so many python modules in other layers that it could be safer to stay this way. but I agree > > 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. > thats a good idea. I am testing this now http://git.openembedded.org/openembedded-core-contrib/commit/?h=kraj/pu&id=49dd32007d7cc4f1c3fb97e0437223b5b2b1630c > Cheers, > > Richard