Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/pkg-golang.mk: allow packages to override download GOPROXY
@ 2024-07-19  3:05 James Hilliard
  2024-07-19  3:05 ` [Buildroot] [PATCH 2/2] package/tailscale: new package James Hilliard
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: James Hilliard @ 2024-07-19  3:05 UTC (permalink / raw)
  To: buildroot; +Cc: James Hilliard, Anisse Astier, Christian Stewart

Some packages like the upcoming tailscale package need to set GOPROXY
to get the correct dependencies.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 package/pkg-golang.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/pkg-golang.mk b/package/pkg-golang.mk
index 8e27602d41..118908a159 100644
--- a/package/pkg-golang.mk
+++ b/package/pkg-golang.mk
@@ -85,10 +85,12 @@ define $(2)_GEN_GOMOD
 endef
 $(2)_POST_PATCH_HOOKS += $(2)_GEN_GOMOD
 
+$(2)_DL_GOPROXY ?= direct
+
 $(2)_DOWNLOAD_POST_PROCESS = go
 $(2)_DL_ENV += \
 	$$(HOST_GO_COMMON_ENV) \
-	GOPROXY=direct \
+	GOPROXY=$$($(2)_DL_GOPROXY) \
 	$$($(2)_GO_ENV)
 
 # Because we append vendored info, we can't rely on the values being empty
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 2/2] package/tailscale: new package
  2024-07-19  3:05 [Buildroot] [PATCH 1/2] package/pkg-golang.mk: allow packages to override download GOPROXY James Hilliard
@ 2024-07-19  3:05 ` James Hilliard
  2024-07-19  3:26   ` Christian Stewart via buildroot
  2024-07-19  3:26 ` [Buildroot] [PATCH 1/2] package/pkg-golang.mk: allow packages to override download GOPROXY Christian Stewart via buildroot
  2024-08-02 21:39 ` Thomas Petazzoni via buildroot
  2 siblings, 1 reply; 9+ messages in thread
From: James Hilliard @ 2024-07-19  3:05 UTC (permalink / raw)
  To: buildroot; +Cc: James Hilliard, Anisse Astier, Christian Stewart

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 package/Config.in                |  1 +
 package/tailscale/Config.in      |  8 ++++++++
 package/tailscale/tailscale.hash |  3 +++
 package/tailscale/tailscale.mk   | 19 +++++++++++++++++++
 4 files changed, 31 insertions(+)
 create mode 100644 package/tailscale/Config.in
 create mode 100644 package/tailscale/tailscale.hash
 create mode 100644 package/tailscale/tailscale.mk

diff --git a/package/Config.in b/package/Config.in
index f2e10b2b5e..35927bbd94 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2613,6 +2613,7 @@ endif
 	source "package/stunnel/Config.in"
 	source "package/suricata/Config.in"
 	source "package/system-config-printer/Config.in"
+	source "package/tailscale/Config.in"
 	source "package/tcpdump/Config.in"
 	source "package/tcping/Config.in"
 	source "package/tcpreplay/Config.in"
diff --git a/package/tailscale/Config.in b/package/tailscale/Config.in
new file mode 100644
index 0000000000..c81a7134ee
--- /dev/null
+++ b/package/tailscale/Config.in
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_TAILSCALE
+	bool "tailscale"
+	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
+	select BR2_PACKAGE_HOST_GO
+	help
+	  The easiest, most secure way to use WireGuard and 2FA.
+
+	  https://github.com/tailscale/tailscale
diff --git a/package/tailscale/tailscale.hash b/package/tailscale/tailscale.hash
new file mode 100644
index 0000000000..882ff9d5d0
--- /dev/null
+++ b/package/tailscale/tailscale.hash
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  a961aa07a3b0927cd647d6ae69fc212afbbdb0e4c47b8aeb181cb64360b7f143  tailscale-1.70.0-go2.tar.gz
+sha256  d1ee1c7947d4b2c1963ea214d5324f1d4c89f2f1d0f0224889b4dfb868dad725  LICENSE
diff --git a/package/tailscale/tailscale.mk b/package/tailscale/tailscale.mk
new file mode 100644
index 0000000000..49907278ef
--- /dev/null
+++ b/package/tailscale/tailscale.mk
@@ -0,0 +1,19 @@
+################################################################################
+#
+# tailscale
+#
+################################################################################
+
+TAILSCALE_VERSION = 1.70.0
+TAILSCALE_SITE = $(call github,tailscale,tailscale,v$(TAILSCALE_VERSION))
+TAILSCALE_LICENSE = BSD-3-Clause
+TAILSCALE_LICENSE_FILES = LICENSE
+TAILSCALE_GOMOD = tailscale.com
+TAILSCALE_BUILD_TARGETS = cmd/tailscale cmd/tailscaled
+TAILSCALE_INSTALL_BINS = tailscale tailscaled
+TAILSCALE_DL_GOPROXY = https://proxy.golang.org
+TAILSCALE_LDFLAGS = \
+	-X tailscale.com/version.longStamp=$(TAILSCALE_VERSION) \
+	-X tailscale.com/version.shortStamp=$(TAILSCALE_VERSION)
+
+$(eval $(golang-package))
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/pkg-golang.mk: allow packages to override download GOPROXY
  2024-07-19  3:05 [Buildroot] [PATCH 1/2] package/pkg-golang.mk: allow packages to override download GOPROXY James Hilliard
  2024-07-19  3:05 ` [Buildroot] [PATCH 2/2] package/tailscale: new package James Hilliard
