Skip to contentSkip to conversation

python-setuptools: Do not pull in target python for native recipe

PATCH New Darren Hart 2 participants 3 messages Dec 17, 2011

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 python-setuptools: Do not pull in target python for native recipe

glib-2.0 DEPENDS and DEPENDS_virtclass-native on python-argparse-native, which inherits from setuptools, which DEPENDS on python-setuptools-native.

python-setuptools uses RDEPENDS_${PN} for python-distutils and python-compression. By using ${PN} instead of python-setuptools, when the -native version is built, RDEPENDS_python-setuptools-native gets set to include the target versions python-setuptools and python-compression, pulling the entire target python dependency chain into the build.

Follow recipes like automake by setting RDEPENDS with the PN written out explicitly, RDEPENDS_python-setuptools, to avoid dragging in the target python dependency chain.

CC Richard Purdie <[email protected]>
CC Saul Wold <[email protected]>
---
 .../python/python-setuptools_0.6c11.bb             |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
meta/recipes-devtools/python/python-setuptools_0.6c11.bb +1 -1
index 5dd5f31..0b8a219 100644
@@ -20,7 +20,7 @@ do_install_prepend() {
     install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages
 }
 
-RDEPENDS_${PN} = "\
+RDEPENDS_python-setuptools = "\
   python-distutils \
   python-compression \
 "
Signature · 5 lines
1.7.5.4
-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#1 lore raw

PATCH 1/1 native.bbclass: Fix variable remapping coverage

When looking for RDEPENDS to process, bitbake iterates through PACKAGES *and* PN. Since native.bbclass sets PACKAGES to be empty, its pointless remapping the list of PACKAGES since this does nothing. There is a problem since *_${PN} are used by bitbake but not remapped by the native.bbclass class extension code.

This changes the code to remap _${PN} in both expanded and unexpanded forms. We use the unexpanded form since d.expandkeys() has not been called at the point this code executes. Remapping the expanded form is belt and braces to cover any case where the unexpanded key form may not be present.

As a result of this, various surprising dependencies are uncovered and the patch rectifies those. These are real bugs since they're injecting unneeded (unremapped) dependencies into the dependency chain. Workarounds for this kind of problem in autoconf are removed.

---

