All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] python3: correct the multilib support patch
@ 2016-06-29  3:12 Li Zhou
  2016-06-29  6:33 ` Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Li Zhou @ 2016-06-29  3:12 UTC (permalink / raw)
  To: openembedded-core

When python3 rebased its multilib patch, the hard coded "lib" path
isn't really changed because of the rebasing's error, and cause
phthon3's failure when running on 64bit platforms as below:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

Here correct the rebasing error and solve this issue.

Signed-off-by: Li Zhou <li.zhou@windriver.com>
---
 ...ython3-correct-the-multilib-support-patch.patch | 47 ++++++++++++++++++++++
 meta/recipes-devtools/python/python3_3.5.1.bb      |  1 +
 2 files changed, 48 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3/0001-python3-correct-the-multilib-support-patch.patch

diff --git a/meta/recipes-devtools/python/python3/0001-python3-correct-the-multilib-support-patch.patch b/meta/recipes-devtools/python/python3/0001-python3-correct-the-multilib-support-patch.patch
new file mode 100644
index 0000000..0443fb4
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/0001-python3-correct-the-multilib-support-patch.patch
@@ -0,0 +1,47 @@
+From ea237efcfa72012f044c7b3091c9c9b038141df8 Mon Sep 17 00:00:00 2001
+From: Li Zhou <li.zhou@windriver.com>
+Date: Wed, 29 Jun 2016 10:45:01 +0800
+Subject: [PATCH] python3: correct the multilib support patch
+
+When python3 rebased its multilib patch, the hard coded "lib" path
+isn't really changed because of the rebasing's error, and cause
+phthon3's failure when running on 64bit platforms as below:
+Could not find platform independent libraries <prefix>
+Could not find platform dependent libraries <exec_prefix>
+Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
+Fatal Python error: Py_Initialize: Unable to get the locale encoding
+ImportError: No module named 'encodings'
+
+Here correct the rebasing error and solve this issue.
+
+Upstream-Status: Pending
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ Modules/getpath.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/Modules/getpath.c b/Modules/getpath.c
+index 034d91a..5deb33d 100644
+--- a/Modules/getpath.c
++++ b/Modules/getpath.c
+@@ -132,7 +132,6 @@ static wchar_t prefix[MAXPATHLEN+1];
+ static wchar_t exec_prefix[MAXPATHLEN+1];
+ static wchar_t progpath[MAXPATHLEN+1];
+ static wchar_t *module_search_path = NULL;
+-static wchar_t *lib_python = L"" LIB_PYTHON;
+ 
+ /* Get file status. Encode the path to the locale encoding. */
+ 
+@@ -514,7 +513,7 @@ calculate_path(void)
+     _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL);
+     _prefix = Py_DecodeLocale(PREFIX, NULL);
+     _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL);
+-    lib_python = Py_DecodeLocale("lib/python" VERSION, NULL);
++    lib_python = Py_DecodeLocale(LIB_PYTHON, NULL);
+ 
+     if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
+         Py_FatalError(
+-- 
+2.9.0
+
diff --git a/meta/recipes-devtools/python/python3_3.5.1.bb b/meta/recipes-devtools/python/python3_3.5.1.bb
index 2fbb3cb..1e6626f 100644
--- a/meta/recipes-devtools/python/python3_3.5.1.bb
+++ b/meta/recipes-devtools/python/python3_3.5.1.bb
@@ -38,6 +38,7 @@ SRC_URI += "\
             file://setup.py-find-libraries-in-staging-dirs.patch \
             file://use_packed_importlib.patch \
             file://configure.ac-fix-LIBPL.patch \
+            file://0001-python3-correct-the-multilib-support-patch.patch \
            "
 SRC_URI[md5sum] = "e9ea6f2623fffcdd871b7b19113fde80"
 SRC_URI[sha256sum] = "c6d57c0c366d9060ab6c0cdf889ebf3d92711d466cc0119c441dbf2746f725c9"
-- 
2.9.0



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

* Re: [PATCH] python3: correct the multilib support patch
  2016-06-29  3:12 [PATCH] python3: correct the multilib support patch Li Zhou
@ 2016-06-29  6:33 ` Richard Purdie
  2016-06-29 15:44   ` Randle, William C
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2016-06-29  6:33 UTC (permalink / raw)
  To: Li Zhou, openembedded-core

On Wed, 2016-06-29 at 11:12 +0800, Li Zhou wrote:
> When python3 rebased its multilib patch, the hard coded "lib" path
> isn't really changed because of the rebasing's error, and cause
> phthon3's failure when running on 64bit platforms as below:
> Could not find platform independent libraries <prefix>
> Could not find platform dependent libraries <exec_prefix>
> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
> Fatal Python error: Py_Initialize: Unable to get the locale encoding
> ImportError: No module named 'encodings'
> 
> Here correct the rebasing error and solve this issue.
> 
> Signed-off-by: Li Zhou <li.zhou@windriver.com>
> ---
>  ...ython3-correct-the-multilib-support-patch.patch | 47
> ++++++++++++++++++++++
>  meta/recipes-devtools/python/python3_3.5.1.bb      |  1 +
>  2 files changed, 48 insertions(+)
>  create mode 100644 meta/recipes-devtools/python/python3/0001-python3
> -correct-the-multilib-support-patch.patch


Don't we want to correct the "bad" patch rather than adding an
additional patch? Or did I misunderstand the problem?

Also, are there some automated tests we should be adding to catch this
kind of problem? I'm a little worried none of our testing caught this.

Cheers,

Richard


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

* Re: [PATCH] python3: correct the multilib support patch
  2016-06-29  6:33 ` Richard Purdie
