[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    Re: [OE-core] [PATCH] devtool: unset _PYTHON_SYSCONFIGDATA_NAME
From:       "Alexander Kanavin" <alex.kanavin () gmail ! com>
Date:       2020-08-31 20:06:02
Message-ID: CANNYZj9FTytpu2OWg9DKODX0UmAuucHh0tNuekaXrthxoS2Abg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I just ran this on opensuse tumbleweed which has 3.8.5 - no issues.

Alex

On Mon, 31 Aug 2020 at 21:55, gr embeter <grembeter@gmail.com> wrote:

> Hi
>
> > On Thu, Aug 27, 2020 at 4:59 PM Alexander Kanavin <
> alex.kanavin@gmail.com> wrote:
>
> > Note that we already had the same patch proposed earlier and it was
> rejected, as the problem
> > pops up in various different places and needs to be understood and
> solved properly.
>
> I did not find any patches for devtool. The patch for python3-native
> wrapper does not look "the same".
>
> Does anyone else experience the same issue with devtool?
>
> >
> > > Alex
> > >
> > > On Thu, 27 Aug 2020 at 15:11, gr embeter <grembeter@gmail.com> wrote:
> > >>
> > >> On Ubuntu 20.04.1 LTS with Python 3.8.2 "devtool modify" fails with
> > >> Exception: ModuleNotFoundError: No module named '_sysconfigdata'
> > >>
> > >> e.g.: devtool modify --no-same-dir --branch fit u-boot
> ~/ws/w/dtool/u-boot-fit
> > >>
> > >> ERROR: Error executing a python function in exec_python_func()
> autogenerated:
> > >>
> > >> The stack trace of python calls that resulted in this
> exception/failure was:
> > >> File: 'exec_python_func() autogenerated', lineno: 2, function:
> <module>
> > >>      0001:
> > >>  *** 0002:devtool_post_unpack(d)
> > >>      0003:
> > >>  [...]
> > >> File: '/usr/lib/python3.8/sysconfig.py', lineno: 421, function:
> _init_posix
> > >>      0417:def _init_posix(vars):
> > >>      0418:    """Initialize the module as appropriate for POSIX
> systems."""
> > >>      0419:    # _sysconfigdata is generated at build time, see
> _generate_posix_vars()
> > >>      0420:    name = _get_sysconfigdata_name()
> > >>  *** 0421:    _temp = __import__(name, globals(), locals(),
> ['build_time_vars'], 0)
> > >>      0422:    build_time_vars = _temp.build_time_vars
> > >>      0423:    vars.update(build_time_vars)
> > >>      0424:
> > >>      0425:def _init_non_posix(vars):
> > >> Exception: ModuleNotFoundError: No module named '_sysconfigdata'
> > >>
> > >> It happens because u-boot (and likely other recipes) eventually
> inherits
> > >> python3native.bbclass that sets
> _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
> > >> and this affects host Python.
> > >>
> > >> Hence, unset _PYTHON_SYSCONFIGDATA_NAME for devtool completely.
> > >>
> > >> Signed-off-by: Grygorii Tertychnyi <
> grygorii.tertychnyi@leica-geosystems.com>
> > >> ---
> > >>  meta/classes/devtool-source.bbclass | 2 ++
> > >>  1 file changed, 2 insertions(+)
> > >>
> > >> diff --git a/meta/classes/devtool-source.bbclass
> b/meta/classes/devtool-source.bbclass
> > >> index 280d6009f3c2..95d6fe7a29e8 100644
> > >> --- a/meta/classes/devtool-source.bbclass
> > >> +++ b/meta/classes/devtool-source.bbclass
> > >> @@ -22,6 +22,8 @@
> > >>  DEVTOOL_TEMPDIR ?= ""
> > >>  DEVTOOL_PATCH_SRCDIR = "${DEVTOOL_TEMPDIR}/patchworkdir"
> > >>
> > >> +# host Python fails to import correct _sysconfigdata if this
> variable is set
> > >> +_PYTHON_SYSCONFIGDATA_NAME[unexport] = "1"
> > >>
> > >>  python() {
> > >>      tempdir = d.getVar('DEVTOOL_TEMPDIR')
> > >> --
> > >> 2.25.1
>

[Attachment #5 (text/html)]

<div dir="ltr"><div>I just ran this on opensuse tumbleweed which has 3.8.5 - no \
issues.</div><div><br></div><div>Alex<br></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 31 Aug 2020 at 21:55, \
gr embeter &lt;<a href="mailto:grembeter@gmail.com">grembeter@gmail.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi<br> <br>
&gt; On Thu, Aug 27, 2020 at 4:59 PM Alexander Kanavin &lt;<a \
href="mailto:alex.kanavin@gmail.com" target="_blank">alex.kanavin@gmail.com</a>&gt; \
wrote:<br> <br>
&gt; Note that we already had the same patch proposed earlier and it was rejected, as \
the problem<br> &gt; pops up in various different places and needs to be understood \
and solved properly.<br> <br>
I did not find any patches for devtool. The patch for python3-native<br>
wrapper does not look &quot;the same&quot;.<br>
<br>
Does anyone else experience the same issue with devtool?<br>
<br>
&gt;<br>
&gt; &gt; Alex<br>
&gt; &gt;<br>
&gt; &gt; On Thu, 27 Aug 2020 at 15:11, gr embeter &lt;<a \
href="mailto:grembeter@gmail.com" target="_blank">grembeter@gmail.com</a>&gt; \
wrote:<br> &gt; &gt;&gt;<br>
&gt; &gt;&gt; On Ubuntu 20.04.1 LTS with Python 3.8.2 &quot;devtool modify&quot; \
fails with<br> &gt; &gt;&gt; Exception: ModuleNotFoundError: No module named \
&#39;_sysconfigdata&#39;<br> &gt; &gt;&gt;<br>
&gt; &gt;&gt; e.g.: devtool modify --no-same-dir --branch fit u-boot \
~/ws/w/dtool/u-boot-fit<br> &gt; &gt;&gt;<br>
&gt; &gt;&gt; ERROR: Error executing a python function in exec_python_func() \
autogenerated:<br> &gt; &gt;&gt;<br>
&gt; &gt;&gt; The stack trace of python calls that resulted in this exception/failure \
was:<br> &gt; &gt;&gt; File: &#39;exec_python_func() autogenerated&#39;, lineno: 2, \
function: &lt;module&gt;<br> &gt; &gt;&gt;         0001:<br>
&gt; &gt;&gt;   *** 0002:devtool_post_unpack(d)<br>
&gt; &gt;&gt;         0003:<br>
&gt; &gt;&gt;   [...]<br>
&gt; &gt;&gt; File: &#39;/usr/lib/python3.8/sysconfig.py&#39;, lineno: 421, function: \
_init_posix<br> &gt; &gt;&gt;         0417:def _init_posix(vars):<br>
&gt; &gt;&gt;         0418:      &quot;&quot;&quot;Initialize the module as \
appropriate for POSIX systems.&quot;&quot;&quot;<br> &gt; &gt;&gt;         0419:      \
# _sysconfigdata is generated at build time, see _generate_posix_vars()<br> &gt; \
&gt;&gt;         0420:      name = _get_sysconfigdata_name()<br> &gt; &gt;&gt;   *** \
0421:      _temp = __import__(name, globals(), locals(), [&#39;build_time_vars&#39;], \
0)<br> &gt; &gt;&gt;         0422:      build_time_vars = _temp.build_time_vars<br>
&gt; &gt;&gt;         0423:      vars.update(build_time_vars)<br>
&gt; &gt;&gt;         0424:<br>
&gt; &gt;&gt;         0425:def _init_non_posix(vars):<br>
&gt; &gt;&gt; Exception: ModuleNotFoundError: No module named \
&#39;_sysconfigdata&#39;<br> &gt; &gt;&gt;<br>
&gt; &gt;&gt; It happens because u-boot (and likely other recipes) eventually \
inherits<br> &gt; &gt;&gt; python3native.bbclass that sets \
_PYTHON_SYSCONFIGDATA_NAME=&quot;_sysconfigdata&quot;<br> &gt; &gt;&gt; and this \
affects host Python.<br> &gt; &gt;&gt;<br>
&gt; &gt;&gt; Hence, unset _PYTHON_SYSCONFIGDATA_NAME for devtool completely.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Signed-off-by: Grygorii Tertychnyi &lt;<a \
href="mailto:grygorii.tertychnyi@leica-geosystems.com" \
target="_blank">grygorii.tertychnyi@leica-geosystems.com</a>&gt;<br> &gt; &gt;&gt; \
---<br> &gt; &gt;&gt;   meta/classes/devtool-source.bbclass | 2 ++<br>
&gt; &gt;&gt;   1 file changed, 2 insertions(+)<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; diff --git a/meta/classes/devtool-source.bbclass \
b/meta/classes/devtool-source.bbclass<br> &gt; &gt;&gt; index \
280d6009f3c2..95d6fe7a29e8 100644<br> &gt; &gt;&gt; --- \
a/meta/classes/devtool-source.bbclass<br> &gt; &gt;&gt; +++ \
b/meta/classes/devtool-source.bbclass<br> &gt; &gt;&gt; @@ -22,6 +22,8 @@<br>
&gt; &gt;&gt;   DEVTOOL_TEMPDIR ?= &quot;&quot;<br>
&gt; &gt;&gt;   DEVTOOL_PATCH_SRCDIR = \
&quot;${DEVTOOL_TEMPDIR}/patchworkdir&quot;<br> &gt; &gt;&gt;<br>
&gt; &gt;&gt; +# host Python fails to import correct _sysconfigdata if this variable \
is set<br> &gt; &gt;&gt; +_PYTHON_SYSCONFIGDATA_NAME[unexport] = &quot;1&quot;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;   python() {<br>
&gt; &gt;&gt;         tempdir = d.getVar(&#39;DEVTOOL_TEMPDIR&#39;)<br>
&gt; &gt;&gt; --<br>
&gt; &gt;&gt; 2.25.1<br>
</blockquote></div>



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142035): https://lists.openembedded.org/g/openembedded-core/message/142035
Mute This Topic: https://lists.openembedded.org/mt/76450895/4454766
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  [openembedded-core@marc.info]
-=-=-=-=-=-=-=-=-=-=-=-


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic