Skip to contentSkip to conversation

python3-importlib-metadata: fix class-target overriding default dependencies

PATCH In review Nicola Lunghi 2 participants 6 messages Nov 19, 2019 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python3-importlib-metadata: fix class-target overriding default dependencies

in commit fcda3fb1a3fbfac075325482074898dfb7138da7
python3-importlib-metadata: RDEPEND python3-misc only for target and nativesdk

The RDEPENDS for class target was "appended" with +=
RDEPENDS_${PN}_class-target += "python3-misc"

Using += for class target does't append the dependencies to the existing one, instead what it does is overwrite it. This was causing the RDEPENDS to be wrongly set only to python3-misc not including the one included in the inc file (zipp, pathlib2). Use append instead.

---
 .../python/python3-importlib-metadata_0.23.bb                 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-python/recipes-devtools/python/python3-importlib-metadata_0.23.bb +2 -2
index 851d703c9..8a971dac0 100644
@@ -1,5 +1,5 @@
 inherit pypi setuptools3
 require python-importlib-metadata.inc
 
-RDEPENDS_${PN}_class-target += "python3-misc"
-RDEPENDS_${PN}_class-nativesdk += "python3-misc"
+RDEPENDS_${PN}_append_class-target = " python3-misc"
+RDEPENDS_${PN}_append_class-nativesdk = " python3-misc"
Signature · 1 line
2.20.1
#1 lore raw

meta-python/recipes-devtools/python/python3-importlib-metadata_0.23.bb line 5

Quoted 4 lines · Nicola Lunghi
meta-python/recipes-devtools/python/python3-importlib-metadata_0.23.bb +2 -2
-RDEPENDS_${PN}_class-target += "python3-misc"
-RDEPENDS_${PN}_class-nativesdk += "python3-misc"
+RDEPENDS_${PN}_append_class-target = " python3-misc"
+RDEPENDS_${PN}_append_class-nativesdk = " python3-misc"

I believe all of the overrides are redundant now. Try just RDEPENDS_${PN} += "python3-misc" and check the native build is still successful.

Ross

author
#2 lore raw

Hi Ross,

if they are redundant then I can simply revert this patch??

commit fcda3fb1a3fbfac075325482074898dfb7138da7

Author: Fabio Berton <[email protected]>
Date:   Wed Nov 13 09:09:44 2019 -0300

python3-importlib-metadata: RDEPEND python3-misc only for target and
nativesdk

Python3 recipe rprovides python3-misc only for target and nativesdk, but if we have some recipe that rdepends python3-misc and has native in BBCLASSEXTEND bitbake raises an error showing that nothing rprovides python3-misc-native.

(quoted diff) +0 -0

python3-importlib-metadata_0.23.bb b/meta-python/recipes-devtools/python/ python3-importlib-metadata_0.23.bb
index 4c53d5fbb..851d703c9 100644

meta-python/recipes-devtools/python/python3-importlib-metadata_0.23.bb +2 -1
@@ -1,4 +1,5 @@
 inherit pypi setuptools3
 require python-importlib-metadata.inc
 
-RDEPENDS_${PN} += "python3-misc"
+RDEPENDS_${PN}_class-target += "python3-misc"
+RDEPENDS_${PN}_class-nativesdk += "python3-misc"
Quoted 17 lines · Ross Burton

Review

Quoted 4 lines · Nicola Lunghi
(quoted diff) +2 -2
-RDEPENDS_${PN}_class-target += "python3-misc"
-RDEPENDS_${PN}_class-nativesdk += "python3-misc"
+RDEPENDS_${PN}_append_class-target = " python3-misc"
+RDEPENDS_${PN}_append_class-nativesdk = " python3-misc"

I believe all of the overrides are redundant now. Try just RDEPENDS_${PN} += "python3-misc" and check the native build is still successful.

Ross
--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

A message that is not in the archive (sent off-list or not yet received): CABPh3UMNoSXmW1FFtvM_j=w1L5Pq7==qg-jfgCAAKyPcsasGVg@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#5 lore raw

PATCH 1/1 python3-importlib-metadata: fix class-target overriding default dependencies

Forwarded

---------- Forwarded message ---------
From: Ross Burton <[email protected]>
Date: Tue, 19 Nov 2019 at 13:46
Subject: Re: [oe] [meta-python][PATCH] python3-importlib-metadata: fix class-target overriding default dependencies
To: nick83ola <[email protected]>

Quoted 9 lines · On 19/11/2019 13:35, nick83ola wrote:

