<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 12, 2017 at 1:15 AM, Li Zhou <span dir="ltr"><<a href="mailto:li.zhou@windriver.com" target="_blank">li.zhou@windriver.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Porting patch from<br>
<<a href="https://github.com/python/cpython/commit/409482251b06fe75c4ee56e85ffbb4b23d934159" rel="noreferrer" target="_blank">https://github.com/python/<wbr>cpython/commit/<wbr>409482251b06fe75c4ee56e85ffbb4<wbr>b23d934159</a>><br>
to use _sysconfigdata.py to initialize distutils.sysconfig.<br></blockquote><div><br><br></div><div>But what does this actually do ? I'm sure it is obvious to the python hackers, but to me, <br></div><div>this short log just describes what the patch does, not what problem it solves and why this<br></div><div>is a good thing.<br><br></div><div>Bruce<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Signed-off-by: Li Zhou <<a href="mailto:li.zhou@windriver.com">li.zhou@windriver.com</a>><br>
---<br>
...-Use-_sysconfigdata.py-to-<wbr>initialize-dist.patch | 66 ++++++++++++++++++++++<br>
meta/recipes-devtools/python/<a href="http://python3_3.5.2.bb" rel="noreferrer" target="_blank">p<wbr>ython3_3.5.2.bb</a> | 1 +<br>
2 files changed, 67 insertions(+)<br>
create mode 100644 meta/recipes-devtools/python/<wbr>python3/0001-Issue-21272-Use-_<wbr>sysconfigdata.py-to-<wbr>initialize-dist.patch<br>
<br>
diff --git a/meta/recipes-devtools/<wbr>python/python3/0001-Issue-<wbr>21272-Use-_sysconfigdata.py-<wbr>to-initialize-dist.patch b/meta/recipes-devtools/<wbr>python/python3/0001-Issue-<wbr>21272-Use-_sysconfigdata.py-<wbr>to-initialize-dist.patch<br>
new file mode 100644<br>
index 0000000..d1c92e9<br>
--- /dev/null<br>
+++ b/meta/recipes-devtools/<wbr>python/python3/0001-Issue-<wbr>21272-Use-_sysconfigdata.py-<wbr>to-initialize-dist.patch<br>
@@ -0,0 +1,66 @@<br>
+From bcddbf40c7f1b80336268cdddacc17<wbr>369fb0ccea Mon Sep 17 00:00:00 2001<br>
+From: Libin Dang <<a href="mailto:libin.dang@windriver.com">libin.dang@windriver.com</a>><br>
+Date: Tue, 11 Apr 2017 14:12:15 +0800<br>
+Subject: [PATCH] Issue #21272: Use _sysconfigdata.py to initialize<br>
+ distutils.sysconfig<br>
+<br>
+Backport upstream commit<br>
+<a href="https://github.com/python/cpython/commit/409482251b06fe75c4ee56e85ffbb4b23d934159" rel="noreferrer" target="_blank">https://github.com/python/<wbr>cpython/commit/<wbr>409482251b06fe75c4ee56e85ffbb4<wbr>b23d934159</a><br>
+<br>
+Upstream-Status: Backport<br>
+<br>
+Signed-off-by: Li Zhou <<a href="mailto:li.zhou@windriver.com">li.zhou@windriver.com</a>><br>
+---<br>
+ Lib/distutils/sysconfig.py | 35 ++++--------------------------<wbr>-----<br>
+ 1 file changed, 4 insertions(+), 31 deletions(-)<br>
+<br>
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py<br>
+index 6d5cfd0..9925d24 100644<br>
+--- a/Lib/distutils/sysconfig.py<br>
++++ b/Lib/distutils/sysconfig.py<br>
+@@ -424,38 +424,11 @@ _config_vars = None<br>
+<br>
+ def _init_posix():<br>
+ """Initialize the module as appropriate for POSIX systems."""<br>
+- g = {}<br>
+- # load the installed Makefile:<br>
+- try:<br>
+- filename = get_makefile_filename()<br>
+- parse_makefile(filename, g)<br>
+- except OSError as msg:<br>
+- my_msg = "invalid Python installation: unable to open %s" % filename<br>
+- if hasattr(msg, "strerror"):<br>
+- my_msg = my_msg + " (%s)" % msg.strerror<br>
+-<br>
+- raise DistutilsPlatformError(my_msg)<br>
+-<br>
+- # load the installed pyconfig.h:<br>
+- try:<br>
+- filename = get_config_h_filename()<br>
+- with open(filename) as file:<br>
+- parse_config_h(file, g)<br>
+- except OSError as msg:<br>
+- my_msg = "invalid Python installation: unable to open %s" % filename<br>
+- if hasattr(msg, "strerror"):<br>
+- my_msg = my_msg + " (%s)" % msg.strerror<br>
+-<br>
+- raise DistutilsPlatformError(my_msg)<br>
+-<br>
+- # On AIX, there are wrong paths to the linker scripts in the Makefile<br>
+- # -- these paths are relative to the Python source, but when installed<br>
+- # the scripts are in another directory.<br>
+- if python_build:<br>
+- g['LDSHARED'] = g['BLDSHARED']<br>
+-<br>
++ # _sysconfigdata is generated at build time, see the sysconfig module<br>
++ from _sysconfigdata import build_time_vars<br>
+ global _config_vars<br>
+- _config_vars = g<br>
++ _config_vars = {}<br>
++ _config_vars.update(build_<wbr>time_vars)<br>
+<br>
+<br>
+ def _init_nt():<br>
+--<br>
+1.8.3.1<br>
+<br>
diff --git a/meta/recipes-devtools/<wbr>python/<a href="http://python3_3.5.2.bb" rel="noreferrer" target="_blank">python3_3.5.2.bb</a> b/meta/recipes-devtools/<wbr>python/<a href="http://python3_3.5.2.bb" rel="noreferrer" target="_blank">python3_3.5.2.bb</a><br>
index ca8dfe3..a413da7 100644<br>
--- a/meta/recipes-devtools/<wbr>python/<a href="http://python3_3.5.2.bb" rel="noreferrer" target="_blank">python3_3.5.2.bb</a><br>
+++ b/meta/recipes-devtools/<wbr>python/<a href="http://python3_3.5.2.bb" rel="noreferrer" target="_blank">python3_3.5.2.bb</a><br>
@@ -37,6 +37,7 @@ SRC_URI += "\<br>
file://configure.ac-fix-LIBPL.<wbr>patch \<br>
file://python3-fix-CVE-2016-<wbr>1000110.patch \<br>
file://upstream-random-fixes.<wbr>patch \<br>
+ file://0001-Issue-21272-Use-_<wbr>sysconfigdata.py-to-<wbr>initialize-dist.patch \<br>
"<br>
SRC_URI[md5sum] = "<wbr>8906efbacfcdc7c3c9198aeefafd15<wbr>9e"<br>
SRC_URI[sha256sum] = "<wbr>0010f56100b9b74259ebcd5d4b295a<wbr>32324b58b517403a10d1a2aa7cb22b<wbr>ca40"<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
--<br>
______________________________<wbr>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"</div>
</div></div>