[oe-commits] [bitbake] branch 1.42 updated: fetch2: runfetchcmd(): unset _PYTHON_SYSCONFIGDATA_NAME

git at git.openembedded.org git at git.openembedded.org
Tue Jun 18 16:01:04 UTC 2019

This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch 1.42
in repository bitbake.

The following commit(s) were added to refs/heads/1.42 by this push:
     new 6783104  fetch2: runfetchcmd(): unset _PYTHON_SYSCONFIGDATA_NAME
6783104 is described below

commit 6783104f18a8a14ddd88932720cd80dffeada63d
Author: Matthias Schiffer <matthias.schiffer at ew.tq-group.com>
AuthorDate: Wed May 22 11:13:10 2019 +0200

    fetch2: runfetchcmd(): unset _PYTHON_SYSCONFIGDATA_NAME
    Since warrior, python3native.bbclass sets _PYTHON_SYSCONFIGDATA_NAME;
    unfortunately, this also affects Python scripts run as fetch commands like
    git-make-shallow, breaking it with a message like
        Failed to import the site module
        Traceback (most recent call last):
          File "/usr/lib/python3.6/site.py", line 570, in <module>
          File "/usr/lib/python3.6/site.py", line 556, in main
            known_paths = addusersitepackages(known_paths)
          File "/usr/lib/python3.6/site.py", line 288, in addusersitepackages
            user_site = getusersitepackages()
          File "/usr/lib/python3.6/site.py", line 264, in getusersitepackages
            user_base = getuserbase() # this will also set USER_BASE
          File "/usr/lib/python3.6/site.py", line 254, in getuserbase
            USER_BASE = get_config_var('userbase')
          File "/usr/lib/python3.6/sysconfig.py", line 607, in get_config_var
            return get_config_vars().get(name)
          File "/usr/lib/python3.6/sysconfig.py", line 550, in get_config_vars
          File "/usr/lib/python3.6/sysconfig.py", line 421, in _init_posix
            _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
        ModuleNotFoundError: No module named '_sysconfigdata'
    on an Ubuntu 18.04 system (and likely others) when building with
    Unset _PYTHON_SYSCONFIGDATA_NAME in runfetchcmd() to work around this.
    Signed-off-by: Matthias Schiffer <matthias.schiffer at ew.tq-group.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
 lib/bb/fetch2/__init__.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 8fecc80..7f5d085 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -856,6 +856,11 @@ def runfetchcmd(cmd, d, quiet=False, cleanup=None, log=None, workdir=None):
         if val:
             cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd)
+    # Ensure that a _PYTHON_SYSCONFIGDATA_NAME value set by a recipe
+    # (for example via python3native.bbclass since warrior) is not set for
+    # host Python (otherwise tools like git-make-shallow will fail)
+    cmd = 'unset _PYTHON_SYSCONFIGDATA_NAME; ' + cmd
     # Disable pseudo as it may affect ssh, potentially causing it to hang.
     cmd = 'export PSEUDO_DISABLED=1; ' + cmd

To stop receiving notification emails like this one, please contact
the administrator of this repository.

More information about the Openembedded-commits mailing list