@ 2016-06-29 15:44   ` Randle, William C
  2016-06-29 22:47     ` Dan McGregor
  0 siblings, 1 reply; 4+ messages in thread
From: Randle, William C @ 2016-06-29 15:44 UTC (permalink / raw)
  To: richard.purdie, Zhou, Li (Wind River), openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1820 bytes --]

On Wed, 2016-06-29 at 07:33 +0100, Richard Purdie wrote:

On Wed, 2016-06-29 at 11:12 +0800, Li Zhou wrote:


When python3 rebased its multilib patch, the hard coded "lib" path
isn't really changed because of the rebasing's error, and cause
phthon3's failure when running on 64bit platforms as below:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

Here correct the rebasing error and solve this issue.

Signed-off-by: Li Zhou <li.zhou@windriver.com<mailto:li.zhou@windriver.com>>
---
 ...ython3-correct-the-multilib-support-patch.patch | 47
++++++++++++++++++++++
 meta/recipes-devtools/python/python3_3.5.1.bb      |  1 +
 2 files changed, 48 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3/0001-python3
-correct-the-multilib-support-patch.patch




Don't we want to correct the "bad" patch rather than adding an
additional patch? Or did I misunderstand the problem?

Also, are there some automated tests we should be adding to catch this
kind of problem? I'm a little worried none of our testing caught this.

Cheers,

Richard


I would agree that since the original patch has not been accepted upstream,  it would make the most sense to just regenerate it.

In addition, there are a couple of other places in getpath.c that have a hard coded "lib/". Have you verified those are correct as is? (I.e., ~line 706 'L:lib/pyhton00.zip"' and ~line 718 'L"lib/lib-dynload"'. Seems like the second case should use code similar other palces lib-dynload is used in the file that uses lib_python to build the path.)

    -Bill

[-- Attachment #2: Type: text/html, Size: 2391 bytes --]

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

* Re: [PATCH] python3: correct the multilib support patch
  2016-06-29 15:44   ` Randle, William C
@ 2016-06-29 22:47     ` Dan McGregor
  0 siblings, 0 replies; 4+ messages in thread
From: Dan McGregor @ 2016-06-29 22:47 UTC (permalink / raw)
  To: Bill Randle; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 2286 bytes --]

On 29 Jun 2016 9:44 a.m., "Randle, William C" <william.c.randle@intel.com>
wrote:
>
> On Wed, 2016-06-29 at 07:33 +0100, Richard Purdie wrote:
>>
>> On Wed, 2016-06-29 at 11:12 +0800, Li Zhou wrote:
>>>
>>> When python3 rebased its multilib patch, the hard coded "lib" path
>>> isn't really changed because of the rebasing's error, and cause
>>> phthon3's failure when running on 64bit platforms as below:
>>> Could not find platform independent libraries <prefix>
>>> Could not find platform dependent libraries <exec_prefix>
>>> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
>>> Fatal Python error: Py_Initialize: Unable to get the locale encoding
>>> ImportError: No module named 'encodings'
>>>
>>> Here correct the rebasing error and solve this issue.
>>>
>>> Signed-off-by: Li Zhou <li.zhou@windriver.com>
>>> ---
>>>  ...ython3-correct-the-multilib-support-patch.patch | 47
>>> ++++++++++++++++++++++
>>>  meta/recipes-devtools/python/python3_3.5.1.bb      |  1 +
>>>  2 files changed, 48 insertions(+)
>>>  create mode 100644 meta/recipes-devtools/python/python3/0001-python3
>>> -correct-the-multilib-support-patch.patch
>>
>>
>>
>> Don't we want to correct the "bad" patch rather than adding an
>> additional patch? Or did I misunderstand the problem?
>>
>> Also, are there some automated tests we should be adding to catch this
>> kind of problem? I'm a little worried none of our testing caught this.
>>
>> Cheers,
>>
>> Richard
>
>
> I would agree that since the original patch has not been accepted
upstream,  it would make the most sense to just regenerate it.
>
> In addition, there are a couple of other places in getpath.c that have a
hard coded "lib/". Have you verified those are correct as is? (I.e., ~line
706 'L:lib/pyhton00.zip"' and ~line 718 'L"lib/lib-dynload"'. Seems like
the second case should use code similar other palces lib-dynload is used in
the file that uses lib_python to build the path.)
>
>     -Bill

Fedora and others have similar patches. Have people checked them out?

>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 3259 bytes --]

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

end of thread, other threads:[~2016-06-29 22:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-29  3:12 [PATCH] python3: correct the multilib support patch Li Zhou
2016-06-29  6:33 ` Richard Purdie
2016-06-29 15:44   ` Randle, William C
2016-06-29 22:47     ` Dan McGregor

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.