Thank you for your reply.
HELLO's value in two bbfiles is same when using ':=', but it brought new errors:
ERROR: When reparsing a.bb and b.bb: the basehash value changed from
xxxx to xxxx. The metadata is not deterministic and this needs to be
fixed.

What could be the reason? My guess is that, during reparses, bitbake
also calls the random_number_function multiple times, causing
different random numbers to be generated each time and thus resulting
in different hash values.

I am a beginner, and this issue is a bit complex for me. So, I took
the following approach: I wrote the random number to a file using a
recipe, and other bbfiles use it by reading the random number file.

Is there a good idea? Thanks again!

ChenQi <qi.c...@windriver.com> 于2023年12月29日周五 14:12写道:
>
> How about using ':='?
> e.g.,
> HELLO := "${@random_number_function}"
>
> Regards,
> Qi
>
> On 12/29/23 13:49, Jiliang Cai wrote:
> > I define a global variable in config like this:
> > HELLO=${@random_number_function}
> >
> > Then I print HELLO's value in two bbfiles. I found that the value of
> > HELLO is different because the random_number_function was called in
> > every bbfile. How to fix it?
> >
> > 
> >
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#62048): https://lists.yoctoproject.org/g/yocto/message/62048
Mute This Topic: https://lists.yoctoproject.org/mt/103413529/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to