All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Ashfield <bruce.ashfield@windriver.com>
To: Mark Asselstine <mark.asselstine@windriver.com>,
	<meta-virtualization@yoctoproject.org>
Cc: arnold.german@windriver.com
Subject: Re: [PATCH] lxc: fix build issue - unable to find Python.h
Date: Mon, 21 Mar 2016 10:26:52 -0400	[thread overview]
Message-ID: <56F004AC.4090001@windriver.com> (raw)
In-Reply-To: <1458231905-15071-1-git-send-email-mark.asselstine@windriver.com>

On 2016-03-17 12:25 PM, Mark Asselstine wrote:
> 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.

merged as-is to master.

>
> 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.

Indeed. That's overkill for now, but definitely something to consider.

Bruce

>
> Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
> ---
>   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"
>



      reply	other threads:[~2016-03-21 14:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-17 16:25 [PATCH] lxc: fix build issue - unable to find Python.h Mark Asselstine
2016-03-21 14:26 ` Bruce Ashfield [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56F004AC.4090001@windriver.com \
    --to=bruce.ashfield@windriver.com \
    --cc=arnold.german@windriver.com \
    --cc=mark.asselstine@windriver.com \
    --cc=meta-virtualization@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.