summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias.schiffer@ew.tq-group.com>2019-05-22 11:13:10 +0200
committerArmin Kuster <akuster808@gmail.com>2019-06-18 08:30:38 -0700
commit9c05d9002dadbf8171211a2488c617cb067cae75 (patch)
tree8051935c172def40adea2d0c64833c047e96618e
parent5048f5b7c761cf295870216404b4b57ff89520e6 (diff)
downloadbitbake-contrib-stable/1.42-next.tar.gz
bitbake-contrib-stable/1.42-next.tar.bz2
bitbake-contrib-stable/1.42-next.zip
fetch2: runfetchcmd(): unset _PYTHON_SYSCONFIGDATA_NAMEstable/1.42-next
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> main() 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 _init_posix(_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 BB_GIT_SHALLOW and BB_GENERATE_SHALLOW_TARBALLS. Unset _PYTHON_SYSCONFIGDATA_NAME in runfetchcmd() to work around this. Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--lib/bb/fetch2/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 164c1a0ad4..84327c2f8f 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -845,6 +845,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