Hi Ross,

no the patch is right

If I do:
bitbake python3-importlib-metadata-native

Loading cache: 100%

|##########################################################################################################################################################################################################|

Quoted 5 lines

Time: 0:00:01
Loaded 4359 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing RPROVIDES 'python3-misc-native' (but virtual:native:/yocto/meta-openembedded/recipes-devtools/python/

python3-importlib-metadata_0.23.bb

Quoted 10 lines

<http://python3-importlib-metadata_0.23.bb> RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'python3-misc-native' is unbuildable, removing... Missing or unbuildable dependency chain was: ['python3-misc-native']
ERROR: Required build target 'python3-importlib-metadata-native' has no buildable providers.
Missing or unbuildable dependency chain was:
['python3-importlib-metadata-native', 'python3-misc-native']

Summary: There were 2 ERROR messages shown, returning a non-zero exit

code.

Quoted 2 lines

There's a way to provide ${PYTHON_PN}-misc-native?

Looks like a bug in python3.bb, the block of code starting '# First set RPROVIDES for -native case' should add python3-misc-native explicitly as that package isn't in the manifest.

A better fix would be to remove the misc package from the recipe itself and define it entirely in the manifest file so it is no longer 'special'.

Ross

author
#6 lore raw
In reply to a message not in the archive

Hi Ross,

thanks for your response.

So do you suggest to modify in python3_3.7.5.bb:

# First set RPROVIDES for -native case
# Hardcoded since it cant be python3-native-foo, should be
python3-foo-native
pn = 'python3'
rprovides = d.getVar('RPROVIDES').split() rprovides.append(pn + '-misc-native')

for key in python_manifest:
pypackage = pn + '-' + key + '-native'
if pypackage not in rprovides:
rprovides.append(pypackage)

d.setVar('RPROVIDES_class-native', ' '.join(rprovides))

(Or to add an RPROVIDES ayt the end -> is more explicit mabe? this function is getting rprovides = d.getVar('RPROVIDES').split() )

This change I imagine needs to be done also for python2?

Cheers
Nicola Lunghi

Quoted 43 lines · Ross Burton
Quoted 9 lines · On 19/11/2019 13:35, nick83ola wrote:

Hi Ross,

no the patch is right

If I do:
bitbake python3-importlib-metadata-native

Loading cache: 100%

|##########################################################################################################################################################################################################|

Quoted 5 lines

Time: 0:00:01
Loaded 4359 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing RPROVIDES 'python3-misc-native' (but virtual:native:/yocto/meta-openembedded/recipes-devtools/python/

python3-importlib-metadata_0.23.bb

Quoted 10 lines

<http://python3-importlib-metadata_0.23.bb> RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'python3-misc-native' is unbuildable, removing... Missing or unbuildable dependency chain was: ['python3-misc-native']
ERROR: Required build target 'python3-importlib-metadata-native' has no buildable providers.
Missing or unbuildable dependency chain was:
['python3-importlib-metadata-native', 'python3-misc-native']

Summary: There were 2 ERROR messages shown, returning a non-zero exit

code.

Quoted 2 lines

There's a way to provide ${PYTHON_PN}-misc-native?

Looks like a bug in python3.bb, the block of code starting '# First set RPROVIDES for -native case' should add python3-misc-native explicitly as that package isn't in the manifest.

A better fix would be to remove the misc package from the recipe itself and define it entirely in the manifest file so it is no longer 'special'.

Ross

#7 lore raw
Quoted 18 lines · On 19/11/2019 14:42, nick83ola wrote:

Hi Ross,

thanks for your response.

So do you suggest to modify in python3_3.7.5.bb <http://python3_3.7.5.bb>:

    # First set RPROVIDES for -native case
    # Hardcoded since it cant be python3-native-foo, should be
python3-foo-native
    pn = 'python3'
    rprovides = d.getVar('RPROVIDES').split() rprovides.append(pn + '-misc-native')

    for key in python_manifest:
        pypackage = pn + '-' + key + '-native'
        if pypackage not in rprovides:
              rprovides.append(pypackage)

Quoted 6 lines

        d.setVar('RPROVIDES_class-native', ' '.join(rprovides))

(Or to add an RPROVIDES ayt the end -> is more explicit mabe? this function is getting rprovides = d.getVar('RPROVIDES').split() )

This change I imagine needs to be done also for python2?

rprovides.append(pn + '-misc-native') seems like the easiest fix for now. Yes, Py2 probably has the same problem.

Ross