meta/classes/native.bbclass +1 -1
index 49823d6..00196ba 100644
@@ -127,7 +127,7 @@ python native_virtclass_handler () {
         d.setVar(varname, " ".join(newdeps))
 
     map_dependencies("DEPENDS", e.data)
-    for pkg in (e.data.getVar("PACKAGES", True).split() + [""]):
+    for pkg in [e.data.getVar("PN", True), "", "${PN}"]:
         map_dependencies("RDEPENDS", e.data, pkg)
         map_dependencies("RRECOMMENDS", e.data, pkg)
         map_dependencies("RSUGGESTS", e.data, pkg)
meta/recipes-devtools/autoconf/autoconf.inc +2 -0
index 08a1b02..1d0cf90 100644
@@ -6,6 +6,8 @@ LICENSE = "GPLv3"
 HOMEPAGE = "http://www.gnu.org/software/autoconf/"
 SECTION = "devel"
 DEPENDS += "m4-native"
+DEPENDS_virtclass-native = "m4-native gnu-config-native"
+DEPENDS_virtclass-nativesdk = "m4-nativesdk gnu-config-nativesdk"
 RDEPENDS_${PN} = "m4 gnu-config"
 
 SRC_URI = "${GNU_MIRROR}/autoconf/autoconf-${PV}.tar.bz2 \
meta/recipes-devtools/autoconf/autoconf_2.68.bb +0 -8
index 9028e83..84eb182 100644
@@ -4,8 +4,6 @@ PR = "r4"
 
 PARALLEL_MAKE = ""
 
-DEPENDS += "m4-native"
-RDEPENDS_${PN} = "m4 gnu-config"
 LICENSE = "GPLv2 & GPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
 		    file://COPYINGv3;md5=d32239bcb673463ab874e80d47fae504"
@@ -22,12 +20,6 @@ SRC_URI += "file://autoreconf-include.patch \
 SRC_URI[md5sum] = "864d785215aa60d627c91fcb21b05b07"
 SRC_URI[sha256sum] = "c491fb273fd6d4ca925e26ceed3d177920233c76d542b150ff35e571454332c8"
 
-DEPENDS_virtclass-native = "m4-native gnu-config-native"
-RDEPENDS_${PN}_virtclass-native = "m4-native gnu-config-native"
-
-DEPENDS_virtclass-nativesdk = "m4-nativesdk gnu-config-nativesdk"
-RDEPENDS_${PN}_virtclass-nativesdk = "m4-nativesdk gnu-config-nativesdk"
-
 SRC_URI_append_virtclass-native = " file://fix_path_xtra.patch"
 
 EXTRA_OECONF += "ac_cv_path_M4=m4"
meta/recipes-devtools/automake/automake_1.11.1.bb +2 -2
index ff8353f..6bffecf 100644
@@ -3,7 +3,7 @@ LICENSE="GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" 
 DEPENDS_virtclass-native = "autoconf-native"
 
-RDEPENDS_automake += "\
+RDEPENDS_${PN} += "\
     autoconf \
     perl \
     perl-module-bytes \
@@ -27,7 +27,7 @@ RDEPENDS_automake += "\
     perl-module-text-parsewords \
     perl-module-vars "
 
-RDEPENDS_automake-native = "autoconf-native perl-native-runtime"
+RDEPENDS_${PN}_virtclass-native = "autoconf-native perl-native-runtime"
 
 PATHFIXPATCH = "file://path_prog_fixes.patch"
 PATHFIXPATCH_virtclass-native = ""
meta/recipes-devtools/python/python-native_2.7.2.bb +2 -0
index d036eca..10bfa6c 100644
@@ -16,6 +16,8 @@ S = "${WORKDIR}/Python-${PV}"
 
 inherit native
 
+RPROVIDES += "python-distutils-native python-compression-native python-textutils-native"
+
 EXTRA_OEMAKE = '\
   BUILD_SYS="" \
   HOST_SYS="" \
meta/recipes-gnome/gnome/gconf_3.2.3.bb +1 -0
index 9d327fc..f7d3594 100644
@@ -39,6 +39,7 @@ do_install_append() {
 
 # disable dbus-x11 when x11 isn't in DISTRO_FEATURES
 RDEPENDS_${PN} += "${@base_contains('DISTRO_FEATURES', 'x11', 'dbus-x11', '', d)}"
+RDEPENDS_${PN}_virtclass-native = ""
 
 FILES_${PN} += "${libdir}/GConf/* \
 	        ${libdir}/gio/*/*.so \
meta/recipes-support/boost/boost.inc +1 -0
index aa577b3..fc417c9 100644
@@ -74,6 +74,7 @@ FILES_${PN}-dev = "${includedir} ${libdir}/libboost_*.so ${libdir}/libboost_*.a"
 # "boost" is a metapackage which pulls in all boost librabries
 PACKAGES += "${PN}"
 RRECOMMENDS_${PN} += "${BOOST_PACKAGES}"
+RRECOMMENDS_${PN}_virtclass-native = ""
 ALLOW_EMPTY_${PN} = "1"
 
 # to avoid GNU_HASH QA errors added LDFLAGS to ARCH; a little bit dirty but at least it works
author Acked-by Acked-by Koen Kooi on v1 1/1
#2 lore raw

Re: [PATCH] native.bbclass: Fix variable remapping coverage

Quoted 11 lines · Richard Purdie

When looking for RDEPENDS to process, bitbake iterates through PACKAGES *and* PN. Since native.bbclass sets PACKAGES to be empty, its pointless remapping the list of PACKAGES since this does nothing. There is a problem since *_${PN} are used by bitbake but not remapped by the native.bbclass class extension code.

This changes the code to remap _${PN} in both expanded and unexpanded forms. We use the unexpanded form since d.expandkeys() has not been called at the point this code executes. Remapping the expanded form is belt and braces to cover any case where the unexpanded key form may not be present.

Quoted 6 lines

As a result of this, various surprising dependencies are uncovered and the patch rectifies those. These are real bugs since they're injecting unneeded (unremapped) dependencies into the dependency chain. Workarounds for this kind of problem in autoconf are removed.

Tested. This resolves the issues I was experiencing with python-setuptools.

I'm still wondering about the following commit:

$ git show 0c6595a71965e4c1a56902cb7e7ca74f3b469e19
commit 0c6595a71965e4c1a56902cb7e7ca74f3b469e19
Author: Martin Jansa <[email protected]>
Date:   Sat Mar 5 06:15:52 2011 +0000

distutils-base: Only RDEPEND python-core on target packages

* fixes ie setuptools, without this patch it RDEPENDs on
python-core-native, wh
* imported from OE 8377b8ec57f35b9e5b81a74c77f68fd6e02949c8

(From OE-Core rev: 65317f21736293cc4eeb9a404e9f01043df7565d)

(quoted diff) +0 -0

b/meta/classes/distutils-base.bbcl
index 2e151de..e84b0fc 100644

meta/classes/distutils-base.bbclass +0 -0
@@ -1,5 +1,5 @@
 DEPENDS  += "${@["python-native python",

""][(bb.data.getVar('PACKAGES', d, 1) ==
-RDEPENDS += "python-core"
+RDEPENDS_${PN} += "${@['', 'python-core']['${PN}' == '${BPN}']}"

inherit distutils-common-base

This seems to be addressing similar sorts of issues. In the patch below you added an RPROVIDES to python-native_2.7.2.bb. I reverted the above commit and then appended "python-core-native" the the new RPROVIDES for python-native and the build now succeeds. Is the above commit a bandaid that is better resolved with the RDEPENDS?

--
Darren

Quoted 119 lines

---

meta/classes/native.bbclass +1 -1
index 49823d6..00196ba 100644
@@ -127,7 +127,7 @@ python native_virtclass_handler () {
         d.setVar(varname, " ".join(newdeps))
 
     map_dependencies("DEPENDS", e.data)
-    for pkg in (e.data.getVar("PACKAGES", True).split() + [""]):
+    for pkg in [e.data.getVar("PN", True), "", "${PN}"]:
         map_dependencies("RDEPENDS", e.data, pkg)
         map_dependencies("RRECOMMENDS", e.data, pkg)
         map_dependencies("RSUGGESTS", e.data, pkg)
meta/recipes-devtools/autoconf/autoconf.inc +2 -0
index 08a1b02..1d0cf90 100644
@@ -6,6 +6,8 @@ LICENSE = "GPLv3"
 HOMEPAGE = "http://www.gnu.org/software/autoconf/"
 SECTION = "devel"
 DEPENDS += "m4-native"
+DEPENDS_virtclass-native = "m4-native gnu-config-native"
+DEPENDS_virtclass-nativesdk = "m4-nativesdk gnu-config-nativesdk"
 RDEPENDS_${PN} = "m4 gnu-config"
 
 SRC_URI = "${GNU_MIRROR}/autoconf/autoconf-${PV}.tar.bz2 \
meta/recipes-devtools/autoconf/autoconf_2.68.bb +0 -8
index 9028e83..84eb182 100644
@@ -4,8 +4,6 @@ PR = "r4"
 
 PARALLEL_MAKE = ""
 
-DEPENDS += "m4-native"
-RDEPENDS_${PN} = "m4 gnu-config"
 LICENSE = "GPLv2 & GPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
 		    file://COPYINGv3;md5=d32239bcb673463ab874e80d47fae504"
@@ -22,12 +20,6 @@ SRC_URI += "file://autoreconf-include.patch \
 SRC_URI[md5sum] = "864d785215aa60d627c91fcb21b05b07"
 SRC_URI[sha256sum] = "c491fb273fd6d4ca925e26ceed3d177920233c76d542b150ff35e571454332c8"
 
-DEPENDS_virtclass-native = "m4-native gnu-config-native"
-RDEPENDS_${PN}_virtclass-native = "m4-native gnu-config-native"
-
-DEPENDS_virtclass-nativesdk = "m4-nativesdk gnu-config-nativesdk"
-RDEPENDS_${PN}_virtclass-nativesdk = "m4-nativesdk gnu-config-nativesdk"
-
 SRC_URI_append_virtclass-native = " file://fix_path_xtra.patch"
 
 EXTRA_OECONF += "ac_cv_path_M4=m4"
meta/recipes-devtools/automake/automake_1.11.1.bb +2 -2
index ff8353f..6bffecf 100644
@@ -3,7 +3,7 @@ LICENSE="GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" 
 DEPENDS_virtclass-native = "autoconf-native"
 
-RDEPENDS_automake += "\
+RDEPENDS_${PN} += "\
     autoconf \
     perl \
     perl-module-bytes \
@@ -27,7 +27,7 @@ RDEPENDS_automake += "\
     perl-module-text-parsewords \
     perl-module-vars "
 
-RDEPENDS_automake-native = "autoconf-native perl-native-runtime"
+RDEPENDS_${PN}_virtclass-native = "autoconf-native perl-native-runtime"
 
 PATHFIXPATCH = "file://path_prog_fixes.patch"
 PATHFIXPATCH_virtclass-native = ""
meta/recipes-devtools/python/python-native_2.7.2.bb +2 -0
index d036eca..10bfa6c 100644
@@ -16,6 +16,8 @@ S = "${WORKDIR}/Python-${PV}"
 
 inherit native
 
+RPROVIDES += "python-distutils-native python-compression-native python-textutils-native"
+
 EXTRA_OEMAKE = '\
   BUILD_SYS="" \
   HOST_SYS="" \
meta/recipes-gnome/gnome/gconf_3.2.3.bb +1 -0
index 9d327fc..f7d3594 100644
@@ -39,6 +39,7 @@ do_install_append() {
 
 # disable dbus-x11 when x11 isn't in DISTRO_FEATURES
 RDEPENDS_${PN} += "${@base_contains('DISTRO_FEATURES', 'x11', 'dbus-x11', '', d)}"
+RDEPENDS_${PN}_virtclass-native = ""
 
 FILES_${PN} += "${libdir}/GConf/* \
 	        ${libdir}/gio/*/*.so \
meta/recipes-support/boost/boost.inc +1 -0
index aa577b3..fc417c9 100644
@@ -74,6 +74,7 @@ FILES_${PN}-dev = "${includedir} ${libdir}/libboost_*.so ${libdir}/libboost_*.a"
 # "boost" is a metapackage which pulls in all boost librabries
 PACKAGES += "${PN}"
 RRECOMMENDS_${PN} += "${BOOST_PACKAGES}"
+RRECOMMENDS_${PN}_virtclass-native = ""
 ALLOW_EMPTY_${PN} = "1"
 
 # to avoid GNU_HASH QA errors added LDFLAGS to ARCH; a little bit dirty but at least it works

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel