Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] python: fix host-python symlink installation when no python is selected
@ 2014-04-06  7:35 Samuel Martin
  2014-04-06  8:30 ` Baruch Siach
  2014-04-06  9:55 ` Thomas Petazzoni
  0 siblings, 2 replies; 6+ messages in thread
From: Samuel Martin @ 2014-04-06  7:35 UTC (permalink / raw)
  To: buildroot

When no python interpreter is selected, all host-python symlink
installation were disabled.
This could lead to a non-existing $(HOST_DIR)/usr/bin/python program.

Fixes:
  http://autobuild.buildroot.net/results/6e7/6e74a343b4e8e113fd34d45c9279419e233afe8a/

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
 package/python/python.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/python/python.mk b/package/python/python.mk
index feff644..8a2ba65 100644
--- a/package/python/python.mk
+++ b/package/python/python.mk
@@ -192,9 +192,9 @@ PYTHON_POST_INSTALL_STAGING_HOOKS += PYTHON_INSTALL_STAGING_PYTHON_CONFIG_SYMLIN
 PYTHON_AUTORECONF = YES
 
 # Some packages may have build scripts requiring python2.
-# Only install the python symlink in the host tree if python2 is enabled
-# for the target.
-ifeq ($(BR2_PACKAGE_PYTHON),y)
+# Only install the python symlink in the host tree if python3 is not enabled
+# for the target, otherwise the default python program may be missing.
+ifneq ($(BR2_PACKAGE_PYTHON3),y)
 define HOST_PYTHON_INSTALL_PYTHON_SYMLINK
 	ln -sf python2 $(HOST_DIR)/usr/bin/python
 	ln -sf python2-config $(HOST_DIR)/usr/bin/python-config
-- 
1.9.1

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

* [Buildroot] [PATCH] python: fix host-python symlink installation when no python is selected
  2014-04-06  7:35 [Buildroot] [PATCH] python: fix host-python symlink installation when no python is selected Samuel Martin
@ 2014-04-06  8:30 ` Baruch Siach
  2014-04-06 10:48   ` Samuel Martin
  2014-04-06  9:55 ` Thomas Petazzoni
  1 sibling, 1 reply; 6+ messages in thread
From: Baruch Siach @ 2014-04-06  8:30 UTC (permalink / raw)
  To: buildroot

Hi Samuel,

On Sun, Apr 06, 2014 at 09:35:15AM +0200, Samuel Martin wrote:
> When no python interpreter is selected, all host-python symlink
> installation were disabled.
> This could lead to a non-existing $(HOST_DIR)/usr/bin/python program.
> 
> Fixes:
>   http://autobuild.buildroot.net/results/6e7/6e74a343b4e8e113fd34d45c9279419e233afe8a/

I'm working on a similar problem 
(http://autobuild.buildroot.net/results/dd0/dd04833b11a0ebb0193c861cb375b2112dd339d1/). 
The following configure log shows the problem:

checking for a Python interpreter with version >= 2.6... python
checking for python... /usr/bin/python
checking for python version... 2.6

The host packaged python (2.6) is detected instead of the buildroot built one 
(2.7), because the python symlink is missing. In this case 
BR2_PACKAGE_PYTHON3=y so even with this patch the problem is not fixed. Your 
commit e1584b7d3350 (python: rework python symlinks installation) originally 
limited host python symlink creation, but I could not understand the reason 
for this from the commit log.

baruch

> Signed-off-by: Samuel Martin <s.martin49@gmail.com>
> ---
>  package/python/python.mk | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/package/python/python.mk b/package/python/python.mk
> index feff644..8a2ba65 100644
> --- a/package/python/python.mk
> +++ b/package/python/python.mk
> @@ -192,9 +192,9 @@ PYTHON_POST_INSTALL_STAGING_HOOKS += PYTHON_INSTALL_STAGING_PYTHON_CONFIG_SYMLIN
>  PYTHON_AUTORECONF = YES
>  
>  # Some packages may have build scripts requiring python2.
> -# Only install the python symlink in the host tree if python2 is enabled
> -# for the target.
> -ifeq ($(BR2_PACKAGE_PYTHON),y)
> +# Only install the python symlink in the host tree if python3 is not enabled
> +# for the target, otherwise the default python program may be missing.
> +ifneq ($(BR2_PACKAGE_PYTHON3),y)
>  define HOST_PYTHON_INSTALL_PYTHON_SYMLINK
>  	ln -sf python2 $(HOST_DIR)/usr/bin/python
>  	ln -sf python2-config $(HOST_DIR)/usr/bin/python-config
> -- 
> 1.9.1

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] [PATCH] python: fix host-python symlink installation when no python is selected
  2014-04-06  7:35 [Buildroot] [PATCH] python: fix host-python symlink installation when no python is selected Samuel Martin
  2014-04-06  8:30 ` Baruch Siach
@ 2014-04-06  9:55 ` Thomas Petazzoni
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2014-04-06  9:55 UTC (permalink / raw)
  To: buildroot

Dear Samuel Martin,

On Sun,  6 Apr 2014 09:35:15 +0200, Samuel Martin wrote:
> When no python interpreter is selected, all host-python symlink
> installation were disabled.
> This could lead to a non-existing $(HOST_DIR)/usr/bin/python program.
> 
> Fixes:
>   http://autobuild.buildroot.net/results/6e7/6e74a343b4e8e113fd34d45c9279419e233afe8a/
> 
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>
> ---
>  package/python/python.mk | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.

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

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

* [Buildroot] [PATCH] python: fix host-python symlink installation when no python is selected
  2014-04-06  8:30 ` Baruch Siach
@ 2014-04-06 10:48   ` Samuel Martin
  2014-04-06 11:03     ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Samuel Martin @ 2014-04-06 10:48 UTC (permalink / raw)
  To: buildroot

Hi Baruch, all,

On Sun, Apr 6, 2014 at 10:30 AM, Baruch Siach <baruch@tkos.co.il> wrote:
> Hi Samuel,
>
> On Sun, Apr 06, 2014 at 09:35:15AM +0200, Samuel Martin wrote:
>> When no python interpreter is selected, all host-python symlink
>> installation were disabled.
>> This could lead to a non-existing $(HOST_DIR)/usr/bin/python program.
>>
>> Fixes:
>>   http://autobuild.buildroot.net/results/6e7/6e74a343b4e8e113fd34d45c9279419e233afe8a/
>
> I'm working on a similar problem
> (http://autobuild.buildroot.net/results/dd0/dd04833b11a0ebb0193c861cb375b2112dd339d1/).
> The following configure log shows the problem:
>
> checking for a Python interpreter with version >= 2.6... python
> checking for python... /usr/bin/python
> checking for python version... 2.6
>
> The host packaged python (2.6) is detected instead of the buildroot built one
> (2.7), because the python symlink is missing. In this case
> BR2_PACKAGE_PYTHON3=y so even with this patch the problem is not fixed. Your
> commit e1584b7d3350 (python: rework python symlinks installation) originally
> limited host python symlink creation, but I could not understand the reason
> for this from the commit log.

Just to sum-up the python cases:
1) .config:
  BR2_PACKAGE_PYTHON=n
  BR2_PACKAGE_PYTHON3=n
output:
  host/usr/bin/python2 may exist
  host/usr/bin/python never exists without this patch
2) .config:
  BR2_PACKAGE_PYTHON=y
  BR2_PACKAGE_PYTHON3=n
output:
  host/usr/bin/python2 exists
  host/usr/bin/python -> python2
  host/usr/bin/python3 never exists
3) .config:
  BR2_PACKAGE_PYTHON=n
  BR2_PACKAGE_PYTHON3=y
output:
  host/usr/bin/python3 exists
  host/usr/bin/python -> python3
  host/usr/bin/python2 may exist


In this build failure, the .config is in case #3.

What happen is libevdev is built before python3 and host-python3 are built.
But host/usr/bin/python2 is already built (because it is a dependency
of libevdev).

So, there is no python symlink yet installed in the host dir.; that's
why the configure script fallback on the system python installation.

I see 2 possible way to fix this:
1) add the following line to libevdev.mk:
LIBEVDEV_CONF_ENV += ac_cv_path_PYTHON=$(HOST_DIR)/usr/bin/python2

2) or, if python3 is correctly supported by libevdev, then change the
host-python dependency to:
LIBEVDEV_DEPENDENCIES += $(if $(BR2_PACKAGE_PYHTON3),host-python3,host-python)

Tricky bug that, I think, we may see again :-/

>
> baruch
>

Thanks a lot for sharing your investigations.

Regards,

-- 
Samuel

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

* [Buildroot] [PATCH] python: fix host-python symlink installation when no python is selected
  2014-04-06 10:48   ` Samuel Martin
@ 2014-04-06 11:03     ` Thomas Petazzoni
  2014-04-06 11:35       ` Samuel Martin
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2014-04-06 11:03 UTC (permalink / raw)
  To: buildroot

Dear Samuel Martin,

On Sun, 6 Apr 2014 12:48:04 +0200, Samuel Martin wrote:

> So, there is no python symlink yet installed in the host dir.; that's
> why the configure script fallback on the system python installation.
> 
> I see 2 possible way to fix this:
> 1) add the following line to libevdev.mk:
> LIBEVDEV_CONF_ENV += ac_cv_path_PYTHON=$(HOST_DIR)/usr/bin/python2
> 
> 2) or, if python3 is correctly supported by libevdev, then change the
> host-python dependency to:
> LIBEVDEV_DEPENDENCIES += $(if $(BR2_PACKAGE_PYHTON3),host-python3,host-python)

Can you check if Python 3 is OK for libevdev? If it's the case, then we
could implement solution (2) that you're proposing here.

Thanks for the investigation!

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

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

* [Buildroot] [PATCH] python: fix host-python symlink installation when no python is selected
  2014-04-06 11:03     ` Thomas Petazzoni
@ 2014-04-06 11:35       ` Samuel Martin
  0 siblings, 0 replies; 6+ messages in thread
From: Samuel Martin @ 2014-04-06 11:35 UTC (permalink / raw)
  To: buildroot

On Sun, Apr 6, 2014 at 1:03 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Samuel Martin,
>
> On Sun, 6 Apr 2014 12:48:04 +0200, Samuel Martin wrote:
>
>> So, there is no python symlink yet installed in the host dir.; that's
>> why the configure script fallback on the system python installation.
>>
>> I see 2 possible way to fix this:
>> 1) add the following line to libevdev.mk:
>> LIBEVDEV_CONF_ENV += ac_cv_path_PYTHON=$(HOST_DIR)/usr/bin/python2
>>
>> 2) or, if python3 is correctly supported by libevdev, then change the
>> host-python dependency to:
>> LIBEVDEV_DEPENDENCIES += $(if $(BR2_PACKAGE_PYHTON3),host-python3,host-python)
>
> Can you check if Python 3 is OK for libevdev? If it's the case, then we
> could implement solution (2) that you're proposing here.

Sure. Just checked and it works!
Patch incoming ;)

>
> Thanks for the investigation!
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com



-- 
Samuel

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

end of thread, other threads:[~2014-04-06 11:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-06  7:35 [Buildroot] [PATCH] python: fix host-python symlink installation when no python is selected Samuel Martin
2014-04-06  8:30 ` Baruch Siach
2014-04-06 10:48   ` Samuel Martin
2014-04-06 11:03     ` Thomas Petazzoni
2014-04-06 11:35       ` Samuel Martin
2014-04-06  9:55 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox