staging: Ensure we filter out ourselves

Message ID 20220427152354.2824313-1-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit d98b06c9c6f480de1e5167bfe8392e39300fc02c
Headers show
Series staging: Ensure we filter out ourselves | expand

Commit Message

Richard Purdie April 27, 2022, 3:23 p.m. UTC
Adding a dependency on ourselves in this function doesn't make sense, the hash
may change after hash equivalence is applied. Other code using BB_TASKDEPDATA does
handle the self reference correctly (which is there for a reason), update this
code to do likewise.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/staging.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Joshua Watt April 27, 2022, 3:25 p.m. UTC | #1
Reviewed-by: Joshua Watt <JPEWhacker@gmail.com>

On 4/27/22 10:23, Richard Purdie wrote:
> Adding a dependency on ourselves in this function doesn't make sense, the hash
> may change after hash equivalence is applied. Other code using BB_TASKDEPDATA does
> handle the self reference correctly (which is there for a reason), update this
> code to do likewise.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>   meta/classes/staging.bbclass | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
> index ab827766bef..9fc8f4f2839 100644
> --- a/meta/classes/staging.bbclass
> +++ b/meta/classes/staging.bbclass
> @@ -651,7 +651,7 @@ python target_add_sysroot_deps () {
>       taskdepdata = d.getVar("BB_TASKDEPDATA", False)
>       deps = {}
>       for dep in taskdepdata.values():
> -        if dep[1] == "do_populate_sysroot" and not dep[0].endswith(("-native", "-initial")) and "-cross-" not in dep[0]:
> +        if dep[1] == "do_populate_sysroot" and not dep[0].endswith(("-native", "-initial")) and "-cross-" not in dep[0] and dep[0] != pn:
>               deps[dep[0]] = dep[6]
>   
>       d.setVar("HASHEQUIV_EXTRA_SIGDATA", "\n".join("%s: %s" % (k, deps[k]) for k in sorted(deps.keys())))
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#164927): https://lists.openembedded.org/g/openembedded-core/message/164927
> Mute This Topic: https://lists.openembedded.org/mt/90733144/3616693
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [JPEWhacker@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Jacob Kroon April 27, 2022, 5:29 p.m. UTC | #2
On 4/27/22 17:25, Joshua Watt wrote:
> Reviewed-by: Joshua Watt <JPEWhacker@gmail.com>
> 
> On 4/27/22 10:23, Richard Purdie wrote:
>> Adding a dependency on ourselves in this function doesn't make sense,
>> the hash
>> may change after hash equivalence is applied. Other code using
>> BB_TASKDEPDATA does
>> handle the self reference correctly (which is there for a reason),
>> update this
>> code to do likewise.
>>
>> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>> ---
>>   meta/classes/staging.bbclass | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
>> index ab827766bef..9fc8f4f2839 100644
>> --- a/meta/classes/staging.bbclass
>> +++ b/meta/classes/staging.bbclass
>> @@ -651,7 +651,7 @@ python target_add_sysroot_deps () {
>>       taskdepdata = d.getVar("BB_TASKDEPDATA", False)
>>       deps = {}
>>       for dep in taskdepdata.values():
>> -        if dep[1] == "do_populate_sysroot" and not
>> dep[0].endswith(("-native", "-initial")) and "-cross-" not in dep[0]:
>> +        if dep[1] == "do_populate_sysroot" and not
>> dep[0].endswith(("-native", "-initial")) and "-cross-" not in dep[0]
>> and dep[0] != pn:
>>               deps[dep[0]] = dep[6]
>>         d.setVar("HASHEQUIV_EXTRA_SIGDATA", "\n".join("%s: %s" % (k,
>> deps[k]) for k in sorted(deps.keys())))
>>

Thanks Richard/Joshua. With the patch applied everything behaves nicely
here again.

Jacob

Patch

diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index ab827766bef..9fc8f4f2839 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -651,7 +651,7 @@  python target_add_sysroot_deps () {
     taskdepdata = d.getVar("BB_TASKDEPDATA", False)
     deps = {}
     for dep in taskdepdata.values():
-        if dep[1] == "do_populate_sysroot" and not dep[0].endswith(("-native", "-initial")) and "-cross-" not in dep[0]:
+        if dep[1] == "do_populate_sysroot" and not dep[0].endswith(("-native", "-initial")) and "-cross-" not in dep[0] and dep[0] != pn:
             deps[dep[0]] = dep[6]
 
     d.setVar("HASHEQUIV_EXTRA_SIGDATA", "\n".join("%s: %s" % (k, deps[k]) for k in sorted(deps.keys())))