From: Peter Korsgaard <peter@korsgaard.com>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Anisse Astier <anisse@astier.eu>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 2/2] package/go: explicitly set GOMODCACHE
Date: Mon, 16 Jan 2023 21:52:10 +0100 [thread overview]
Message-ID: <87mt6ifbid.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <20230116203007.GF2770@scaer> (Yann E. MORIN's message of "Mon, 16 Jan 2023 21:30:07 +0100")
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
> Peter, All,
> On 2023-01-16 11:50 +0100, Peter Korsgaard spake thusly:
>> go mod vendor caches downloaded modules to the Go module cache, which
>> defaults to $GOPATH/pkg/mod - But can be overridden with the GOMODCACHE
>> environment variable:
>>
>> https://go.dev/ref/mod#module-cache
>>
>> So explicitly set GOMODCACHE= for reproducibility.
>>
>> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
> Applied to master, thanks, but see below...
>> ---
>> package/go/go.mk | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/package/go/go.mk b/package/go/go.mk
>> index c4f72d403c..c38ae0b99c 100644
>> --- a/package/go/go.mk
>> +++ b/package/go/go.mk
>> @@ -26,6 +26,7 @@ HOST_GO_COMMON_ENV = \
>> GOROOT="$(HOST_GO_ROOT)" \
>> GOPATH="$(HOST_GO_GOPATH)" \
>> GOCACHE="$(HOST_GO_TARGET_CACHE)" \
>> + GOMODCACHE="$(HOST_GO_GOPATH)/pkg/mod" \
> HOST_GO_GOPATH is $(HOST_DIR)/share/go-path, however, with PPD, HOST_DIR
> is per-package, so there will not besharing of the cache between two
> packages, unless there is a build dependency between them (unlikely in
> the go ecosystem).
> If we wanted to really share the go cache(s), we need to hit somewhere
> in $(BR2_DL_DIR), like we do for cargo, see 8450b7691870 (package/pkg-cargo:
> move CARGO_HOME into DL_DIR).
> Still, this patch guarantees that the current situation is reproducible,
> and does not depend on the user's environment.
Yes, I know. As far as I can see this was already the case (on systems
where GOMODCACHE isn't set), and I wanted a "safe" fix we could backport
- But indeed, longer term we should probably put the go module cache in
DL_DIR like we recently did for the cargo cache.
> Applied to master, thanks.
Thanks!
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2023-01-16 20:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-16 10:50 [Buildroot] [PATCH 1/2] package/go: set GOCACHE for download post-process Peter Korsgaard
2023-01-16 10:50 ` [Buildroot] [PATCH 2/2] package/go: explicitly set GOMODCACHE Peter Korsgaard
2023-01-16 20:30 ` Yann E. MORIN
2023-01-16 20:52 ` Peter Korsgaard [this message]
2023-01-16 20:38 ` Christian Stewart via buildroot
2023-01-16 20:55 ` Peter Korsgaard
2023-01-16 21:35 ` Christian Stewart via buildroot
2023-01-17 9:27 ` Peter Korsgaard
2023-01-16 20:26 ` [Buildroot] [PATCH 1/2] package/go: set GOCACHE for download post-process Yann E. MORIN
2023-01-16 20:36 ` Christian Stewart via buildroot
2023-01-16 20:56 ` Peter Korsgaard
2023-01-17 9:27 ` Peter Korsgaard
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=87mt6ifbid.fsf@dell.be.48ers.dk \
--to=peter@korsgaard.com \
--cc=anisse@astier.eu \
--cc=buildroot@buildroot.org \
--cc=yann.morin.1998@free.fr \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox