[OE-core] [PATCH 1/9] distutils: Consider S != B case

Khem Raj raj.khem at gmail.com
Wed Feb 10 18:53:48 UTC 2016


> On Feb 10, 2016, at 10:29 AM, Richard Purdie <richard.purdie at linuxfoundation.org> 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 <raj.khem at gmail.com>
>> ---
>> 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20160210/52c5ecba/attachment-0002.sig>


More information about the Openembedded-core mailing list