On Thu, Sep 12, 2024 at 10:14 PM, Ryan Eatmon wrote:

> 
> On 9/12/2024 9:29 AM, Christian Lindeberg wrote:
> 
>> From: Christian Lindeberg <christian.lindeb...@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.lindeb...@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"
> 
> 
> What is the reasoning behind moving the cache dir out of the build dir
> ${B} and into the bitbake managed sources dir ${S} ? There might be a
> good reason for doing it, but it was not explained in the commit message.

In the review of the gomod and gomodgit fetchers concerns were raised about
letting the fetchers unpack under ${GOMODCACHE} instead of relative to the
unpack root directory.

With the fetchers there is now a way to have the module cache part of the
bitbake managed sources instead of having to resort to
do_compile[network] = "1".

Thanks,
Christian

> 
> 
> 
> 
> --
> Ryan Eatmon reat...@ti.com
> -----------------------------------------
> Texas Instruments, Inc. - LCPD - MGTS
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#204474): 
https://lists.openembedded.org/g/openembedded-core/message/204474
Mute This Topic: https://lists.openembedded.org/mt/108413937/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