Buildroot Archive on 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

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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox