On Thu, 2025-02-27 at 05:15 -0800, Christos Gavros via lists.openembedded.org 
wrote:
> hi Richard
>  
> I have added the code as you suggested in go.bbclass and then i created 
> meta-mylayer and try to build there "go-helloworld_0.1.bb". It builds fine.
> 
>  
> When i commented GO_IMPORT in the recipe the error i am getting is:
>  
> 
> 
> 
> 
> ERROR: ExpansionError during parsing 
> /home/cg/CG/Programming/Yocto/poky/meta-mylayer/recipes-go/go-helloworld/go-helloworld.bb
>              | ETA:  --:--:--
> bb.data_smart.ExpansionError: Failure expanding variable 
> GO_SRCURI_DESTSUFFIX, expression was 
> ${@os.path.join(os.path.basename(d.getVar('S')), 'src', 
> d.getVar('GO_IMPORT')) + '/'} which triggered exception TypeError: join() 
> argument must be str, bytes, or os.PathLike object, not 'NoneType'
> The variable dependency chain for the failure is: GO_SRCURI_DESTSUFFIX -> 
> SRC_URI
>  
> 
> 
> This is caused from this line in the recipe: SRC_URI = 
> "git://go.googlesource.com/example;branch=master;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX}"
>  
> So it looks that expanding GO_SRCURI_DESTSUFFIX variable is executed before 
> anonymous python function and the error "GO_IMPORT is not set" will not be 
> generated.
>  
> If you don't have anything to comment , I will try to dive deeper and see how 
> I can adapt it...
> 

That is unfortunate. As you say, it is expanding it earlier than the
anonymous python.

One slightly evil idea that comes to mind might be:

GO_IMPORT ??= "${@bb.fatal("The recipe needs to set GO_IMPORT for go.bbclass to 
work")}"

Not sure if that would work or not! It may still give a traceback
although I'm hoping it doesn't.


Cheers,

Richard


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#212002): 
https://lists.openembedded.org/g/openembedded-core/message/212002
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