From: Christos Gavros Date: Sun, 2 Mar 2025 17:01:32 +0000 (+0100) Subject: go: Check if GO_IMPORT is set in recipe and error if not X-Git-Tag: yocto-5.2~358 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=374a91204bdaf44067f6b0ae89ed60934751efaa;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git go: Check if GO_IMPORT is set in recipe and error if not Check if the variable GO_IMPORT is set in the recipe. If not generate an error. Test building go-helloworld when GO_IMPORT assigned Test building go-helloworld when GO_IMPORT is not assigned, generate error about GO_IMPORT Test building any other recipe(e.g bash) when GO_IMPORT is not assigned, generate error about GO_IMPORT Test creating a GO recipe with recipetool (not affected) Test selftest test_recipetool_create_go (not affected) Test selftest test_recipetool_create_go_replace_modules (not affected) [YOCTO #15763] CC: Yoann Congal CC: Randy MacLeod Signed-off-by: Christos Gavros Signed-off-by: Richard Purdie --- diff --git a/meta/classes-recipe/go.bbclass b/meta/classes-recipe/go.bbclass index c81d9460699..e0f667373e1 100644 --- a/meta/classes-recipe/go.bbclass +++ b/meta/classes-recipe/go.bbclass @@ -7,6 +7,9 @@ inherit goarch inherit linuxloader +# if the GO_IMPORT is not set in recipe generate an error +GO_IMPORT ??= "${@bb.fatal("The recipe needs to set GO_IMPORT for go.bbclass to work")}" + GO_PARALLEL_BUILD ?= "${@oe.utils.parallel_make_argument(d, '-p %d')}" export GODEBUG = "gocachehash=1"