diff options
-rw-r--r-- | meta/classes/native.bbclass | 31 | ||||
-rw-r--r-- | meta/lib/oe/sstatesig.py | 10 |
2 files changed, 38 insertions, 3 deletions
diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass index 76a599bc15..fc7422c5d7 100644 --- a/meta/classes/native.bbclass +++ b/meta/classes/native.bbclass | |||
@@ -195,3 +195,34 @@ USE_NLS = "no" | |||
195 | 195 | ||
196 | RECIPERDEPTASK = "do_populate_sysroot" | 196 | RECIPERDEPTASK = "do_populate_sysroot" |
197 | do_populate_sysroot[rdeptask] = "${RECIPERDEPTASK}" | 197 | do_populate_sysroot[rdeptask] = "${RECIPERDEPTASK}" |
198 | |||
199 | # | ||
200 | # Native task outputs are directly run on the target (host) system after being | ||
201 | # built. Even if the output of this recipe doesn't change, a change in one of | ||
202 | # its dependencies may cause a change in the output it generates (e.g. rpm | ||
203 | # output depends on the output of its dependent zstd library). | ||
204 | # | ||
205 | # This can cause poor interactions with hash equivalence, since this recipes | ||
206 | # output-changing dependency is "hidden" and downstream task only see that this | ||
207 | # recipe has the same outhash and therefore is equivalent. This can result in | ||
208 | # different output in different cases. | ||
209 | # | ||
210 | # To resolve this, unhide the output-changing dependency by adding its unihash | ||
211 | # to this tasks outhash calculation. Unfortunately, don't know specifically | ||
212 | # know which dependencies are output-changing, so we have to add all of them. | ||
213 | # | ||
214 | python native_add_do_populate_sysroot_deps () { | ||
215 | current_task = "do_" + d.getVar("BB_CURRENTTASK") | ||
216 | if current_task != "do_populate_sysroot": | ||
217 | return | ||
218 | |||
219 | taskdepdata = d.getVar("BB_TASKDEPDATA", False) | ||
220 | pn = d.getVar("PN") | ||
221 | deps = { | ||
222 | dep[0]:dep[6] for dep in taskdepdata.values() if | ||
223 | dep[1] == current_task and dep[0] != pn | ||
224 | } | ||
225 | |||
226 | d.setVar("HASHEQUIV_EXTRA_SIGDATA", "\n".join("%s: %s" % (k, deps[k]) for k in sorted(deps.keys()))) | ||
227 | } | ||
228 | SSTATECREATEFUNCS += "native_add_do_populate_sysroot_deps" | ||
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py index 038404e377..abcd96231e 100644 --- a/meta/lib/oe/sstatesig.py +++ b/meta/lib/oe/sstatesig.py | |||
@@ -491,7 +491,8 @@ def OEOuthashBasic(path, sigfile, task, d): | |||
491 | if task == "package": | 491 | if task == "package": |
492 | include_timestamps = True | 492 | include_timestamps = True |
493 | include_root = False | 493 | include_root = False |
494 | extra_content = d.getVar('HASHEQUIV_HASH_VERSION') | 494 | hash_version = d.getVar('HASHEQUIV_HASH_VERSION') |
495 | extra_sigdata = d.getVar("HASHEQUIV_EXTRA_SIGDATA") | ||
495 | 496 | ||
496 | filemaps = {} | 497 | filemaps = {} |
497 | for m in (d.getVar('SSTATE_HASHEQUIV_FILEMAP') or '').split(): | 498 | for m in (d.getVar('SSTATE_HASHEQUIV_FILEMAP') or '').split(): |
@@ -506,8 +507,11 @@ def OEOuthashBasic(path, sigfile, task, d): | |||
506 | basepath = os.path.normpath(path) | 507 | basepath = os.path.normpath(path) |
507 | 508 | ||
508 | update_hash("OEOuthashBasic\n") | 509 | update_hash("OEOuthashBasic\n") |
509 | if extra_content: | 510 | if hash_version: |
510 | update_hash(extra_content + "\n") | 511 | update_hash(hash_version + "\n") |
512 | |||
513 | if extra_sigdata: | ||
514 | update_hash(extra_sigdata + "\n") | ||
511 | 515 | ||
512 | # It is only currently useful to get equivalent hashes for things that | 516 | # It is only currently useful to get equivalent hashes for things that |
513 | # can be restored from sstate. Since the sstate object is named using | 517 | # can be restored from sstate. Since the sstate object is named using |