Hi Alex

On Thu, Aug 27, 2020 at 4:59 PM Alexander Kanavin <[email protected]>
wrote:
>
> I am able to execute that exact same command without any errors. How can
this be reproduced?

Did you run it on Ubuntu 20.04 with Python 3.8?

 » python3 --version
Python 3.8.2

 » apt-cache policy python3.8
python3.8:
  Installed: 3.8.2-1ubuntu1.2
  Candidate: 3.8.2-1ubuntu1.2
  Version table:
 *** 3.8.2-1ubuntu1.2 500
        500 http://ch.archive.ubuntu.com/ubuntu focal-updates/main amd64
Packages
        500 http://security.ubuntu.com/ubuntu focal-security/main amd64
Packages
        100 /var/lib/dpkg/status
     3.8.2-1ubuntu1 500
        500 http://ch.archive.ubuntu.com/ubuntu focal/main amd64 Packages

Apparently one of ubuntu1.2 patches touches Lib/sysconfig.py:

 » cat ./debian/patches/sysconfigdata-name.diff
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -345,9 +345,8 @@ def get_makefile_filename():

 def _get_sysconfigdata_name():
     return os.environ.get('_PYTHON_SYSCONFIGDATA_NAME',
-        '_sysconfigdata_{abi}_{platform}_{multiarch}'.format(
+        '_sysconfigdata_{abi}_{multiarch}'.format(
         abi=sys.abiflags,
-        platform=sys.platform,
         multiarch=getattr(sys.implementation, '_multiarch', ''),
     ))

> 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.

Haven't seen patches for devtool, thanks for the info.

> Alex
>
> On Thu, 27 Aug 2020 at 15:11, gr embeter <[email protected]> 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 <
[email protected]>
>> ---
>>  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
>>
>> 
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#141909): 
https://lists.openembedded.org/g/openembedded-core/message/141909
Mute This Topic: https://lists.openembedded.org/mt/76450895/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to