All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package: libglib2: explicitly specify host's PYTHON to be used
@ 2017-07-17 22:13 Andrey Smirnov
  2017-07-31 19:37 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Andrey Smirnov @ 2017-07-17 22:13 UTC (permalink / raw)
  To: buildroot

Unless explicitly told otherwise, libglib2's ./configure step will
pick up the first python implementation it finds in ${PATH} as the
python to use for code generation scripts executed as a part of build
process. Because [host-]python is not specified in any of the
_DEPENDENCIES this creates a corner case leading to build failure.

What happens is [host-]libglib2's ./configure, executead after
[host-]python is already built, ends up picking up python from
${HOST_DIR}, which, not specified as a dependency will cause partial
rebuilds executed as:

cd ${OUTPUT_DIR}
find ${BUILD_DIR} -name ".stamp_host_installed" | xargs rm -f
rm -rf ${HOST_DIR}
make host-libglib2-install

to fail, becuase python would not be re-installed to ${HOST_DIR}.

To avoid having this problem completely, specify host's python using
--with-python option explicitly.

Cc: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 package/libglib2/libglib2.mk | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/package/libglib2/libglib2.mk b/package/libglib2/libglib2.mk
index 47d9f6313..fe53f2d3f 100644
--- a/package/libglib2/libglib2.mk
+++ b/package/libglib2/libglib2.mk
@@ -90,6 +90,12 @@ ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
 LIBGLIB2_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -marm"
 endif
 
+#
+# We explicitly specify --with-python to point to host's python here
+# and in LIBGLIB2_CONF_OPTS to make sure that ./configure does not
+# pick up python from ${HOST_DIR} thus creating a dependency that
+# would have to be specified in _DEPENDENCIES
+#
 HOST_LIBGLIB2_CONF_OPTS = \
 	--disable-coverage \
 	--disable-dtrace \
@@ -98,7 +104,8 @@ HOST_LIBGLIB2_CONF_OPTS = \
 	--disable-selinux \
 	--disable-systemtap \
 	--disable-xattr \
-	--with-pcre=system
+	--with-pcre=system \
+	--with-python=$$(which python)
 
 LIBGLIB2_DEPENDENCIES = \
 	host-pkgconf host-libglib2 host-gettext \
@@ -114,6 +121,7 @@ HOST_LIBGLIB2_DEPENDENCIES = \
 
 LIBGLIB2_CONF_OPTS = \
 	--with-pcre=system
+	--with-python=$$(which python)
 
 ifneq ($(BR2_ENABLE_LOCALE),y)
 LIBGLIB2_DEPENDENCIES += libiconv
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] package: libglib2: explicitly specify host's PYTHON to be used
  2017-07-17 22:13 [Buildroot] [PATCH] package: libglib2: explicitly specify host's PYTHON to be used Andrey Smirnov
@ 2017-07-31 19:37 ` Thomas Petazzoni
  2017-07-31 20:04   ` Andrey Smirnov
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2017-07-31 19:37 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, 17 Jul 2017 15:13:08 -0700, Andrey Smirnov wrote:

> +#
> +# We explicitly specify --with-python to point to host's python here
> +# and in LIBGLIB2_CONF_OPTS to make sure that ./configure does not
> +# pick up python from ${HOST_DIR} thus creating a dependency that
> +# would have to be specified in _DEPENDENCIES
> +#
>  HOST_LIBGLIB2_CONF_OPTS = \
>  	--disable-coverage \
>  	--disable-dtrace \
> @@ -98,7 +104,8 @@ HOST_LIBGLIB2_CONF_OPTS = \
>  	--disable-selinux \
>  	--disable-systemtap \
>  	--disable-xattr \
> -	--with-pcre=system
> +	--with-pcre=system \
> +	--with-python=$$(which python)
>  
>  LIBGLIB2_DEPENDENCIES = \
>  	host-pkgconf host-libglib2 host-gettext \
> @@ -114,6 +121,7 @@ HOST_LIBGLIB2_DEPENDENCIES = \
>  
>  LIBGLIB2_CONF_OPTS = \
>  	--with-pcre=system
> +	--with-python=$$(which python)

What is Python being used for in the build process of glib2 ? I'm
concerned by the fact that we're simply passing the path to the host
Python interpreter, even though we're cross-compiling.

It might be correct, if Python is just used to generate some code on
the build machine, but it'd be good to understand.

Also, using `which python` is preferred over $$(which python).

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] package: libglib2: explicitly specify host's PYTHON to be used
  2017-07-31 19:37 ` Thomas Petazzoni
@ 2017-07-31 20:04   ` Andrey Smirnov
  0 siblings, 0 replies; 3+ messages in thread
From: Andrey Smirnov @ 2017-07-31 20:04 UTC (permalink / raw)
  To: buildroot

On Mon, Jul 31, 2017 at 12:37 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Mon, 17 Jul 2017 15:13:08 -0700, Andrey Smirnov wrote:
>
>> +#
>> +# We explicitly specify --with-python to point to host's python here
>> +# and in LIBGLIB2_CONF_OPTS to make sure that ./configure does not
>> +# pick up python from ${HOST_DIR} thus creating a dependency that
>> +# would have to be specified in _DEPENDENCIES
>> +#
>>  HOST_LIBGLIB2_CONF_OPTS = \
>>       --disable-coverage \
>>       --disable-dtrace \
>> @@ -98,7 +104,8 @@ HOST_LIBGLIB2_CONF_OPTS = \
>>       --disable-selinux \
>>       --disable-systemtap \
>>       --disable-xattr \
>> -     --with-pcre=system
>> +     --with-pcre=system \
>> +     --with-python=$$(which python)
>>
>>  LIBGLIB2_DEPENDENCIES = \
>>       host-pkgconf host-libglib2 host-gettext \
>> @@ -114,6 +121,7 @@ HOST_LIBGLIB2_DEPENDENCIES = \
>>
>>  LIBGLIB2_CONF_OPTS = \
>>       --with-pcre=system
>> +     --with-python=$$(which python)
>
> What is Python being used for in the build process of glib2 ? I'm
> concerned by the fact that we're simply passing the path to the host
> Python interpreter, even though we're cross-compiling.
>
> It might be correct, if Python is just used to generate some code on
> the build machine, but it'd be good to understand.
>

To the best of my knowledge none of the python code ends up being
installed on the target and it is used purely to generate .c and .h
files. It appears that all of the auto-generated code will have
"Generated by gdbus-codegen" string as a part of file header and quick
grep of both "host-libglib" and "libglib" on my configurations comes
up with the following files:

gio/xdp-dbus.c
gio/gdbus-daemon-generated.h
gio/xdp-dbus.h
gio/gdbus-daemon-generated.c

> Also, using `which python` is preferred over $$(which python).
>

Sure, I'll change that.

Thanks,
Andrey Smirnov

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-31 20:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-17 22:13 [Buildroot] [PATCH] package: libglib2: explicitly specify host's PYTHON to be used Andrey Smirnov
2017-07-31 19:37 ` Thomas Petazzoni
2017-07-31 20:04   ` Andrey Smirnov

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.