[oe] [meta-python][PATCH 2/2] m2crypto: depend on typing

Andy andreas.kling at gmail.com
Fri Feb 3 12:42:19 UTC 2017


sorry for bothering the list again with this question which for sure
was answered a hundred times in the past, but the increasing amount of
browser tabs shows that my search does not lead in the right
direction. Also I was not able to find a sophisticated grep expression
for the mailing list archives. If someone can point me to an earlier
thread or another link that clarifies things I would be very happy.

I'm working with bitbake for some years now but I'm still struggling
at this point since the beginning. How to define runtime dependencies
for a native recipe required by a target recipe. what I thought I had
learned in the past:

DEPENDS is for build time, do_configure -> do_populate_sysroot.
RDEPENDS for runtime, expressing dependencies for package manager and
do_build -> do_package_write. Native class allows to build the recipe
for the build machine, native recipes do not create packages.

I see many recipes setting RDEPENDS_${PN}_class-native = "", which
makes sense to me if native versions of things mentioned in RDEPENDS
do not exist as native.bbclass automatically adds '-native' to each
RDEPENDS. Also many recipes set RDEPENDS_${PN}_class-native to meaning
full values mapping to RDEPENDS or not. Why should values already
present in RDEPENDS_${PN} be added to RDEPENDS_${PN}_class-native? Why
does the native class handle rdepends if packaging is not part of the
native build? I see I'm missing an important part here :/

DEPENDS_class-native also makes sense to me if additional/other build
dependencies are required for the build machine.

So what can I do to get the dependency chain build?

1) add all native dependencies on the top level (in my case crda)
DEPENDS = "python-m2crypto-native python-typing ....". This does not
feel right as it has to be done for every top level recipe and I think
there must be a fancy way to do this.

2) add the dependency to the middle layer(in my case python-m2crypto)
but only for the native build DEPENDS_class-native =
"python-typing-native". feels much better, but seems to not reflect
the idea of DEPENDS.

3) add the dependency to the middle layer with DEPENDS. This is wrong
for sure ;)

4) rtfm section x.x.x

So in my case I have to add RDEPENDS_${PN}="python-typing" to
python-m2crypto to get the target packaging right. But what to do with
the native build. Using RDEPENDS only, leads to a build error in crda
as expected.

bitbake -f -c cleansstate python-m2crypto python-m2crypto-native
python-typing python-typing-native crda
bitbake crda
...
ERROR: crda-3.18-r0 do_compile: oe_runmake failed
...
| ERROR: Failed to import the "M2Crypto" module: No module named typing
....

-Andy

2017-02-02 15:09 GMT+01:00 Andy <andreas.kling at gmail.com>:
> you are right, this was a dependency during runtime of native, my
> build of crda failed with
> ERROR: Failed to import the "M2Crypto" module: No module named typing
> How should the the RDPENDS look like? Obviously I was to stupid to
> write it down correctly.
>
> 2017-02-02 15:00 GMT+01:00 Derek Straka <derek at asterius.io>:
>> Is this meant to be a build time dependency?  If it were required to build,
>> I would have expected to see a build failure.
>>
>> -Derek
>>
>> On Thu, Feb 2, 2017 at 8:49 AM, <andreas.kling at gmail.com> wrote:
>>
>>> From: Andy Kling <andreas.kling at peiker-cee.de>
>>>
>>>   m2crypto requires typing since 0.24.0-38-g8bbd0ec
>>> ---
>>>  meta-python/recipes-devtools/python/python-m2crypto_0.25.1.bb | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/meta-python/recipes-devtools/python/python-m2crypto_0.25.1.bb
>>> b/meta-python/recipes-devtools/python/python-m2crypto_0.25.1.bb
>>> index 5a9594f07..ca462229e 100644
>>> --- a/meta-python/recipes-devtools/python/python-m2crypto_0.25.1.bb
>>> +++ b/meta-python/recipes-devtools/python/python-m2crypto_0.25.1.bb
>>> @@ -12,7 +12,7 @@ SRC_URI += "file://0001-setup.py-link-in-
>>> sysroot-not-in-host-directories.patch "
>>>  PYPI_PACKAGE = "M2Crypto"
>>>  inherit pypi setuptools siteinfo
>>>
>>> -DEPENDS += "openssl swig-native"
>>> +DEPENDS += "openssl swig-native python-typing"
>>>
>>>  DISTUTILS_BUILD_ARGS += "build_ext --openssl=${STAGING_DIR_HOST}
>>> -I${STAGING_INCDIR}"
>>>  DISTUTILS_INSTALL_ARGS += "build_ext --openssl=${STAGING_DIR_HOST}"
>>> --
>>> 2.11.0
>>>
>>> --
>>> _______________________________________________
>>> Openembedded-devel mailing list
>>> Openembedded-devel at lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
>>>
>> --
>> _______________________________________________
>> Openembedded-devel mailing list
>> Openembedded-devel at lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-devel



More information about the Openembedded-devel mailing list