All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian Lindeberg" <christian.lindeberg@axis.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] go-mod.bbclass: Set GO_MOD_CACHE_DIR
Date: Fri, 13 Sep 2024 00:52:28 -0700	[thread overview]
Message-ID: <14967.1726213948941593452@lists.openembedded.org> (raw)
In-Reply-To: <CANPvuR=_+MNMoB6-5-0NyR+U0VS5p4A3VdXokv1Evw04=e7-+A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2213 bytes --]

On Thu, Sep 12, 2024 at 07:01 PM, Jose Quaresma wrote:

> 
> Hi Christian,
> 
> Christian Lindeberg via lists.openembedded.org (
> http://lists.openembedded.org ) <christian.lindeberg= axis.com@lists.openembedded.org
> > escreveu (quinta, 12/09/2024 à(s) 15:30):
> 
>> 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'))}"
> 
> 
> Using the default [1] bitbake S = "${WORKDIR}/${BP}" config, I think this
> will be equal to:
> 
> GO_MOD_CACHE_DIR ?= "${BP}/pkg/mod"
> export GOMODCACHE = "${WORKDIR}/${BP}/pkg/mod"
> 
> in the end this can be written as:
> 
> export GOMODCACHE ?= "${S}/pkg/mod"
> 
> Is it correct or am I seeing something wrong?
> 

Correct, I sent a new version with this and the suggestion from Peter Kjellerstedt.

Thanks,
Christian

> 
> 
> [1] https://github.com/openembedded/openembedded-core/blob/40d2fbece1c2f6ecf62bffa44ad37850e90268cb/meta/conf/bitbake.conf#L405C6-L405C16
> 
> 
> Jose
> 
> 
>> +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
>> 
>> 
>> 
>> 
> 
> 
> 
> 
> --
> Best regards,
> 
> José Quaresma
>

[-- Attachment #2: Type: text/html, Size: 3547 bytes --]

  parent reply	other threads:[~2024-09-13  7:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2024-09-12 20:13 ` Ryan Eatmon
2024-09-13  8:16   ` Christian Lindeberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14967.1726213948941593452@lists.openembedded.org \
    --to=christian.lindeberg@axis.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.