From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Patrick Gerber <pge@ik.me>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/2] package/pkg-golang: enable pkg specific go env also for download step
Date: Sun, 4 Dec 2022 18:35:24 +0100 [thread overview]
Message-ID: <20221204173524.GA2855@scaer> (raw)
In-Reply-To: <20221204140643.893075-1-pge@ik.me>
Patrick, All,
Thanks for this respin. :-)
On 2022-12-04 15:06 +0100, Patrick Gerber spake thusly:
> Currently package secific go env is used only during package build step.
>
> Go vendering is done during the download step and it's sometimes required
> to specify package secific go env also for this step.
>
> For example, when importing custom go modules who are hosted on a private
> host, it’s required to set GOPRIVATE to avoid public sum checking.
>
> Signed-off-by: Patrick Gerber <pge@ik.me>
> ---
> package/pkg-golang.mk | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/package/pkg-golang.mk b/package/pkg-golang.mk
> index 0b3dc3d32f..cdc67b32c0 100644
> --- a/package/pkg-golang.mk
> +++ b/package/pkg-golang.mk
> @@ -87,7 +87,8 @@ $(2)_POST_PATCH_HOOKS += $(2)_GEN_GOMOD
> $(2)_DOWNLOAD_POST_PROCESS = go
> $(2)_DL_ENV += \
> $$(HOST_GO_COMMON_ENV) \
> - GOPROXY=direct
> + GOPROXY=direct \
> + $$($(2)_GO_ENV)
As you can see, the pkg-golang infra extends $(2)_DL_ENV, so you can
already achieve what you want by adding the following to your package:
FOO_DL_ENV = GOPRIVATE=blablabla
or even:
FOO_GO_ENV = GOPRIVATE=blablabla
FOO_DL_ENV = $(FOO_GO_ENV)
Also, what was probably not very clear in my previous review, is the
concern whether we can have some package that set FOO_GO_ENV to
something that would break the download step.
So I had a look at the official documentation for generic environment
variables that apply to the go command [0]; I could not spot a generic
variable that would obviously have an impact on downloads, unless also
listed as those that just apply to the go-mod command [1].
It thus looks like the correct behaviour to use the build environment
variables during hte download. Still, I was not sure this was material
for the master branch, so I applied to next. Thanks!
[0] https://pkg.go.dev/cmd/go#hdr-Environment_variables
[1] https://go.dev/ref/mod#environment-variables
Regards,
Yann E. MORIN.
> # Due to vendoring, it is pretty likely that not all licenses are
> # listed in <pkg>_LICENSE.
> --
> 2.25.1
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
prev parent reply other threads:[~2022-12-04 17:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-04 14:06 [Buildroot] [PATCH 1/2] package/pkg-golang: enable pkg specific go env also for download step Patrick Gerber via buildroot
2022-12-04 14:06 ` [Buildroot] [PATCH 2/2] package/mender-artifact: remove unnecessary GO_ENV Patrick Gerber via buildroot
2022-12-04 17:36 ` Yann E. MORIN
2022-12-04 17:35 ` Yann E. MORIN [this message]
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=20221204173524.GA2855@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@buildroot.org \
--cc=pge@ik.me \
/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