On Tue, 2025-02-25 at 15:33 -0500, Randy MacLeod via lists.openembedded.org 
wrote:
>  On 2025-02-25 1:09 p.m., Christos Gavros wrote:
>  Check if the variable GO_IMPORT is
> > assigned with a value. If not generate an error.
> > Fixes [YOCTO #15763]
> > 
> > CC: Yoann Congal <yoann.con...@smile.fr>
> > CC: Randy MacLeod <randy.macl...@windriver.com>
> > CC: Alexander Kanavin <alex.kana...@gmail.com>
> > Signed-off-by: Christos Gavros <gavr...@yahoo.com>
> > ---
> >  meta/classes-global/sanity.bbclass | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/meta/classes-global/sanity.bbclass 
> > b/meta/classes-global/sanity.bbclass
> > index 1bae998f74..01e48b4347 100644
> > --- a/meta/classes-global/sanity.bbclass
> > +++ b/meta/classes-global/sanity.bbclass
> > @@ -1010,6 +1010,10 @@ def check_sanity_everybuild(status, d):
> >          if '/dash' not in real_sh and '/bash' not in real_sh:
> >              status.addresult("Error, /bin/sh links to %s, must be dash or 
> > bash\n" % real_sh)
> >  
> > +    # Check if a value is assigned to GO_IMPORT variable
> > +    if not d.getVar('GO_IMPORT'):
> > +        status.addresult("GO_IMPORT variable is not assigned with a value")
> > +
> >  def check_sanity(sanity_data):
> >      class SanityStatus(object):
> >          def __init__(self):
> >  
>  
> Thanks Christos,
>  
> I know I suggested that you try sending this to see what people say and to 
> get some guidance but
>  this break all the builds so clearly we can't merge it. I did expect you to 
> do a build though... ;-)
>   
> ❯ bitbake busybox
>  ...
>  ERROR:  OE-core's config sanity checker detected a potential 
> misconfiguration.
>      Either fix the cause of this error or at your own risk disable the 
> checker (see sanity.conf).
>      Following is the list of potential problems / advisories:
>  
>      GO_IMPORT variable is not assigned with a value
>  
> We need a sanity check at the recipe level for go-based recipes only.
>  I'm not sure how to do that.
>  
> I may do a bit of digging and reply to my own email with a suggestion of a 
> better approach unless someone beats me to it!

The code is close, the location is wrong as "sanity test" is misleading
you.

The place this is used is in go.bbclass so I'd suggest we need a check
in that class alongside where it is used. It could be as simple as the
code above but in the form:

python () {
    # Check if a value is assigned to GO_IMPORT variable
    if not d.getVar('GO_IMPORT'):
        bb.fatal("GO_IMPORT variable needs to be set to use the go bbclass but 
has no value")
}

Cheers,

Richard


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#211936): 
https://lists.openembedded.org/g/openembedded-core/message/211936
Mute This Topic: https://lists.openembedded.org/mt/111381998/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to