diff options
| author | Christian Lindeberg <christian.lindeberg@axis.com> | 2024-09-13 09:29:58 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-09-20 10:45:45 +0100 |
| commit | 773579da26c97ebd6e1cff3986487dfb6d6ceed3 (patch) | |
| tree | bb5c03e0c9f610e80c9d0c374cf672174f5af7c4 | |
| parent | d72b027a0ac4bc496003465da0f9c6e6c89457fe (diff) | |
| download | poky-773579da26c97ebd6e1cff3986487dfb6d6ceed3.tar.gz | |
go-mod.bbclass: Set GO_MOD_CACHE_DIR
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 downloading and
unpacking module dependencies to the module cache.
Also, clean out the module cache before unpacking.
(From OE-Core rev: 287daff0bbd877990ce272e10601d4540d71f239)
Signed-off-by: Christian Lindeberg <christian.lindeberg@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes-recipe/go-mod.bbclass | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes-recipe/go-mod.bbclass b/meta/classes-recipe/go-mod.bbclass index ca3a690d05..2083d7f2d1 100644 --- a/meta/classes-recipe/go-mod.bbclass +++ b/meta/classes-recipe/go-mod.bbclass | |||
| @@ -22,9 +22,9 @@ GOBUILDFLAGS:append = " -modcacherw" | |||
| 22 | 22 | ||
| 23 | inherit go | 23 | inherit go |
| 24 | 24 | ||
| 25 | export GOMODCACHE = "${S}/pkg/mod" | ||
| 26 | GO_MOD_CACHE_DIR = "${@os.path.relpath(d.getVar('GOMODCACHE'), d.getVar('WORKDIR'))}" | ||
| 27 | do_unpack[cleandirs] += "${GOMODCACHE}" | ||
| 28 | |||
| 25 | GO_WORKDIR ?= "${GO_IMPORT}" | 29 | GO_WORKDIR ?= "${GO_IMPORT}" |
| 26 | do_compile[dirs] += "${B}/src/${GO_WORKDIR}" | 30 | do_compile[dirs] += "${B}/src/${GO_WORKDIR}" |
| 27 | |||
| 28 | export GOMODCACHE = "${B}/.mod" | ||
| 29 | |||
| 30 | do_compile[cleandirs] += "${B}/.mod" | ||
