diff mbox series

go-mod.bbclass: Unpack module dependency license files

Message ID 20240917063513.1036889-1-christli@axis.com
State New
Headers show
Series go-mod.bbclass: Unpack module dependency license files | expand

Commit Message

Christian Lindeberg Sept. 17, 2024, 6:35 a.m. UTC
From: Christian Lindeberg <christian.lindeberg@axis.com>

To keep the module cache logic in the go module fetchers simple, the
unpacking of the module zip files in the module cache directory is left
to the go install command in do_compile. So for do_populate_lic to find
the license files of module dependencies, do_compile needs to run before
do_populate_lic.

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

Patch

diff --git a/meta/classes-recipe/go-mod.bbclass b/meta/classes-recipe/go-mod.bbclass
index 2083d7f2d1..93ae72235f 100644
--- a/meta/classes-recipe/go-mod.bbclass
+++ b/meta/classes-recipe/go-mod.bbclass
@@ -28,3 +28,7 @@  do_unpack[cleandirs] += "${GOMODCACHE}"
 
 GO_WORKDIR ?= "${GO_IMPORT}"
 do_compile[dirs] += "${B}/src/${GO_WORKDIR}"
+
+# Make go install unpack the module zip files in the module cache directory
+# before the license directory is polulated with license files.
+addtask do_compile before do_populate_lic