Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/python: apply unicode config to host build
@ 2017-02-22  3:14 Chris Smart
  2017-02-23 22:13 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Smart @ 2017-02-22  3:14 UTC (permalink / raw)
  To: buildroot

Currently the host build of Python 2 defaults to narrow unicode (UCS2),
ignoring the BR2_PACKAGE_PYTHON_UCS4 configuration option which may be
set to wide (UCS4).

This results in host and target Python packages which are incompatible
in subtle ways.

For example, installing wheels into the target fails when they are made
with the host python, citing incompatibility (as can be seen by the
package tags which may be "cp27u-manylinux1" instead of
"cp27mu-manylinux1").

Compiling the host Python 2 with the same UCS configuration as the
target ensures that the packages are compatible (and the tags match).

This does not affect Python 3 as support for narrow unicode was
deprecated in version 3.3, see https://www.python.org/dev/peps/pep-0393/

Thanks to Tony Breeds <tony@bakeyournoodle.com> for reporting this.

Signed-off-by: Chris Smart <mail@csmart.io>
---
 package/python/python.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/python/python.mk b/package/python/python.mk
index 7b20434c94c2b8b8..330716d57f3712f1 100644
--- a/package/python/python.mk
+++ b/package/python/python.mk
@@ -105,6 +105,7 @@ endif
 
 # Default is UCS2 w/o a conf opt
 ifeq ($(BR2_PACKAGE_PYTHON_UCS4),y)
+HOST_PYTHON_CONF_OPTS += --enable-unicode=ucs4
 PYTHON_CONF_OPTS += --enable-unicode=ucs4
 endif
 
-- 
2.9.3

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

* [Buildroot] [PATCH] package/python: apply unicode config to host build
  2017-02-22  3:14 [Buildroot] [PATCH] package/python: apply unicode config to host build Chris Smart
@ 2017-02-23 22:13 ` Thomas Petazzoni
  2017-02-23 23:33   ` Chris Smart
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2017-02-23 22:13 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 22 Feb 2017 14:14:23 +1100, Chris Smart wrote:
> Currently the host build of Python 2 defaults to narrow unicode (UCS2),
> ignoring the BR2_PACKAGE_PYTHON_UCS4 configuration option which may be
> set to wide (UCS4).
> 
> This results in host and target Python packages which are incompatible
> in subtle ways.
> 
> For example, installing wheels into the target fails when they are made
> with the host python, citing incompatibility (as can be seen by the
> package tags which may be "cp27u-manylinux1" instead of
> "cp27mu-manylinux1").
> 
> Compiling the host Python 2 with the same UCS configuration as the
> target ensures that the packages are compatible (and the tags match).
> 
> This does not affect Python 3 as support for narrow unicode was
> deprecated in version 3.3, see https://www.python.org/dev/peps/pep-0393/
> 
> Thanks to Tony Breeds <tony@bakeyournoodle.com> for reporting this.
> 
> Signed-off-by: Chris Smart <mail@csmart.io>
> ---
>  package/python/python.mk | 1 +
>  1 file changed, 1 insertion(+)

Applied to master, after adding a comment in the code itself to explain
why we're doing this.

Thanks!

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

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

* [Buildroot] [PATCH] package/python: apply unicode config to host build
  2017-02-23 22:13 ` Thomas Petazzoni
@ 2017-02-23 23:33   ` Chris Smart
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Smart @ 2017-02-23 23:33 UTC (permalink / raw)
  To: buildroot

On Thu, Feb 23, 2017 at 11:13:37PM +0100, Thomas Petazzoni wrote:
>Applied to master, after adding a comment in the code itself 
>to explain
>why we're doing this.

Great, thanks Thomas!

Cheers,
-c

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

end of thread, other threads:[~2017-02-23 23:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-22  3:14 [Buildroot] [PATCH] package/python: apply unicode config to host build Chris Smart
2017-02-23 22:13 ` Thomas Petazzoni
2017-02-23 23:33   ` Chris Smart

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