package/python: apply unicode config to host build
PATCH 1/1 package/python: apply unicode config to host build
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 <[email protected]> for reporting this.
--- package/python/python.mk | 1 + 1 file changed, 1 insertion(+)
package/python/python.mk +1 -0
@@ -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
Signature · 1 line
2.9.3
Thomas Petazzoni
AppliedPATCH 1/1 package/python: apply unicode config to host build
Hello,
Quoted 18 lines · Chris Smart
Currently the host build of Python 2 defaults to narrow unicode (UCS2), ignoring the
BR2_PACKAGE_PYTHON_UCS4configuration 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/
Quoted 6 lines
Thanks to Tony Breeds <[email protected]> for reporting this.
Signed-off-by Chris Smart <[email protected]>--- 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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 package/python: apply unicode config to host build
Quoted 3 lines · Thomas Petazzoni
Applied to master, after adding a comment in the code itself to explain
why we're doing this.
Great, thanks Thomas!
Cheers,
-c