Skip to contentSkip to conversation

Fix disutils and extend python-setuptools to nativesdk

PATCH In review Chen Qi 2 participants 4 messages Jul 27, 2016

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

cover Fix disutils and extend python-setuptools to nativesdk

The following changes since commit b32d430c3c7dccf3a8d06ab492d648893a05950f:

dpkg: use snapshot.debian.org for SRC_URI (2016-07-26 08:56:08 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib ChenQi/python-fixes
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/python-fixes

Chen Qi (2):
distutils: fix to avoid file-rdeps QA issue
python3-setuptools: extend to nativesdk

 meta/classes/distutils.bbclass                            | 4 ++--
 meta/classes/distutils3.bbclass                           | 4 ++--
 meta/recipes-devtools/python/python3-setuptools_22.0.5.bb | 7 ++++---
 3 files changed, 8 insertions(+), 7 deletions(-)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/2 distutils: fix to avoid file-rdeps QA issue

For some nativesdk python packages, we would sometimes have the following QA issue.

WARNING: nativesdk-python-django-1.8.8-r0 do_package_qa: QA Issue: /opt/windriver/wrlinux/9.0-qemux86/sysroots/x86_64-wrlinuxsdk-linux/usr/bin/django-admin contained in package nativesdk-python-django require\
s /opt/windriver/wrlinux/9.0-qemux86/sysroots/x86_64-wrlinuxsdk-linux/usr/bin/env, but no providers found in RDEPENDS_nativesdk-python-django? [file-rdeps]

The problem is that in distutils.bbclass (and distutils3.bbclass), we replace ${STAGING_BINDIR_NATIVE}/python-native/python with ${bindir}/env. In nativesdk situation, ${bindir} is not /usr/bin, and this causes the QA issue.

Fix this problem by hardcoding '/usr/bin/env'.

Usually, we don't like hardcoding. But as far as I can see, /usr/bin/env is a little special. We skip the 'file-rdeps' QA checking for '/usr/bin/env' dependency. Besides, scripts in many packages do use '/usr/bin/env'. So we should assume it's there in our system.

---
 meta/classes/distutils.bbclass  | 4 ++--
 meta/classes/distutils3.bbclass | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
meta/classes/distutils.bbclass +2 -2
index 857572d..e74cd81 100644
@@ -44,7 +44,7 @@ distutils_do_install() {
         if test -e ${D}${bindir} ; then	
             for i in ${D}${bindir}/* ; do \
                 if [ ${PN} != "${BPN}-native" ]; then
-                	sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${bindir}/env\ python:g $i
+                	sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:/usr/bin/env\ python:g $i
 		fi
                 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
             done
@@ -53,7 +53,7 @@ distutils_do_install() {
         if test -e ${D}${sbindir}; then
             for i in ${D}${sbindir}/* ; do \
                 if [ ${PN} != "${BPN}-native" ]; then
-                	sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${bindir}/env\ python:g $i
+                	sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:/usr/bin/env\ python:g $i
 		fi
                 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
             done
meta/classes/distutils3.bbclass +2 -2
index a6720c5..1132f72 100644
@@ -47,14 +47,14 @@ distutils3_do_install() {
 
         if test -e ${D}${bindir} ; then	
             for i in ${D}${bindir}/* ; do \
-                sed -i -e s:${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}:${bindir}/env\ ${PYTHON_PN}:g $i
+                sed -i -e s:${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}:/usr/bin/env\ ${PYTHON_PN}:g $i
                 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
             done
         fi
 
         if test -e ${D}${sbindir}; then
             for i in ${D}${sbindir}/* ; do \
-                sed -i -e s:${STAGING_BINDIR_NATIVE}/python-${PYTHON_PN}/${PYTHON_PN}:${bindir}/env\ ${PYTHON_PN}:g $i
+                sed -i -e s:${STAGING_BINDIR_NATIVE}/python-${PYTHON_PN}/${PYTHON_PN}:/usr/bin/env\ ${PYTHON_PN}:g $i
                 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
             done
         fi
Signature · 1 line
1.9.1
#2 lore raw

Re: [PATCH 1/2] distutils: fix to avoid file-rdeps QA issue

Quoted 7 lines · Chen Qi

Fix this problem by hardcoding '/usr/bin/env'.

Usually, we don't like hardcoding. But as far as I can see, /usr/bin/env is a little special. We skip the 'file-rdeps' QA checking for '/usr/bin/env' dependency. Besides, scripts in many packages do use '/usr/bin/env'. So we should assume it's there in our system.

I think we should be replacing with ${bindir} for target binaries (so the right paths are used, no matter what bindir is set to) and hard-coding /usr/bin for native and nativesdk.

If the sanity test is hardcoding /usr/bin/env then that likely should change to respect ${bindir} too.

Ross

author
#3 lore raw

PATCH 2/2 python3-setuptools: extend to nativesdk

In reply to Chen Qi
---
 meta/recipes-devtools/python/python3-setuptools_22.0.5.bb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta/recipes-devtools/python/python3-setuptools_22.0.5.bb +4 -3
index fb2931c..90c242d 100644
@@ -2,6 +2,7 @@ require python-setuptools.inc
 
 DEPENDS += "python3"
 DEPENDS_class-native += "python3-native"
+DEPENDS_class-nativesdk += "python3-nativesdk"
 
 inherit distutils3
 
@@ -14,11 +15,11 @@ do_install_append() {
     echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth
 }
 
-RDEPENDS_${PN} = "\
+RDEPENDS_${PN}_class-native = "\
   python3-distutils \
   python3-compression \
 "
-RDEPENDS_${PN}_class-target = "\
+RDEPENDS_${PN} = "\
   python3-ctypes \
   python3-distutils \
   python3-email \
@@ -34,4 +35,4 @@ RDEPENDS_${PN}_class-target = "\
   python3-unittest \
   python3-xml \
 "
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
1.9.1