@ 2024-07-19  3:26 ` Christian Stewart via buildroot
  2024-07-19  3:37   ` James Hilliard
  2024-08-02 21:39 ` Thomas Petazzoni via buildroot
  2 siblings, 1 reply; 9+ messages in thread
From: Christian Stewart via buildroot @ 2024-07-19  3:26 UTC (permalink / raw)
  To: James Hilliard; +Cc: Anisse Astier, buildroot

Hi James,

On Thu, Jul 18, 2024 at 8:05 PM James Hilliard
<james.hilliard1@gmail.com> wrote:
>
> Some packages like the upcoming tailscale package need to set GOPROXY
> to get the correct dependencies.
>
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>


I am confused, why does the tailscale package need this?

If GOPROXY is set to direct it should go to the go module server.

When I build tailscale from source with GOPROXY=direct it works fine:

git clone https://github.com/tailscale/tailscale
cd tailscale
export GOPROXY=direct
go mod vendor
# works

According to the Go spec, it should always be possible to download
with direct always.

I would strongly recommend not overriding this per-package.

Best regards,
Christian Stewart
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Buildroot] [PATCH 2/2] package/tailscale: new package
  2024-07-19  3:05 ` [Buildroot] [PATCH 2/2] package/tailscale: new package James Hilliard
@ 2024-07-19  3:26   ` Christian Stewart via buildroot
  0 siblings, 0 replies; 9+ messages in thread
From: Christian Stewart via buildroot @ 2024-07-19  3:26 UTC (permalink / raw)
  To: James Hilliard; +Cc: Anisse Astier, buildroot

Hi James,

On Thu, Jul 18, 2024 at 8:05 PM James Hilliard
<james.hilliard1@gmail.com> wrote:
>
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
>  package/Config.in                |  1 +
>  package/tailscale/Config.in      |  8 ++++++++
>  package/tailscale/tailscale.hash |  3 +++
>  package/tailscale/tailscale.mk   | 19 +++++++++++++++++++
>  4 files changed, 31 insertions(+)
>  create mode 100644 package/tailscale/Config.in
>  create mode 100644 package/tailscale/tailscale.hash
>  create mode 100644 package/tailscale/tailscale.mk


Thanks for this pkg. Aside from the GOPROXY note I sent in another
email, looks good.

Best regards,
Christian Stewart
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/pkg-golang.mk: allow packages to override download GOPROXY
  2024-07-19  3:26 ` [Buildroot] [PATCH 1/2] package/pkg-golang.mk: allow packages to override download GOPROXY Christian Stewart via buildroot
@ 2024-07-19  3:37   ` James Hilliard
  2024-07-19  4:23     ` Christian Stewart via buildroot
  0 siblings, 1 reply; 9+ messages in thread
From: James Hilliard @ 2024-07-19  3:37 UTC (permalink / raw)
  To: Christian Stewart; +Cc: Anisse Astier, buildroot

On Thu, Jul 18, 2024 at 9:26 PM Christian Stewart <christian@aperture.us> wrote:
>
> Hi James,
>
> On Thu, Jul 18, 2024 at 8:05 PM James Hilliard
> <james.hilliard1@gmail.com> wrote:
> >
> > Some packages like the upcoming tailscale package need to set GOPROXY
> > to get the correct dependencies.
> >
> > Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
>
>
> I am confused, why does the tailscale package need this?
>
> If GOPROXY is set to direct it should go to the go module server.
>
> When I build tailscale from source with GOPROXY=direct it works fine:
>
> git clone https://github.com/tailscale/tailscale
> cd tailscale
> export GOPROXY=direct
> go mod vendor
> # works

Weird, doesn't work for me, I get:
verifying fybrik.io/crdoc@v0.6.3: checksum mismatch
    downloaded: h1:Awi+v+URtj5DvPr0LLdVrW2Nn9/G1Y7aGpUPG1IATE4=
    go.sum:     h1:jNNAVINu8up5vrLa0jrV7z7HSlyHF/6lNOrAtrXwYlI=

SECURITY ERROR
This download does NOT match an earlier download recorded in go.sum.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.

For more information, see 'go help module-auth'.

>
> According to the Go spec, it should always be possible to download
> with direct always.
>
> I would strongly recommend not overriding this per-package.
>
> Best regards,
> Christian Stewart
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/pkg-golang.mk: allow packages to override download GOPROXY
  2024-07-19  3:37   ` James Hilliard
@ 2024-07-19  4:23     ` Christian Stewart via buildroot
  0 siblings, 0 replies; 9+ messages in thread
From: Christian Stewart via buildroot @ 2024-07-19  4:23 UTC (permalink / raw)
  To: James Hilliard; +Cc: Anisse Astier, buildroot

Hi James,


On Thu, Jul 18, 2024 at 8:37 PM James Hilliard
<james.hilliard1@gmail.com> wrote:
> > git clone https://github.com/tailscale/tailscale
> > cd tailscale
> > export GOPROXY=direct
> > go mod vendor
> > # works
>
> Weird, doesn't work for me, I get:
> verifying fybrik.io/crdoc@v0.6.3: checksum mismatch
>     downloaded: h1:Awi+v+URtj5DvPr0LLdVrW2Nn9/G1Y7aGpUPG1IATE4=
>     go.sum:     h1:jNNAVINu8up5vrLa0jrV7z7HSlyHF/6lNOrAtrXwYlI=
>
> SECURITY ERROR
> This download does NOT match an earlier download recorded in go.sum.
> The bits may have been replaced on the origin server, or an attacker may
> have intercepted the download attempt.
>
> For more information, see 'go help module-auth'.

This is a tailscale bug. Rather than work around this by changing
GOPROXY, we should patch go.sum, OR use a different version for that
dependency.

That dependency can be found here:
https://github.com/fybrik/crdoc/commit/edcf4b04e3c32859db138552b39e93bb56b96046

We can fix this then with a patch to add this line to go.mod:

replace fybrik.io/crdoc => github.com/fybrik/crdoc
edcf4b04e3c32859db138552b39e93bb56b96046 // v0.6.3

I have filed a tailscale bug as well:
https://github.com/tailscale/tailscale/issues/12859

