Skip to contentSkip to conversation

package/pkg-golang.mk: make GOPROXY configurable

PATCH In review James Hilliard 3 participants 10 messages Oct 20, 2025 – Oct 21, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 package/pkg-golang.mk: make GOPROXY configurable

BR2_GOPROXY now configures the Go module proxy URL used to download Go modules specified in project go.mod and go.sum files. By default, it uses Google's official Go module mirror at proxy.golang.org, falling back to direct downloads if the module is not found in the mirror.

This change sets the default GOPROXY value to match Go's built-in default of "https://proxy.golang.org,direct" which provides several benefits:

- Avoid package breakages due to missing module sources
- Better alignment with upstream Go toolchain defaults
- Faster downloads via the proxy compared to direct Git clones
- Maintains reproducible builds through Go's module checksum validation

The default value from the toolchain can be read with "go env GOPROXY"

We rely on package developers to audit their dependencies in go.mod and go.sum.

The value can be configured to:
- A comma-separated list of proxy URLs
- "off" to disable all downloads
- "direct" to download directly from source repositories

For more details on Go module proxies:
https://go.dev/ref/mod#module-proxy

Discussion:
https://lore.kernel.org/all/CADvTj4pXO2rwJ8oCzzGNY+OxLuo3uJnDT2PAxbyquw0L6dhfiA@mail.gmail.com/T/#t

---
v1 -> v2:

- added more context and links
- renamed to GOPROXY instead of GOPROXY_LIST
- moved into the !BR2_PRIMARY_SITE_ONLY section

---
 Config.in             | 16 ++++++++++++++++
 package/pkg-golang.mk |  2 +-
 2 files changed, 17 insertions(+), 1 deletion(-)
Config.in +16 -0
index d730f2034b..23717f3f97 100644
@@ -335,6 +335,22 @@ config BR2_LUAROCKS_MIRROR
 
 	  See http://luarocks.org
 
+config BR2_GOPROXY
+	string "Go module proxy"
+	default "https://proxy.golang.org,direct"
+	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
+	help
+	  The Go module proxy URL used to download Go modules. By
+	  default, it uses the official Go module mirror, falling back
+	  to direct downloads if the module is not found in the mirror.
+
+	  The value can be one of:
+	    - Comma-separated list of proxy URLs
+	    - "off" to disable all downloads
+	    - "direct" to download directly from source repositories
+
+	  See https://go.dev/ref/mod#module-proxy
+
 config BR2_CPAN_MIRROR
 	string "CPAN mirror (Perl packages)"
 	default "https://cpan.metacpan.org"
package/pkg-golang.mk +1 -1
index ffd50adecc..3e388cb257 100644
@@ -101,7 +101,7 @@ $(2)_POST_PATCH_HOOKS += $(2)_GEN_GOMOD
 $(2)_DOWNLOAD_POST_PROCESS = go
 $(2)_DL_ENV += \
 	$$(HOST_GO_COMMON_ENV) \
-	GOPROXY=direct \
+	GOPROXY=$$(call qstrip,$$(BR2_GOPROXY)) \
 	$$($(2)_GO_ENV)
 
 # If building in a sub directory, do the vendoring in there
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH v2 2/2 package/tailscale: bump to version 1.88.3

---
 package/tailscale/tailscale.hash | 2 +-
 package/tailscale/tailscale.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/tailscale/tailscale.hash +1 -1
index e2d600f03e..444412f8f4 100644
@@ -1,3 +1,3 @@
 # Locally computed
-sha256  4830cd822a838d5d44fd5eeebd07a2aacaf0255fb3fb7d3852d57659f54e51bc  tailscale-1.78.1-go2.tar.gz
+sha256  98b51e95e84378ab280c5a8706508d493ab9152a0215f00f0f69e3ea2673ea0f  tailscale-1.88.3-go2.tar.gz
 sha256  d1ee1c7947d4b2c1963ea214d5324f1d4c89f2f1d0f0224889b4dfb868dad725  LICENSE
package/tailscale/tailscale.mk +1 -1
index 3c6c7bce1e..141a5b98d6 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-TAILSCALE_VERSION = 1.78.1
+TAILSCALE_VERSION = 1.88.3
 TAILSCALE_SITE = $(call github,tailscale,tailscale,v$(TAILSCALE_VERSION))
 TAILSCALE_LICENSE = BSD-3-Clause
 TAILSCALE_LICENSE_FILES = LICENSE
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Reviewed-by Christian Stewart on v2 1/2
#2 lore raw
In reply to James Hilliard

LGTM!

Quoted 85 lines · James Hilliard

BR2_GOPROXY now configures the Go module proxy URL used to download Go modules specified in project go.mod and go.sum files. By default, it uses Google's official Go module mirror at proxy.golang.org, falling back to direct downloads if the module is not found in the mirror.

This change sets the default GOPROXY value to match Go's built-in default of "https://proxy.golang.org,direct" which provides several benefits:

- Avoid package breakages due to missing module sources
- Better alignment with upstream Go toolchain defaults
- Faster downloads via the proxy compared to direct Git clones
- Maintains reproducible builds through Go's module checksum validation

The default value from the toolchain can be read with "go env GOPROXY"

We rely on package developers to audit their dependencies in go.mod and go.sum.

The value can be configured to:
- A comma-separated list of proxy URLs
- "off" to disable all downloads
- "direct" to download directly from source repositories

For more details on Go module proxies:
https://go.dev/ref/mod#module-proxy

Discussion:
https://lore.kernel.org/all/CADvTj4pXO2rwJ8oCzzGNY+OxLuo3uJnDT2PAxbyquw0L6dhfiA@mail.gmail.com/T/#t

---
v1 -> v2:

- added more context and links
- renamed to GOPROXY instead of GOPROXY_LIST
- moved into the !BR2_PRIMARY_SITE_ONLY section

---
 Config.in             | 16 ++++++++++++++++
 package/pkg-golang.mk |  2 +-
 2 files changed, 17 insertions(+), 1 deletion(-)
Config.in +16 -0
index d730f2034b..23717f3f97 100644
@@ -335,6 +335,22 @@ config BR2_LUAROCKS_MIRROR
 
          See http://luarocks.org
 
+config BR2_GOPROXY
+       string "Go module proxy"
+       default "https://proxy.golang.org,direct"
+       depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
+       help
+         The Go module proxy URL used to download Go modules. By
+         default, it uses the official Go module mirror, falling back
+         to direct downloads if the module is not found in the mirror.
+
+         The value can be one of:
+           - Comma-separated list of proxy URLs
+           - "off" to disable all downloads
+           - "direct" to download directly from source repositories
+
+         See https://go.dev/ref/mod#module-proxy
+
 config BR2_CPAN_MIRROR
        string "CPAN mirror (Perl packages)"
        default "https://cpan.metacpan.org"
package/pkg-golang.mk +1 -2
index ffd50adecc..3e388cb257 100644
@@ -101,7 +101,7 @@ $(2)_POST_PATCH_HOOKS += $(2)_GEN_GOMOD
 $(2)_DOWNLOAD_POST_PROCESS = go
 $(2)_DL_ENV += \
        $$(HOST_GO_COMMON_ENV) \
-       GOPROXY=direct \
+       GOPROXY=$$(call qstrip,$$(BR2_GOPROXY)) \
        $$($(2)_GO_ENV)
 
 # If building in a sub directory, do the vendoring in there
--
Quoted 2 lines

2.43.0

v2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
In reply to James Hilliard

James, All,

On 2025-10-20 16:54 -0600, James Hilliard spake thusly:

Quoted 9 lines

BR2_GOPROXY now configures the Go module proxy URL used to download Go modules specified in project go.mod and go.sum files. By default, it uses Google's official Go module mirror at proxy.golang.org, falling back to direct downloads if the module is not found in the mirror.

This change sets the default GOPROXY value to match Go's built-in default of "https://proxy.golang.org,direct" which provides several benefits:

- Avoid package breakages due to missing module sources

How can sources be missing when fetched "direct"ly?

Do you have a nesxample of a package where this actually fixes the download (barring using s.b.o.) ?

Quoted 3 lines

- Better alignment with upstream Go toolchain defaults
- Faster downloads via the proxy compared to direct Git clones
- Maintains reproducible builds through Go's module checksum validation

In the past, we observed the reverse: the goproxy had a stale version that was not matching the upstream one, so when we tried to vendor a package, the hashes would not match. Using "direct" fixed the issue (sorry, I can't remember what package that was...)

Quoted 1 line

The default value from the toolchain can be read with "go env GOPROXY"

I disagree. The default should be the same as the previous setting, that is "direct". At least in this patch.

If you want to suggest a change of the default, please do that in a separate patch.

Regards,
Yann E. MORIN.

Quoted 75 lines

We rely on package developers to audit their dependencies in go.mod and go.sum.

The value can be configured to:
- A comma-separated list of proxy URLs
- "off" to disable all downloads
- "direct" to download directly from source repositories

For more details on Go module proxies:
https://go.dev/ref/mod#module-proxy

Discussion:
https://lore.kernel.org/all/CADvTj4pXO2rwJ8oCzzGNY+OxLuo3uJnDT2PAxbyquw0L6dhfiA@mail.gmail.com/T/#t

---
v1 -> v2:

- added more context and links
- renamed to GOPROXY instead of GOPROXY_LIST
- moved into the !BR2_PRIMARY_SITE_ONLY section

---
 Config.in             | 16 ++++++++++++++++
 package/pkg-golang.mk |  2 +-
 2 files changed, 17 insertions(+), 1 deletion(-)
Config.in +16 -0
index d730f2034b..23717f3f97 100644
@@ -335,6 +335,22 @@ config BR2_LUAROCKS_MIRROR
 
 	  See http://luarocks.org
 
+config BR2_GOPROXY
+	string "Go module proxy"
+	default "https://proxy.golang.org,direct"
+	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
+	help
+	  The Go module proxy URL used to download Go modules. By
+	  default, it uses the official Go module mirror, falling back
+	  to direct downloads if the module is not found in the mirror.
+
+	  The value can be one of:
+	    - Comma-separated list of proxy URLs
+	    - "off" to disable all downloads
+	    - "direct" to download directly from source repositories
+
+	  See https://go.dev/ref/mod#module-proxy
+
 config BR2_CPAN_MIRROR
 	string "CPAN mirror (Perl packages)"
 	default "https://cpan.metacpan.org"
package/pkg-golang.mk +1 -1
index ffd50adecc..3e388cb257 100644
@@ -101,7 +101,7 @@ $(2)_POST_PATCH_HOOKS += $(2)_GEN_GOMOD
 $(2)_DOWNLOAD_POST_PROCESS = go
 $(2)_DL_ENV += \
 	$$(HOST_GO_COMMON_ENV) \
-	GOPROXY=direct \
+	GOPROXY=$$(call qstrip,$$(BR2_GOPROXY)) \
 	$$($(2)_GO_ENV)
 
 # If building in a sub directory, do the vendoring in there
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 23 lines
                                        ____________
.-----------------.--------------------:       _    :------------------.
|  Yann E. MORIN  | Real-Time Embedded |    __/ )   | /"\ ASCII RIBBON |
|                 | Software  Designer |  _/ - /'   | \ / CAMPAIGN     |
| +33 638.411.245 '--------------------: (_    `--, |  X  AGAINST      |
| yann.morin (at) orange.com           |_="    ,--' | / \ HTML MAIL    |
'--------------------------------------:______/_____:------------------'

____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Hi Yann,

Quoted 3 lines · On Mon, Oct 20, 2025 at 9:34 PM <[email protected]> wrote:
Quoted 1 line

- Avoid package breakages due to missing module sources

How can sources be missing when fetched "direct"ly?

We had situations where Git tags were force-pushed post-facto causing breakages.

I remember another case as well where Git LFS files were handled incorrectly leading to breakages.

Quoted 2 lines

Do you have a nesxample of a package where this actually fixes the download (barring using s.b.o.) ?

I will leave this to James to answer - not sure.

FWIW I've overridden it to "direct" in my own Buildroot branch as I still prefer from-Git sources.

Quoted 8 lines
Quoted 3 lines

- Better alignment with upstream Go toolchain defaults
- Faster downloads via the proxy compared to direct Git clones
- Maintains reproducible builds through Go's module checksum validation

In the past, we observed the reverse: the goproxy had a stale version that was not matching the upstream one, so when we tried to vendor a package, the hashes would not match. Using "direct" fixed the issue (sorry, I can't remember what package that was...)

I think it was the other way around, GOPROXY had the stale version yes,

... but the downstream dependencies of said package also expected the stale version.

Quoted 7 lines
Quoted 1 line

The default value from the toolchain can be read with "go env GOPROXY"

I disagree. The default should be the same as the previous setting, that is "direct". At least in this patch.

If you want to suggest a change of the default, please do that in a separate patch.

Ack

Best regards,
Christian
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw

Christian, All,

On 2025-10-20 22:09 -0700, Christian Stewart spake thusly:

Quoted 4 lines · On Mon, Oct 20, 2025 at 9:34 PM <[email protected]> wrote:
Quoted 2 lines
Quoted 1 line

- Avoid package breakages due to missing module sources

How can sources be missing when fetched "direct"ly?

We had situations where Git tags were force-pushed post-facto causing breakages.

But then using a goproxy could also cause breakage if a reverse dependency used "direct" to fetch sources from upstream after they force-pushed the git tag, no?

For example, consider the following timeline:
* package A tags v1
* package B uses A-v1
* someone grabs package B and vendors it using goproxy => goproxy caches A-v1
* package A force-pushes v1 (let's call it v1´)
* package C uses A-v1´ not using a goproxy (or a different one!)
* someone grabs package C and vendors it using goproxy => gets the wrong sources...

And a go package upstream force-pushing a tag is not different for us Buildroot than a non-go package upstream force-pushing a tag: in any case, we end up expecting a specific hash for a tarball, but that's not what we got, and we can't blindly update our .hash file because older versions would be cached on s.b.o. (or the other way around for older buildroot versions). The only sloght difference is that in one case, we Buildroot are doing the hash check, while in the other, the go tooling does the check...

So, using a goproxy is not a silver bullet: on average it would introduce as many hash issues as it would solve...

[--SNIP--]

Quoted 2 lines

FWIW I've overridden it to "direct" in my own Buildroot branch as I still prefer from-Git sources.

Yes, I believe this should be the default. Using a non-direct goproxy could be interesting in company networks that have theire own internal goproxy that actualy proxies to the outter internet that is otherwise filtered.

Quoted 11 lines
Quoted 8 lines
Quoted 3 lines

- Better alignment with upstream Go toolchain defaults
- Faster downloads via the proxy compared to direct Git clones
- Maintains reproducible builds through Go's module checksum validation

In the past, we observed the reverse: the goproxy had a stale version that was not matching the upstream one, so when we tried to vendor a package, the hashes would not match. Using "direct" fixed the issue (sorry, I can't remember what package that was...)

I think it was the other way around, GOPROXY had the stale version yes, ... but the downstream dependencies of said package also expected the stale version.

Ah, I do remember another case, where the goproxy had a newer version, but the reverse dependencies expected the stale one. But my memory is a bit fuzzy about that...

In the end, it shows that using a goproxy is not a magic bullet to solve vendoring when upstream and the goproxy disagree on the content of a version...

Regards,
Yann E. MORIN.

Signature · 23 lines
                                        ____________
.-----------------.--------------------:       _    :------------------.
|  Yann E. MORIN  | Real-Time Embedded |    __/ )   | /"\ ASCII RIBBON |
|                 | Software  Designer |  _/ - /'   | \ / CAMPAIGN     |
| +33 638.411.245 '--------------------: (_    `--, |  X  AGAINST      |
| yann.morin (at) orange.com           |_="    ,--' | / \ HTML MAIL    |
'--------------------------------------:______/_____:------------------'

____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw
Quoted 4 lines · On Mon, Oct 20, 2025 at 11:36 PM <[email protected]> wrote:

Christian, All,

On 2025-10-20 22:09 -0700, Christian Stewart spake thusly:

Quoted 8 lines
Quoted 4 lines · On Mon, Oct 20, 2025 at 9:34 PM <[email protected]> wrote:
Quoted 2 lines
Quoted 1 line

- Avoid package breakages due to missing module sources

How can sources be missing when fetched "direct"ly?

We had situations where Git tags were force-pushed post-facto causing breakages.

But then using a goproxy could also cause breakage if a reverse dependency used "direct" to fetch sources from upstream after they force-pushed the git tag, no?

Upstream package sum files are basically always generated from the caching goproxy sources, not direct sources, so I don't think such a scenario would be common.

Quoted 10 lines

For example, consider the following timeline:
* package A tags v1
* package B uses A-v1
* someone grabs package B and vendors it using goproxy => goproxy caches A-v1
* package A force-pushes v1 (let's call it v1´)
* package C uses A-v1´ not using a goproxy (or a different one!)
* someone grabs package C and vendors it using goproxy => gets the wrong sources...

Quoted 8 lines

And a go package upstream force-pushing a tag is not different for us Buildroot than a non-go package upstream force-pushing a tag: in any case, we end up expecting a specific hash for a tarball, but that's not what we got, and we can't blindly update our .hash file because older versions would be cached on s.b.o. (or the other way around for older buildroot versions). The only sloght difference is that in one case, we Buildroot are doing the hash check, while in the other, the go tooling does the check...

The issue is that it's expected by upstream go packages that all hashes are for cached goproxy sources, not direct sources. So direct sources breaking wouldn't even be considered an issue by an upstream package as they always use cached sources.

Quoted 2 lines

So, using a goproxy is not a silver bullet: on average it would introduce as many hash issues as it would solve...

Actually it doesn't cause more breakage because basically all go package upstreams build using the goproxy enabled, direct only is basically never used by upstream projects since that's not the go toolchain default.

Quoted 9 lines

[--SNIP--]

Quoted 2 lines

FWIW I've overridden it to "direct" in my own Buildroot branch as I still prefer from-Git sources.

Yes, I believe this should be the default. Using a non-direct goproxy could be interesting in company networks that have theire own internal goproxy that actualy proxies to the outter internet that is otherwise filtered.

This will break package downloads, package downloads essentially always work with the caching goproxy because that's what the go ecosystem decided on for their default. Overriding the golang default causes a lot of breakage because of this.

Quoted 12 lines
Quoted 11 lines
Quoted 8 lines
Quoted 3 lines

- Better alignment with upstream Go toolchain defaults
- Faster downloads via the proxy compared to direct Git clones
- Maintains reproducible builds through Go's module checksum validation

In the past, we observed the reverse: the goproxy had a stale version that was not matching the upstream one, so when we tried to vendor a package, the hashes would not match. Using "direct" fixed the issue (sorry, I can't remember what package that was...)

I think it was the other way around, GOPROXY had the stale version yes, ... but the downstream dependencies of said package also expected the stale version.

Quoted 7 lines

Ah, I do remember another case, where the goproxy had a newer version, but the reverse dependencies expected the stale one. But my memory is a bit fuzzy about that...

In the end, it shows that using a goproxy is not a magic bullet to solve vendoring when upstream and the goproxy disagree on the content of a version...

That's not true due to all packages expecting the cached goproxy sources to be valid. From my understanding GOPROXY=direct is simply not reliable enough for go projects with larger dependency trees.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#7 lore raw

James, All,

On 2025-10-20 23:49 -0600, James Hilliard spake thusly:

Quoted 1 line · On Mon, Oct 20, 2025 at 11:36 PM <[email protected]> wrote:

[--SNIP--]

Quoted 4 lines

The issue is that it's expected by upstream go packages that all hashes are for cached goproxy sources, not direct sources. So direct sources breaking wouldn't even be considered an issue by an upstream package as they always use cached sources.

Actually, some do care:

    https://github.com/elastic/beats/issues/36949
Quoted 8 lines
Quoted 4 lines

[--SNIP--]

Quoted 2 lines

FWIW I've overridden it to "direct" in my own Buildroot branch as I still prefer from-Git sources.

Yes, I believe this should be the default.

This will break package downloads, package downloads essentially always work with the caching goproxy because that's what the go ecosystem decided on for their default. Overriding the golang default causes a lot of breakage because of this.

Stating "a lot" is a bit of an exageration: in the many years we have had the go vendoring in Buildroot, tailscale is the first that is reported to be causing an actual issue (I remember some previous issues that were eventually resolved one way or the other, but not by using a proxy).

Speaking of that: do all the go packages we have in Buildroot still download OK with this change and without using s.b.o (and of course without a local dl/)?

[--SNIP--]

Quoted 6 lines
Quoted 3 lines

In the end, it shows that using a goproxy is not a magic bullet to solve vendoring when upstream and the goproxy disagree on the content of a version...

That's not true due to all packages expecting the cached goproxy sources to be valid. From my understanding GOPROXY=direct is simply not reliable enough for go projects with larger dependency trees.

That's unfortunate, and adds a layer of uncertainty in the mix, allowing for supply-chain attacks à-la NPM or PyPi to be made against a goproxy.

Regards,
Yann E. MORIN.

Signature · 23 lines
                                        ____________
.-----------------.--------------------:       _    :------------------.
|  Yann E. MORIN  | Real-Time Embedded |    __/ )   | /"\ ASCII RIBBON |
|                 | Software  Designer |  _/ - /'   | \ / CAMPAIGN     |
| +33 638.411.245 '--------------------: (_    `--, |  X  AGAINST      |
| yann.morin (at) orange.com           |_="    ,--' | / \ HTML MAIL    |
'--------------------------------------:______/_____:------------------'

____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#8 lore raw
Quoted 6 lines · On Tue, Oct 21, 2025 at 12:44 AM <[email protected]> wrote:

James, All,

On 2025-10-20 23:49 -0600, James Hilliard spake thusly:

Quoted 1 line · On Mon, Oct 20, 2025 at 11:36 PM <[email protected]> wrote:

[--SNIP--]

Quoted 8 lines
Quoted 4 lines

The issue is that it's expected by upstream go packages that all hashes are for cached goproxy sources, not direct sources. So direct sources breaking wouldn't even be considered an issue by an upstream package as they always use cached sources.

Actually, some do care:

    https://github.com/elastic/beats/issues/36949

Well yes, that broke because you set GOPROXY=direct, packages in general do not test that configuration at all, they all expect the caching proxy.

Quoted 10 lines
Quoted 9 lines
Quoted 5 lines

[--SNIP--]

Quoted 2 lines

FWIW I've overridden it to "direct" in my own Buildroot branch as I still prefer from-Git sources.

Yes, I believe this should be the default.

This will break package downloads, package downloads essentially always work with the caching goproxy because that's what the go ecosystem decided on for their default. Overriding the golang default causes a lot of breakage because of this.

Quoted 5 lines

Stating "a lot" is a bit of an exageration: in the many years we have had the go vendoring in Buildroot, tailscale is the first that is reported to be causing an actual issue (I remember some previous issues that were eventually resolved one way or the other, but not by using a proxy).

It's not the first, we've had packages blocked from being merged repeatedly due to using a non-standard GOPROXY=direct config, for example netbird is also broken by this config.

Quoted 3 lines

Speaking of that: do all the go packages we have in Buildroot still download OK with this change and without using s.b.o (and of course without a local dl/)?

I didn't notice any with issues, it would be rather surprising if using the caching proxy broke a package since the caching proxy is the default for the golang toolchain, remember nobody uses GOPROXY=direct in practice for upstream go projects.

Quoted 10 lines

[--SNIP--]

Quoted 6 lines
Quoted 3 lines

In the end, it shows that using a goproxy is not a magic bullet to solve vendoring when upstream and the goproxy disagree on the content of a version...

That's not true due to all packages expecting the cached goproxy sources to be valid. From my understanding GOPROXY=direct is simply not reliable enough for go projects with larger dependency trees.

That's unfortunate, and adds a layer of uncertainty in the mix, allowing for supply-chain attacks à-la NPM or PyPi to be made against a goproxy.

It's not an issue, at least it can't really introduce new security issues, we already trust the checksum files for go packages, this merely ensures we have the correct download location for those go package dependencies. All dependencies are hashed so if validation passes then we know we have the expected dependencies regardless of where they were downloaded from. This may be an issue for upstream projects, but it's not an issue for downstream packagers since we trust the upstream sum files for vendoring deps and those sum files are in the package repositories..

Quoted 16 lines

--

                                        ____________
.-----------------.--------------------:       _    :------------------.
|  Yann E. MORIN  | Real-Time Embedded |    __/ )   | /"\ ASCII RIBBON |
|                 | Software  Designer |  _/ - /'   | \ / CAMPAIGN     |
| +33 638.411.245 '--------------------: (_    `--, |  X  AGAINST      |
| yann.morin (at) orange.com           |_="    ,--' | / \ HTML MAIL    |

'--------------------------------------:______/_____:------------------'

____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

Quoted 5 lines

This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you.

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#9 lore raw
In reply to [email protected]
Quoted 9 lines · On Mon, Oct 20, 2025 at 10:34 PM <[email protected]> wrote:

James, All,

On 2025-10-20 16:54 -0600, James Hilliard spake thusly:

Quoted 5 lines

BR2_GOPROXY now configures the Go module proxy URL used to download Go modules specified in project go.mod and go.sum files. By default, it uses Google's official Go module mirror at proxy.golang.org, falling back to direct downloads if the module is not found in the mirror.

Quoted 6 lines
Quoted 4 lines

This change sets the default GOPROXY value to match Go's built-in default of "https://proxy.golang.org,direct" which provides several benefits:

- Avoid package breakages due to missing module sources

How can sources be missing when fetched "direct"ly?

Because non-direct is the golang default and "direct" sources can disappear randomly.

Quoted 2 lines

Do you have a nesxample of a package where this actually fixes the download (barring using s.b.o.) ?

For example the latest tailscale fails without goproxy currently.
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

Quoted 8 lines
Quoted 3 lines

- Better alignment with upstream Go toolchain defaults
- Faster downloads via the proxy compared to direct Git clones
- Maintains reproducible builds through Go's module checksum validation

In the past, we observed the reverse: the goproxy had a stale version that was not matching the upstream one, so when we tried to vendor a package, the hashes would not match. Using "direct" fixed the issue (sorry, I can't remember what package that was...)

Weird, virtually all go projects expect the versions from goproxy in cases where there may be a conflict, I've repeatedly run into this issue, the manifests/hashes in the package checksum files virtually always match goproxy versions and not direct versions.

Quoted 8 lines
Quoted 2 lines

The default value from the toolchain can be read with "go env GOPROXY"

I disagree. The default should be the same as the previous setting, that is "direct". At least in this patch.

If you want to suggest a change of the default, please do that in a separate patch.

So goproxy basically has to be the default, otherwise go package builds relying on goproxy serving stale versions will fail.

Using GOPROXY=direct is kind of a niche use case since the go ecosystem at large expects the caching proxy to be enabled.

I'll split out the GOPROXY default change.

Quoted 70 lines

Regards,
Yann E. MORIN.

Quoted 67 lines

We rely on package developers to audit their dependencies in go.mod and go.sum.

The value can be configured to:
- A comma-separated list of proxy URLs
- "off" to disable all downloads
- "direct" to download directly from source repositories

For more details on Go module proxies:
https://go.dev/ref/mod#module-proxy

Discussion:
https://lore.kernel.org/all/CADvTj4pXO2rwJ8oCzzGNY+OxLuo3uJnDT2PAxbyquw0L6dhfiA@mail.gmail.com/T/#t

---
v1 -> v2:

- added more context and links
- renamed to GOPROXY instead of GOPROXY_LIST
- moved into the !BR2_PRIMARY_SITE_ONLY section

---
 Config.in             | 16 ++++++++++++++++
 package/pkg-golang.mk |  2 +-
 2 files changed, 17 insertions(+), 1 deletion(-)
Config.in +16 -0
index d730f2034b..23717f3f97 100644
@@ -335,6 +335,22 @@ config BR2_LUAROCKS_MIRROR
 
        See http://luarocks.org
 
+config BR2_GOPROXY
+     string "Go module proxy"
+     default "https://proxy.golang.org,direct"
+     depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
+     help
+       The Go module proxy URL used to download Go modules. By
+       default, it uses the official Go module mirror, falling back
+       to direct downloads if the module is not found in the mirror.
+
+       The value can be one of:
+         - Comma-separated list of proxy URLs
+         - "off" to disable all downloads
+         - "direct" to download directly from source repositories
+
+       See https://go.dev/ref/mod#module-proxy
+
 config BR2_CPAN_MIRROR
      string "CPAN mirror (Perl packages)"
      default "https://cpan.metacpan.org"
package/pkg-golang.mk +1 -1
index ffd50adecc..3e388cb257 100644
@@ -101,7 +101,7 @@ $(2)_POST_PATCH_HOOKS += $(2)_GEN_GOMOD
 $(2)_DOWNLOAD_POST_PROCESS = go
 $(2)_DL_ENV += \
      $$(HOST_GO_COMMON_ENV) \
-     GOPROXY=direct \
+     GOPROXY=$$(call qstrip,$$(BR2_GOPROXY)) \
      $$($(2)_GO_ENV)
 
Quoted 8 lines
Quoted 8 lines
package/pkg-golang.mk +0 -1
 # If building in a sub directory, do the vendoring in there
--

2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot