diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2019-02-14 14:37:19 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-15 08:17:49 +0000 |
commit | 407a02b0579405abaff5a1f9d5f190c197aaff52 (patch) | |
tree | af920c85c4150d4ee4ced48c523be510120b34cd | |
parent | 1d1dc29618dd1c5f3cc93101b77c3323a80a0c97 (diff) | |
download | poky-407a02b0579405abaff5a1f9d5f190c197aaff52.tar.gz |
base.bbclass: Check BuildStarted for HOSTTOOLS
There might be no bb.event.ConfigParsed event if bitbake server is running, so
check bb.event.BuildStarted too to make sure HOSTTOOLS_DIR exists.
Fixed:
$ export BB_SERVER_TIMEOUT=-1
$ bitbake quilt-native
$ rm -fr tmp
$ bitbake quilt-native
ERROR: Error running gcc --version: /bin/sh: gcc: command not found
This error is caused by enable_uninative(), it runs twice (ConfigParsed and
BuildStarted), the error would happen when there is no ConfigParsed event
(no hosttools is created), but BuildStarted. This patch can fix the problem.
[YOCTO #13022]
(From OE-Core rev: da798db0a48282e3d4f58890a7aec42c3deff0b8)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/base.bbclass | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index f1a3c0e53e..8ece51fe42 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -228,6 +228,12 @@ python base_eventhandler() { | |||
228 | if not d.getVar("NATIVELSBSTRING", False): | 228 | if not d.getVar("NATIVELSBSTRING", False): |
229 | d.setVar("NATIVELSBSTRING", lsb_distro_identifier(d)) | 229 | d.setVar("NATIVELSBSTRING", lsb_distro_identifier(d)) |
230 | d.setVar('BB_VERSION', bb.__version__) | 230 | d.setVar('BB_VERSION', bb.__version__) |
231 | |||
232 | # There might be no bb.event.ConfigParsed event if bitbake server is | ||
233 | # running, so check bb.event.BuildStarted too to make sure ${HOSTTOOLS_DIR} | ||
234 | # exists. | ||
235 | if isinstance(e, bb.event.ConfigParsed) or \ | ||
236 | (isinstance(e, bb.event.BuildStarted) and not os.path.exists(d.getVar('HOSTTOOLS_DIR'))): | ||
231 | # Works with the line in layer.conf which changes PATH to point here | 237 | # Works with the line in layer.conf which changes PATH to point here |
232 | setup_hosttools_dir(d.getVar('HOSTTOOLS_DIR'), 'HOSTTOOLS', d) | 238 | setup_hosttools_dir(d.getVar('HOSTTOOLS_DIR'), 'HOSTTOOLS', d) |
233 | setup_hosttools_dir(d.getVar('HOSTTOOLS_DIR'), 'HOSTTOOLS_NONFATAL', d, fatal=False) | 239 | setup_hosttools_dir(d.getVar('HOSTTOOLS_DIR'), 'HOSTTOOLS_NONFATAL', d, fatal=False) |