Thanks!
Christian Stewart
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/pkg-golang.mk: allow packages to override download GOPROXY
  2024-07-19  3:05 [Buildroot] [PATCH 1/2] package/pkg-golang.mk: allow packages to override download GOPROXY James Hilliard
  2024-07-19  3:05 ` [Buildroot] [PATCH 2/2] package/tailscale: new package James Hilliard
  2024-07-19  3:26 ` [Buildroot] [PATCH 1/2] package/pkg-golang.mk: allow packages to override download GOPROXY Christian Stewart via buildroot
@ 2024-08-02 21:39 ` Thomas Petazzoni via buildroot
  2024-08-02 21:40   ` Thomas Petazzoni via buildroot
  2 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-02 21:39 UTC (permalink / raw)
  To: James Hilliard; +Cc: Anisse Astier, Christian Stewart, buildroot

On Thu, 18 Jul 2024 21:05:36 -0600
James Hilliard <james.hilliard1@gmail.com> wrote:

> Some packages like the upcoming tailscale package need to set GOPROXY
> to get the correct dependencies.
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
>  package/pkg-golang.mk | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Considering the feedback from Christian on this PATCH 1/2, I have
marked the series as Changes Requested. Could you resend once the
vendoring issue is resolved?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/pkg-golang.mk: allow packages to override download GOPROXY
  2024-08-02 21:39 ` Thomas Petazzoni via buildroot
@ 2024-08-02 21:40   ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-02 21:40 UTC (permalink / raw)
  To: James Hilliard; +Cc: Anisse Astier, Christian Stewart, buildroot

On Fri, 2 Aug 2024 23:39:08 +0200
Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:

> Considering the feedback from Christian on this PATCH 1/2, I have
> marked the series as Changes Requested. Could you resend once the
> vendoring issue is resolved?

Crap, I realized this was v1 (which was still in patchwork), and you
already sent a v2 and v3. So I'll mark the v1 as Superseded instead.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 1/2] package/pkg-golang.mk: allow packages to override download GOPROXY
@ 2024-10-23 17:36 James Hilliard
  0 siblings, 0 replies; 9+ messages in thread
From: James Hilliard @ 2024-10-23 17:36 UTC (permalink / raw)
  To: buildroot; +Cc: Anisse Astier, James Hilliard, Christian Stewart

Some packages like the upcoming netbird package need to set GOPROXY
to get the correct dependencies.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 package/pkg-golang.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/pkg-golang.mk b/package/pkg-golang.mk
index 8e27602d41..118908a159 100644
--- a/package/pkg-golang.mk
+++ b/package/pkg-golang.mk
@@ -85,10 +85,12 @@ define $(2)_GEN_GOMOD
 endef
 $(2)_POST_PATCH_HOOKS += $(2)_GEN_GOMOD
 
+$(2)_DL_GOPROXY ?= direct
+
 $(2)_DOWNLOAD_POST_PROCESS = go
 $(2)_DL_ENV += \
 	$$(HOST_GO_COMMON_ENV) \
-	GOPROXY=direct \
+	GOPROXY=$$($(2)_DL_GOPROXY) \
 	$$($(2)_GO_ENV)
 
 # Because we append vendored info, we can't rely on the values being empty
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-10-23 17:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-19  3:05 [Buildroot] [PATCH 1/2] package/pkg-golang.mk: allow packages to override download GOPROXY James Hilliard
2024-07-19  3:05 ` [Buildroot] [PATCH 2/2] package/tailscale: new package James Hilliard
2024-07-19  3:26   ` Christian Stewart via buildroot
2024-07-19  3:26 ` [Buildroot] [PATCH 1/2] package/pkg-golang.mk: allow packages to override download GOPROXY Christian Stewart via buildroot
2024-07-19  3:37   ` James Hilliard
2024-07-19  4:23     ` Christian Stewart via buildroot
2024-08-02 21:39 ` Thomas Petazzoni via buildroot
2024-08-02 21:40   ` Thomas Petazzoni via buildroot
  -- strict thread matches above, loose matches on Subject: below --
2024-10-23 17:36 James Hilliard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox