Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 5063EE00C2B; Thu, 17 Mar 2016 09:25:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 0DB6BE00C23 for ; Thu, 17 Mar 2016 09:25:07 -0700 (PDT) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id u2HGP6PN028330 (version=TLSv1 cipher=AES128-SHA bits=128 verify=OK) for ; Thu, 17 Mar 2016 09:25:07 -0700 Received: from yow-dellw-ma.wrs.com (128.224.56.18) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.3.248.2; Thu, 17 Mar 2016 09:25:06 -0700 From: Mark Asselstine To: , Date: Thu, 17 Mar 2016 12:25:05 -0400 Message-ID: <1458231905-15071-1-git-send-email-mark.asselstine@windriver.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Cc: arnold.german@windriver.com Subject: [PATCH] lxc: fix build issue - unable to find Python.h X-BeenThere: meta-virtualization@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Discussion of layer enabling hypervisor, virtualization tool stack, and cloud support" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 16:25:09 -0000 Content-Type: text/plain Prior to poky commit 3d45853eef1269b455d840a60491802251368378 [python3: fix do_configure check platform triplet error] lxc's configure scripts would fail to find python3 and would therefor configure with python3 support disabled. After poky integrated the above commit lxc can, and does, detect python3 and attempts to configure with python support. Unfortunately it would detect the host's python3 which it would use to run setup.py and therefor get the host's include path etc. and ultimately fail to build. To fix this we make 'python' support configurable via a PACKAGECONFIG and we default to not configuring with this support, to match our previous configuration. We also fix things such that 'python' support can be enabled in the PACKAGECONFIG and the build will complete successfully, using our python3 and not the host's. We might want to eventually enable the python support but since this not only enables python extensions but even goes as far as turning scripts like lxc-ls into python scripts, instead of shell scripts, keeping it disabled for now is the minimally invasive approach. Signed-off-by: Mark Asselstine --- recipes-containers/lxc/lxc_1.1.4.bb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/recipes-containers/lxc/lxc_1.1.4.bb b/recipes-containers/lxc/lxc_1.1.4.bb index e017dcf..a4c44d2 100644 --- a/recipes-containers/lxc/lxc_1.1.4.bb +++ b/recipes-containers/lxc/lxc_1.1.4.bb @@ -64,6 +64,13 @@ PACKAGECONFIG[apparmour] = "--enable-apparmor,--disable-apparmor,apparmor,apparm PACKAGECONFIG[templates] = ",,, ${PN}-templates" PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux" PACKAGECONFIG[seccomp] ="--enable-seccomp,--disable-seccomp,libseccomp,libseccomp" +PACKAGECONFIG[python] = "--enable-python,--disable-python,python3,python3-core" + +# required by python3 to run setup.py +export BUILD_SYS +export HOST_SYS +export STAGING_INCDIR +export STAGING_LIBDIR inherit autotools pkgconfig ptest update-rc.d systemd @@ -78,6 +85,7 @@ INITSCRIPT_PARAMS_${PN}-setup = "${OS_DEFAULT_INITSCRIPT_PARAMS}" FILES_${PN}-doc = "${mandir} ${infodir}" # For LXC the docdir only contains example configuration files and should be included in the lxc package FILES_${PN} += "${docdir}" +FILES_${PN} += "${libdir}/python3*" FILES_${PN}-dbg += "${libexecdir}/lxc/.debug" PACKAGES =+ "${PN}-templates ${PN}-setup ${PN}-networking" FILES_${PN}-templates += "${datadir}/lxc/templates" @@ -92,6 +100,12 @@ FILES_${PN}-setup += "/etc/init.d" PRIVATE_LIBS_${PN}-ptest = "liblxc.so.1" +CACHED_CONFIGUREVARS += " \ + ac_cv_path_PYTHON='${STAGING_BINDIR_NATIVE}/python3-native/python3' \ + am_cv_python_pyexecdir='${exec_prefix}/${libdir}/python3.5/site-packages' \ + am_cv_python_pythondir='${prefix}/${libdir}/python3.5/site-packages' \ +" + do_install_append() { # The /var/cache/lxc directory created by the Makefile # is wiped out in volatile, we need to create this at boot. @@ -107,6 +121,13 @@ do_install_append() { install -d ${D}${sysconfdir}/init.d install -m 755 config/init/sysvinit/lxc* ${D}${sysconfdir}/init.d fi + + # since python3-native is used for install location this will not be + # suitable for the target and we will have to correct the package install + if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then + if [ -d ${D}${exec_prefix}/lib/python* ]; then mv ${D}${exec_prefix}/lib/python* ${D}${libdir}/; fi + rmdir --ignore-fail-on-non-empty ${D}${exec_prefix}/lib + fi } EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests" -- 2.1.4