diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2016-09-17 03:18:08 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-20 15:11:08 +0100 |
commit | dbb76e297bf2a2301028c56f76832d1cd11b7efa (patch) | |
tree | 4e791137241c78bf6f6c852f26056fb884665265 | |
parent | 91347edaec0363d935ec9b0644e1c835ef589252 (diff) | |
download | poky-dbb76e297bf2a2301028c56f76832d1cd11b7efa.tar.gz |
externalsrc.bbclass: Make reparsing work for BBCLASSEXTENDed recipes
To make sure changes to any source files are detected when externalsrc
is used, it sets BB_DONT_CACHE to force the recipe to be reparsed
every time. Previously, this was done conditionally based on whether
EXTERNALSRC was set. This worked fine for building the base recipe.
But if one tried to build, e.g., a native version of it (provided via
BBCLASSEXTEND), the recipe would not be reparsed as expected.
To solve the above problem, BB_DONT_CACHE is now set for the base
recipe if EXTERNALSRC is set for it or any of it derivatives.
(From OE-Core rev: 449a0b21255d895e8620383ce76a9d7ea41b5cc6)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/externalsrc.bbclass | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass index b7140a321d..5c65d2b742 100644 --- a/meta/classes/externalsrc.bbclass +++ b/meta/classes/externalsrc.bbclass | |||
@@ -29,6 +29,23 @@ EXTERNALSRC_SYMLINKS ?= "oe-workdir:${WORKDIR} oe-logs:${T}" | |||
29 | 29 | ||
30 | python () { | 30 | python () { |
31 | externalsrc = d.getVar('EXTERNALSRC', True) | 31 | externalsrc = d.getVar('EXTERNALSRC', True) |
32 | |||
33 | # If this is the base recipe and EXTERNALSRC is set for it or any of its | ||
34 | # derivatives, then enable BB_DONT_CACHE to force the recipe to always be | ||
35 | # re-parsed so that the file-checksums function for do_compile is run every | ||
36 | # time. | ||
37 | bpn = d.getVar('BPN', True) | ||
38 | if bpn == d.getVar('PN', True): | ||
39 | classextend = (d.getVar('BBCLASSEXTEND', True) or '').split() | ||
40 | if (externalsrc or | ||
41 | ('native' in classextend and | ||
42 | d.getVar('EXTERNALSRC_pn-%s-native' % bpn, True)) or | ||
43 | ('nativesdk' in classextend and | ||
44 | d.getVar('EXTERNALSRC_pn-nativesdk-%s' % bpn, True)) or | ||
45 | ('cross' in classextend and | ||
46 | d.getVar('EXTERNALSRC_pn-%s-cross' % bpn, True))): | ||
47 | d.setVar('BB_DONT_CACHE', '1') | ||
48 | |||
32 | if externalsrc: | 49 | if externalsrc: |
33 | d.setVar('S', externalsrc) | 50 | d.setVar('S', externalsrc) |
34 | externalsrcbuild = d.getVar('EXTERNALSRC_BUILD', True) | 51 | externalsrcbuild = d.getVar('EXTERNALSRC_BUILD', True) |
@@ -85,9 +102,6 @@ python () { | |||
85 | d.prependVarFlag('do_compile', 'prefuncs', "externalsrc_compile_prefunc ") | 102 | d.prependVarFlag('do_compile', 'prefuncs', "externalsrc_compile_prefunc ") |
86 | d.prependVarFlag('do_configure', 'prefuncs', "externalsrc_configure_prefunc ") | 103 | d.prependVarFlag('do_configure', 'prefuncs', "externalsrc_configure_prefunc ") |
87 | 104 | ||
88 | # Force the recipe to be always re-parsed so that the file_checksums | ||
89 | # function is run every time | ||
90 | d.setVar('BB_DONT_CACHE', '1') | ||
91 | d.setVarFlag('do_compile', 'file-checksums', '${@srctree_hash_files(d)}') | 105 | d.setVarFlag('do_compile', 'file-checksums', '${@srctree_hash_files(d)}') |
92 | 106 | ||
93 | # We don't want the workdir to go away | 107 | # We don't want the workdir to go away |