All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] go-mod.bbclass: Set GO_MOD_CACHE_DIR
@ 2024-09-12 14:29 Christian Lindeberg
  2024-09-12 17:00 ` [OE-core] " Jose Quaresma
  2024-09-12 20:13 ` [OE-core] " Ryan Eatmon
  0 siblings, 2 replies; 6+ messages in thread
From: Christian Lindeberg @ 2024-09-12 14:29 UTC (permalink / raw)
  To: openembedded-core

From: Christian Lindeberg <christian.lindeberg@axis.com>

Set the GO_MOD_CACHE_DIR variable and move the location of the module
cache to enable the use of the go module fetchers for module
dependencies.
Also, clean out the module cache before unpacking.

Signed-off-by: Christian Lindeberg <christian.lindeberg@axis.com>
---
 meta/classes-recipe/go-mod.bbclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/classes-recipe/go-mod.bbclass b/meta/classes-recipe/go-mod.bbclass
index ca3a690d05..71a6712c47 100644
--- a/meta/classes-recipe/go-mod.bbclass
+++ b/meta/classes-recipe/go-mod.bbclass
@@ -22,9 +22,9 @@ GOBUILDFLAGS:append = " -modcacherw"
 
 inherit go
 
+GO_MOD_CACHE_DIR ?= "${@os.path.join(os.path.basename(d.getVar('S')), 'pkg/mod')}"
+export GOMODCACHE = "${@os.path.join(os.path.dirname(d.getVar('S')), d.getVar('GO_MOD_CACHE_DIR'))}"
+do_unpack[cleandirs] += "${GOMODCACHE}"
+
 GO_WORKDIR ?= "${GO_IMPORT}"
 do_compile[dirs] += "${B}/src/${GO_WORKDIR}"
-
-export GOMODCACHE = "${B}/.mod"
-
-do_compile[cleandirs] += "${B}/.mod"
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-13  8:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-12 14:29 [PATCH] go-mod.bbclass: Set GO_MOD_CACHE_DIR Christian Lindeberg
2024-09-12 17:00 ` [OE-core] " Jose Quaresma
2024-09-12 21:49   ` Peter Kjellerstedt
2024-09-13  7:52   ` Christian Lindeberg
2024-09-12 20:13 ` [OE-core] " Ryan Eatmon
2024-09-13  8:16   ` Christian Lindeberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.