Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages
@ 2023-04-29  9:16 hazen2215
  2023-04-29  9:18 ` classabbyamp
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: hazen2215 @ 2023-04-29  9:16 UTC (permalink / raw)
  To: ml

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

There is a new pull request by hazen2215 against master on the void-packages repository

https://github.com/hazen2215/void-packages XBPS_GOPROXY
https://github.com/void-linux/void-packages/pull/43668

[RFC] optionally set GOPROXY, GOSUMDB when building go packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!-- #### Testing the changes -->
- I tested the changes in this PR: **YES**|**briefly**|**NO**

This will allow xbps-src to set environment variable `GOPROXY` and `GOSUMDB` when building go packages.
When `GOPROXY` is set to `direct`, it pulls modules from source repositories like github and `git` needs to be in `hostmakedepends`.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43668.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-XBPS_GOPROXY-43668.patch --]
[-- Type: text/x-diff, Size: 2513 bytes --]

From fe5f4dc95fc947ae0119ff7d62058c1341d7db54 Mon Sep 17 00:00:00 2001
From: hazen2215 <haz@disroot.org>
Date: Sat, 29 Apr 2023 17:33:50 +0900
Subject: [PATCH] xbps-src: optionally set GOPROXY, GOSUMDB when building go
 packages.

---
 common/environment/build-style/go.sh |  6 ++++++
 etc/defaults.conf                    | 11 +++++++++++
 xbps-src                             |  2 +-
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/common/environment/build-style/go.sh b/common/environment/build-style/go.sh
index 68f88c6dbee8..be12a172c52c 100644
--- a/common/environment/build-style/go.sh
+++ b/common/environment/build-style/go.sh
@@ -17,6 +17,10 @@ else
 	fi
 fi
 
+if [ "$XBPS_GOPROXY" = direct ]; then
+	hostmakedepends+=" git"
+fi
+
 case "$XBPS_TARGET_MACHINE" in
 	aarch64*) export GOARCH=arm64;;
 	armv5*) export GOARCH=arm; export GOARM=5;;
@@ -39,6 +43,8 @@ export CGO_CXXFLAGS="$CXXFLAGS"
 export CGO_LDFLAGS="$LDFLAGS"
 export CGO_ENABLED="${CGO_ENABLED:-1}"
 export GO111MODULE=auto
+export GOPROXY="$XBPS_GOPROXY"
+export GOSUMDB="$XBPS_GOSUMDB"
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) export GOCACHE="${XBPS_HOSTDIR}/gocache-muslc" ;;
 	*)	export GOCACHE="${XBPS_HOSTDIR}/gocache-glibc" ;;
diff --git a/etc/defaults.conf b/etc/defaults.conf
index f70e4ea3d006..2a8cf14d6ada 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -165,3 +165,14 @@ XBPS_SUCMD="sudo /bin/sh -c"
 # This can also be set or exported as a regular environment variable.
 #
 #XBPS_UPDATE_CHECK_VERBOSE=yes
+
+# [OPTIONAL]
+# Set the environment variable 'GOPROXY' when building go packages.
+# When set to 'direct', will download modules directly from source repositories
+#XBPS_GOPROXY=direct
+
+# [OPTIONAL]
+# Set the environment variable 'GOSUMDB' when building go packages.
+# When set to 'off', will disable querying for module checksum which is
+# undefined in go.sum.
+#XBPS_GOSUMDB=off
diff --git a/xbps-src b/xbps-src
index cdb5f8c6d643..96c7562a5798 100755
--- a/xbps-src
+++ b/xbps-src
@@ -665,7 +665,7 @@ export XBPS_SHUTILSDIR XBPS_CROSSPFDIR XBPS_TRIGGERSDIR \
     XBPS_LIBEXECDIR XBPS_DISTDIR XBPS_DISTFILES_MIRROR XBPS_ALLOW_RESTRICTED \
     XBPS_USE_GIT_COMMIT_DATE XBPS_PKG_COMPTYPE XBPS_REPO_COMPTYPE \
     XBPS_BUILDHELPERDIR XBPS_USE_BUILD_MTIME XBPS_BUILD_ENVIRONMENT \
-    XBPS_PRESERVE_PKGS XBPS_IGNORE_BROKENNESS
+    XBPS_PRESERVE_PKGS XBPS_IGNORE_BROKENNESS XBPS_GOPROXY XBPS_GOSUMDB
 
 for i in REPOSITORY DESTDIR BUILDDIR SRCDISTDIR; do
     eval val="\$XBPS_$i"

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

* Re: [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
@ 2023-04-29  9:18 ` classabbyamp
  2023-04-29  9:21 ` classabbyamp
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-04-29  9:18 UTC (permalink / raw)
  To: ml

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

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/43668#issuecomment-1528729923

Comment:
@the-maldridge 

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

* Re: [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
  2023-04-29  9:18 ` classabbyamp
@ 2023-04-29  9:21 ` classabbyamp
  2023-04-29  9:33 ` [PR PATCH] [Updated] " hazen2215
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-04-29  9:21 UTC (permalink / raw)
  To: ml

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

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/43668#issuecomment-1528729923

Comment:
cc: @the-maldridge 

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

* Re: [PR PATCH] [Updated] [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
  2023-04-29  9:18 ` classabbyamp
  2023-04-29  9:21 ` classabbyamp
@ 2023-04-29  9:33 ` hazen2215
  2023-04-29  9:49 ` hazen2215
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hazen2215 @ 2023-04-29  9:33 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by hazen2215 against master on the void-packages repository

https://github.com/hazen2215/void-packages XBPS_GOPROXY
https://github.com/void-linux/void-packages/pull/43668

[RFC] optionally set GOPROXY, GOSUMDB when building go packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!-- #### Testing the changes -->
- I tested the changes in this PR: **YES**

This will allow xbps-src to set environment variable `GOPROXY` and `GOSUMDB` when building go packages.
When `GOPROXY` is set to `direct`, it pulls modules from source repositories like github and `git` needs to be in `hostmakedepends`.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43668.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-XBPS_GOPROXY-43668.patch --]
[-- Type: text/x-diff, Size: 2523 bytes --]

From b4ad9a99a7b5885cfa9dcd7eff461a33638c8cc4 Mon Sep 17 00:00:00 2001
From: hazen2215 <haz@disroot.org>
Date: Sat, 29 Apr 2023 17:33:50 +0900
Subject: [PATCH] xbps-src: optionally set GOPROXY, GOSUMDB when building go
 packages.

---
 common/environment/build-style/go.sh |  6 ++++++
 etc/defaults.conf                    | 11 +++++++++++
 xbps-src                             |  2 +-
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/common/environment/build-style/go.sh b/common/environment/build-style/go.sh
index 68f88c6dbee8..2773c608d59e 100644
--- a/common/environment/build-style/go.sh
+++ b/common/environment/build-style/go.sh
@@ -17,6 +17,10 @@ else
 	fi
 fi
 
+if [ "$XBPS_GOPROXY" = direct ]; then
+	hostmakedepends+=" git mercurial"
+fi
+
 case "$XBPS_TARGET_MACHINE" in
 	aarch64*) export GOARCH=arm64;;
 	armv5*) export GOARCH=arm; export GOARM=5;;
@@ -39,6 +43,8 @@ export CGO_CXXFLAGS="$CXXFLAGS"
 export CGO_LDFLAGS="$LDFLAGS"
 export CGO_ENABLED="${CGO_ENABLED:-1}"
 export GO111MODULE=auto
+export GOPROXY="$XBPS_GOPROXY"
+export GOSUMDB="$XBPS_GOSUMDB"
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) export GOCACHE="${XBPS_HOSTDIR}/gocache-muslc" ;;
 	*)	export GOCACHE="${XBPS_HOSTDIR}/gocache-glibc" ;;
diff --git a/etc/defaults.conf b/etc/defaults.conf
index f70e4ea3d006..2a8cf14d6ada 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -165,3 +165,14 @@ XBPS_SUCMD="sudo /bin/sh -c"
 # This can also be set or exported as a regular environment variable.
 #
 #XBPS_UPDATE_CHECK_VERBOSE=yes
+
+# [OPTIONAL]
+# Set the environment variable 'GOPROXY' when building go packages.
+# When set to 'direct', will download modules directly from source repositories
+#XBPS_GOPROXY=direct
+
+# [OPTIONAL]
+# Set the environment variable 'GOSUMDB' when building go packages.
+# When set to 'off', will disable querying for module checksum which is
+# undefined in go.sum.
+#XBPS_GOSUMDB=off
diff --git a/xbps-src b/xbps-src
index cdb5f8c6d643..96c7562a5798 100755
--- a/xbps-src
+++ b/xbps-src
@@ -665,7 +665,7 @@ export XBPS_SHUTILSDIR XBPS_CROSSPFDIR XBPS_TRIGGERSDIR \
     XBPS_LIBEXECDIR XBPS_DISTDIR XBPS_DISTFILES_MIRROR XBPS_ALLOW_RESTRICTED \
     XBPS_USE_GIT_COMMIT_DATE XBPS_PKG_COMPTYPE XBPS_REPO_COMPTYPE \
     XBPS_BUILDHELPERDIR XBPS_USE_BUILD_MTIME XBPS_BUILD_ENVIRONMENT \
-    XBPS_PRESERVE_PKGS XBPS_IGNORE_BROKENNESS
+    XBPS_PRESERVE_PKGS XBPS_IGNORE_BROKENNESS XBPS_GOPROXY XBPS_GOSUMDB
 
 for i in REPOSITORY DESTDIR BUILDDIR SRCDISTDIR; do
     eval val="\$XBPS_$i"

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

* Re: [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (2 preceding siblings ...)
  2023-04-29  9:33 ` [PR PATCH] [Updated] " hazen2215
@ 2023-04-29  9:49 ` hazen2215
  2023-04-29  9:49 ` hazen2215
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hazen2215 @ 2023-04-29  9:49 UTC (permalink / raw)
  To: ml

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

New comment by hazen2215 on void-packages repository

https://github.com/void-linux/void-packages/pull/43668#issuecomment-1528738197

Comment:
According to `go help vcs`, go will only use git and mercurial to download code from public servers.

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

* Re: [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (3 preceding siblings ...)
  2023-04-29  9:49 ` hazen2215
@ 2023-04-29  9:49 ` hazen2215
  2023-04-29  9:49 ` hazen2215
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hazen2215 @ 2023-04-29  9:49 UTC (permalink / raw)
  To: ml

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

New comment by hazen2215 on void-packages repository

https://github.com/void-linux/void-packages/pull/43668#issuecomment-1528738275

Comment:
According to `go help vcs`, go will only use git and mercurial to download code from public servers.

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

* Re: [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (4 preceding siblings ...)
  2023-04-29  9:49 ` hazen2215
@ 2023-04-29  9:49 ` hazen2215
  2023-04-29  9:50 ` hazen2215
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hazen2215 @ 2023-04-29  9:49 UTC (permalink / raw)
  To: ml

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

New comment by hazen2215 on void-packages repository

https://github.com/void-linux/void-packages/pull/43668#issuecomment-1528738746

Comment:
According to `go help vcs`, go will only use git and mercurial to download code from public servers.


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

* Re: [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (5 preceding siblings ...)
  2023-04-29  9:49 ` hazen2215
@ 2023-04-29  9:50 ` hazen2215
  2023-04-29  9:50 ` hazen2215
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hazen2215 @ 2023-04-29  9:50 UTC (permalink / raw)
  To: ml

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

New comment by hazen2215 on void-packages repository

https://github.com/void-linux/void-packages/pull/43668#issuecomment-1528738746

Comment:
According to `go help vcs`, go will only use git and mercurial to download code from public servers.


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

* Re: [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (6 preceding siblings ...)
  2023-04-29  9:50 ` hazen2215
@ 2023-04-29  9:50 ` hazen2215
  2023-04-29  9:52 ` hazen2215
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hazen2215 @ 2023-04-29  9:50 UTC (permalink / raw)
  To: ml

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

New comment by hazen2215 on void-packages repository

https://github.com/void-linux/void-packages/pull/43668#issuecomment-1528738275

Comment:
According to `go help vcs`, go will only use git and mercurial to download code from public servers.

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

* Re: [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (7 preceding siblings ...)
  2023-04-29  9:50 ` hazen2215
@ 2023-04-29  9:52 ` hazen2215
  2023-04-29 10:15 ` classabbyamp
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hazen2215 @ 2023-04-29  9:52 UTC (permalink / raw)
  To: ml

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

New comment by hazen2215 on void-packages repository

https://github.com/void-linux/void-packages/pull/43668#issuecomment-1528738197

Comment:
According to `go help vcs`, go will only use git and mercurial to download code from public servers.

edit: spammed comment by accident, sorry


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

* Re: [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (8 preceding siblings ...)
  2023-04-29  9:52 ` hazen2215
@ 2023-04-29 10:15 ` classabbyamp
  2023-04-29 11:03 ` ahesford
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-04-29 10:15 UTC (permalink / raw)
  To: ml

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

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/43668#issuecomment-1528748269

Comment:
what's your use-case for this? 

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

* Re: [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (9 preceding siblings ...)
  2023-04-29 10:15 ` classabbyamp
@ 2023-04-29 11:03 ` ahesford
  2023-04-29 11:07 ` hazen2215
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ahesford @ 2023-04-29 11:03 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/43668#issuecomment-1528759384

Comment:
Adding magic to XBPS really only makes sense if it impacts more than a couple of templates. If you have a template that would benefit from this (and, if so, why isn't it being modified to use these features here?), you might as well just export the variables directly and add the dependencies you require. 

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

* Re: [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (10 preceding siblings ...)
  2023-04-29 11:03 ` ahesford
@ 2023-04-29 11:07 ` hazen2215
  2023-04-29 11:20 ` hazen2215
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hazen2215 @ 2023-04-29 11:07 UTC (permalink / raw)
  To: ml

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

New comment by hazen2215 on void-packages repository

https://github.com/void-linux/void-packages/pull/43668#issuecomment-1528760262

Comment:
I use xbps-src to build a lot of my own local packages because of its advantages (like building on chroot and similarity to BSD ports).
Also I often rebuild packages with custom FLAGS, and when building go package I prefer these varaibles to be set for some reasons like privacy.

Related blog post:
<https://drewdevault.com/2022/05/25/Google-has-been-DDoSing-sourcehut.html>
<https://drewdevault.com/2021/08/06/goproxy-breaks-go.html>


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

* Re: [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (11 preceding siblings ...)
  2023-04-29 11:07 ` hazen2215
@ 2023-04-29 11:20 ` hazen2215
  2023-07-29  1:48 ` github-actions
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hazen2215 @ 2023-04-29 11:20 UTC (permalink / raw)
  To: ml

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

New comment by hazen2215 on void-packages repository

https://github.com/void-linux/void-packages/pull/43668#issuecomment-1528762170

Comment:
> Adding magic to XBPS really only makes sense if it impacts more than a couple of templates. If you have a template that would benefit from this (and, if so, why isn't it being modified to use these features here?), you might as well just export the variables directly and add the dependencies you require.

It impacts when building any go package locally.

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

* Re: [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (12 preceding siblings ...)
  2023-04-29 11:20 ` hazen2215
@ 2023-07-29  1:48 ` github-actions
  2023-07-29  3:22 ` [PR PATCH] [Updated] " hazen2215
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: github-actions @ 2023-07-29  1:48 UTC (permalink / raw)
  To: ml

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

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/43668#issuecomment-1656512401

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

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

* Re: [PR PATCH] [Updated] [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (13 preceding siblings ...)
  2023-07-29  1:48 ` github-actions
@ 2023-07-29  3:22 ` hazen2215
  2023-08-23 22:17 ` hazen2215
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hazen2215 @ 2023-07-29  3:22 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by hazen2215 against master on the void-packages repository

https://github.com/hazen2215/void-packages XBPS_GOPROXY
https://github.com/void-linux/void-packages/pull/43668

[RFC] optionally set GOPROXY, GOSUMDB when building go packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!-- #### Testing the changes -->
- I tested the changes in this PR: **YES**

This will allow xbps-src to set environment variable `GOPROXY` and `GOSUMDB` when building go packages.
When `GOPROXY` is set to `direct`, it pulls modules from source repositories like github and `git` and `mercurial` needs to be in `hostmakedepends`.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43668.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-XBPS_GOPROXY-43668.patch --]
[-- Type: text/x-diff, Size: 2529 bytes --]

From 0e0d82ad265012fd1f9f631318f93cb304303c9b Mon Sep 17 00:00:00 2001
From: hazen2215 <haz@disroot.org>
Date: Sat, 29 Apr 2023 17:33:50 +0900
Subject: [PATCH] xbps-src: optionally set GOPROXY, GOSUMDB when building go
 packages.

---
 common/environment/build-style/go.sh |  6 ++++++
 etc/defaults.conf                    | 11 +++++++++++
 xbps-src                             |  2 +-
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/common/environment/build-style/go.sh b/common/environment/build-style/go.sh
index 68f88c6dbee8f..2773c608d59ec 100644
--- a/common/environment/build-style/go.sh
+++ b/common/environment/build-style/go.sh
@@ -17,6 +17,10 @@ else
 	fi
 fi
 
+if [ "$XBPS_GOPROXY" = direct ]; then
+	hostmakedepends+=" git mercurial"
+fi
+
 case "$XBPS_TARGET_MACHINE" in
 	aarch64*) export GOARCH=arm64;;
 	armv5*) export GOARCH=arm; export GOARM=5;;
@@ -39,6 +43,8 @@ export CGO_CXXFLAGS="$CXXFLAGS"
 export CGO_LDFLAGS="$LDFLAGS"
 export CGO_ENABLED="${CGO_ENABLED:-1}"
 export GO111MODULE=auto
+export GOPROXY="$XBPS_GOPROXY"
+export GOSUMDB="$XBPS_GOSUMDB"
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) export GOCACHE="${XBPS_HOSTDIR}/gocache-muslc" ;;
 	*)	export GOCACHE="${XBPS_HOSTDIR}/gocache-glibc" ;;
diff --git a/etc/defaults.conf b/etc/defaults.conf
index f70e4ea3d0067..2a8cf14d6adac 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -165,3 +165,14 @@ XBPS_SUCMD="sudo /bin/sh -c"
 # This can also be set or exported as a regular environment variable.
 #
 #XBPS_UPDATE_CHECK_VERBOSE=yes
+
+# [OPTIONAL]
+# Set the environment variable 'GOPROXY' when building go packages.
+# When set to 'direct', will download modules directly from source repositories
+#XBPS_GOPROXY=direct
+
+# [OPTIONAL]
+# Set the environment variable 'GOSUMDB' when building go packages.
+# When set to 'off', will disable querying for module checksum which is
+# undefined in go.sum.
+#XBPS_GOSUMDB=off
diff --git a/xbps-src b/xbps-src
index cdb5f8c6d643e..96c7562a57987 100755
--- a/xbps-src
+++ b/xbps-src
@@ -665,7 +665,7 @@ export XBPS_SHUTILSDIR XBPS_CROSSPFDIR XBPS_TRIGGERSDIR \
     XBPS_LIBEXECDIR XBPS_DISTDIR XBPS_DISTFILES_MIRROR XBPS_ALLOW_RESTRICTED \
     XBPS_USE_GIT_COMMIT_DATE XBPS_PKG_COMPTYPE XBPS_REPO_COMPTYPE \
     XBPS_BUILDHELPERDIR XBPS_USE_BUILD_MTIME XBPS_BUILD_ENVIRONMENT \
-    XBPS_PRESERVE_PKGS XBPS_IGNORE_BROKENNESS
+    XBPS_PRESERVE_PKGS XBPS_IGNORE_BROKENNESS XBPS_GOPROXY XBPS_GOSUMDB
 
 for i in REPOSITORY DESTDIR BUILDDIR SRCDISTDIR; do
     eval val="\$XBPS_$i"

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

* Re: [PR PATCH] [Updated] [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (14 preceding siblings ...)
  2023-07-29  3:22 ` [PR PATCH] [Updated] " hazen2215
@ 2023-08-23 22:17 ` hazen2215
  2023-11-22  1:47 ` github-actions
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hazen2215 @ 2023-08-23 22:17 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by hazen2215 against master on the void-packages repository

https://github.com/hazen2215/void-packages XBPS_GOPROXY
https://github.com/void-linux/void-packages/pull/43668

[RFC] optionally set GOPROXY, GOSUMDB when building go packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!-- #### Testing the changes -->
- I tested the changes in this PR: **YES**

This will allow xbps-src to set environment variable `GOPROXY` and `GOSUMDB` when building go packages.
When `GOPROXY` is set to `direct`, it pulls modules from source repositories like github and `git` and `mercurial` needs to be in `hostmakedepends`.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43668.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-XBPS_GOPROXY-43668.patch --]
[-- Type: text/x-diff, Size: 2608 bytes --]

From c6e1bece5e3293023531c7ffa58aebf9795e3417 Mon Sep 17 00:00:00 2001
From: hazen2215 <haz@disroot.org>
Date: Sat, 29 Apr 2023 17:33:50 +0900
Subject: [PATCH] xbps-src: optionally set GOPROXY, GOSUMDB when building go
 packages.

---
 common/environment/build-style/go.sh |  8 ++++++--
 etc/defaults.conf                    | 11 +++++++++++
 xbps-src                             |  2 +-
 3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/common/environment/build-style/go.sh b/common/environment/build-style/go.sh
index 3094555220769..f5b71288fee9e 100644
--- a/common/environment/build-style/go.sh
+++ b/common/environment/build-style/go.sh
@@ -17,6 +17,10 @@ else
 	fi
 fi
 
+if [ "$XBPS_GOPROXY" = direct ]; then
+	hostmakedepends+=" git mercurial"
+fi
+
 case "$XBPS_TARGET_MACHINE" in
 	aarch64*) export GOARCH=arm64;;
 	armv5*) export GOARCH=arm; export GOARM=5;;
@@ -40,8 +44,8 @@ export CGO_LDFLAGS="$LDFLAGS"
 export CGO_ENABLED="${CGO_ENABLED:-1}"
 export GO111MODULE=auto
 export GOTOOLCHAIN=local
-export GOPROXY="https://proxy.golang.org,direct"
-export GOSUMDB="sum.golang.org"
+export GOPROXY="${XBPS_GOPROXY:-https://proxy.golang.org,direct}"
+export GOSUMDB="${XBPS_GOSUMDB:-sum.golang.org}"
 
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) export GOCACHE="${XBPS_HOSTDIR}/gocache-muslc" ;;
diff --git a/etc/defaults.conf b/etc/defaults.conf
index f70e4ea3d0067..2a8cf14d6adac 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -165,3 +165,14 @@ XBPS_SUCMD="sudo /bin/sh -c"
 # This can also be set or exported as a regular environment variable.
 #
 #XBPS_UPDATE_CHECK_VERBOSE=yes
+
+# [OPTIONAL]
+# Set the environment variable 'GOPROXY' when building go packages.
+# When set to 'direct', will download modules directly from source repositories
+#XBPS_GOPROXY=direct
+
+# [OPTIONAL]
+# Set the environment variable 'GOSUMDB' when building go packages.
+# When set to 'off', will disable querying for module checksum which is
+# undefined in go.sum.
+#XBPS_GOSUMDB=off
diff --git a/xbps-src b/xbps-src
index cdb5f8c6d643e..96c7562a57987 100755
--- a/xbps-src
+++ b/xbps-src
@@ -665,7 +665,7 @@ export XBPS_SHUTILSDIR XBPS_CROSSPFDIR XBPS_TRIGGERSDIR \
     XBPS_LIBEXECDIR XBPS_DISTDIR XBPS_DISTFILES_MIRROR XBPS_ALLOW_RESTRICTED \
     XBPS_USE_GIT_COMMIT_DATE XBPS_PKG_COMPTYPE XBPS_REPO_COMPTYPE \
     XBPS_BUILDHELPERDIR XBPS_USE_BUILD_MTIME XBPS_BUILD_ENVIRONMENT \
-    XBPS_PRESERVE_PKGS XBPS_IGNORE_BROKENNESS
+    XBPS_PRESERVE_PKGS XBPS_IGNORE_BROKENNESS XBPS_GOPROXY XBPS_GOSUMDB
 
 for i in REPOSITORY DESTDIR BUILDDIR SRCDISTDIR; do
     eval val="\$XBPS_$i"

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

* Re: [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (15 preceding siblings ...)
  2023-08-23 22:17 ` hazen2215
@ 2023-11-22  1:47 ` github-actions
  2023-11-22  2:47 ` [PR PATCH] [Updated] " hazen2215
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: github-actions @ 2023-11-22  1:47 UTC (permalink / raw)
  To: ml

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

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/43668#issuecomment-1821960586

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

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

* Re: [PR PATCH] [Updated] [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (16 preceding siblings ...)
  2023-11-22  1:47 ` github-actions
@ 2023-11-22  2:47 ` hazen2215
  2024-01-05  1:57 ` hazen2215
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hazen2215 @ 2023-11-22  2:47 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by hazen2215 against master on the void-packages repository

https://github.com/hazen2215/void-packages XBPS_GOPROXY
https://github.com/void-linux/void-packages/pull/43668

[RFC] optionally set GOPROXY, GOSUMDB when building go packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!-- #### Testing the changes -->
- I tested the changes in this PR: **YES**

This will allow xbps-src to set environment variable `GOPROXY` and `GOSUMDB` when building go packages.
When `GOPROXY` is set to `direct`, it pulls modules from source repositories like github and `git` and `mercurial` needs to be in `hostmakedepends`.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43668.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-XBPS_GOPROXY-43668.patch --]
[-- Type: text/x-diff, Size: 2632 bytes --]

From 7b2cbde4e5e2afcf1fc5182896991cb11327e8d4 Mon Sep 17 00:00:00 2001
From: hazen2215 <haz@disroot.org>
Date: Sat, 29 Apr 2023 17:33:50 +0900
Subject: [PATCH] xbps-src: optionally set GOPROXY, GOSUMDB when building go
 packages.

---
 common/environment/build-style/go.sh |  8 ++++++--
 etc/defaults.conf                    | 11 +++++++++++
 xbps-src                             |  2 +-
 3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/common/environment/build-style/go.sh b/common/environment/build-style/go.sh
index 223bba83ff11b4..68ab231920af3c 100644
--- a/common/environment/build-style/go.sh
+++ b/common/environment/build-style/go.sh
@@ -17,6 +17,10 @@ else
 	fi
 fi
 
+if [ "$XBPS_GOPROXY" = direct ]; then
+	hostmakedepends+=" git mercurial"
+fi
+
 case "$XBPS_TARGET_MACHINE" in
 	aarch64*) export GOARCH=arm64;;
 	armv5*) export GOARCH=arm; export GOARM=5;;
@@ -41,8 +45,8 @@ export CGO_LDFLAGS="$LDFLAGS"
 export CGO_ENABLED="${CGO_ENABLED:-1}"
 export GO111MODULE=auto
 export GOTOOLCHAIN="${GOTOOLCHAIN:-local}"
-export GOPROXY="https://proxy.golang.org,direct"
-export GOSUMDB="sum.golang.org"
+export GOPROXY="${XBPS_GOPROXY:-https://proxy.golang.org,direct}"
+export GOSUMDB="${XBPS_GOSUMDB:-sum.golang.org}"
 
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) export GOCACHE="${XBPS_HOSTDIR}/gocache-muslc" ;;
diff --git a/etc/defaults.conf b/etc/defaults.conf
index f70e4ea3d0067e..2a8cf14d6adacf 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -165,3 +165,14 @@ XBPS_SUCMD="sudo /bin/sh -c"
 # This can also be set or exported as a regular environment variable.
 #
 #XBPS_UPDATE_CHECK_VERBOSE=yes
+
+# [OPTIONAL]
+# Set the environment variable 'GOPROXY' when building go packages.
+# When set to 'direct', will download modules directly from source repositories
+#XBPS_GOPROXY=direct
+
+# [OPTIONAL]
+# Set the environment variable 'GOSUMDB' when building go packages.
+# When set to 'off', will disable querying for module checksum which is
+# undefined in go.sum.
+#XBPS_GOSUMDB=off
diff --git a/xbps-src b/xbps-src
index cdb5f8c6d643ed..96c7562a57987e 100755
--- a/xbps-src
+++ b/xbps-src
@@ -665,7 +665,7 @@ export XBPS_SHUTILSDIR XBPS_CROSSPFDIR XBPS_TRIGGERSDIR \
     XBPS_LIBEXECDIR XBPS_DISTDIR XBPS_DISTFILES_MIRROR XBPS_ALLOW_RESTRICTED \
     XBPS_USE_GIT_COMMIT_DATE XBPS_PKG_COMPTYPE XBPS_REPO_COMPTYPE \
     XBPS_BUILDHELPERDIR XBPS_USE_BUILD_MTIME XBPS_BUILD_ENVIRONMENT \
-    XBPS_PRESERVE_PKGS XBPS_IGNORE_BROKENNESS
+    XBPS_PRESERVE_PKGS XBPS_IGNORE_BROKENNESS XBPS_GOPROXY XBPS_GOSUMDB
 
 for i in REPOSITORY DESTDIR BUILDDIR SRCDISTDIR; do
     eval val="\$XBPS_$i"

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

* Re: [PR PATCH] [Updated] [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (17 preceding siblings ...)
  2023-11-22  2:47 ` [PR PATCH] [Updated] " hazen2215
@ 2024-01-05  1:57 ` hazen2215
  2024-04-05  1:45 ` github-actions
  2024-04-05  2:34 ` [PR PATCH] [Updated] " hazen2215
  20 siblings, 0 replies; 22+ messages in thread
From: hazen2215 @ 2024-01-05  1:57 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by hazen2215 against master on the void-packages repository

https://github.com/hazen2215/void-packages XBPS_GOPROXY
https://github.com/void-linux/void-packages/pull/43668

[RFC] optionally set GOPROXY, GOSUMDB when building go packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!-- #### Testing the changes -->
- I tested the changes in this PR: **YES**

This will allow xbps-src to set environment variable `GOPROXY` and `GOSUMDB` when building go packages.
When `GOPROXY` is set to `direct`, it pulls modules from source repositories like github and `git` and `mercurial` needs to be in `hostmakedepends`.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43668.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-XBPS_GOPROXY-43668.patch --]
[-- Type: text/x-diff, Size: 2627 bytes --]

From cd225876d34f65bbd760fb8700903b5cd4e9a840 Mon Sep 17 00:00:00 2001
From: hazen2215 <haz@disroot.org>
Date: Sat, 29 Apr 2023 17:33:50 +0900
Subject: [PATCH] xbps-src: optionally set GOPROXY, GOSUMDB when building go
 packages.

---
 common/environment/build-style/go.sh |  8 ++++++--
 etc/defaults.conf                    | 11 +++++++++++
 xbps-src                             |  2 +-
 3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/common/environment/build-style/go.sh b/common/environment/build-style/go.sh
index 223bba83ff11b..7efc396fff945 100644
--- a/common/environment/build-style/go.sh
+++ b/common/environment/build-style/go.sh
@@ -17,6 +17,10 @@ else
 	fi
 fi
 
+case "$XBPS_GOPROXY" in
+	*direct*) hostmakedepends+=" git mercurial" ;;
+esac
+
 case "$XBPS_TARGET_MACHINE" in
 	aarch64*) export GOARCH=arm64;;
 	armv5*) export GOARCH=arm; export GOARM=5;;
@@ -41,8 +45,8 @@ export CGO_LDFLAGS="$LDFLAGS"
 export CGO_ENABLED="${CGO_ENABLED:-1}"
 export GO111MODULE=auto
 export GOTOOLCHAIN="${GOTOOLCHAIN:-local}"
-export GOPROXY="https://proxy.golang.org,direct"
-export GOSUMDB="sum.golang.org"
+export GOPROXY="${XBPS_GOPROXY:-https://proxy.golang.org,direct}"
+export GOSUMDB="${XBPS_GOSUMDB:-sum.golang.org}"
 
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) export GOCACHE="${XBPS_HOSTDIR}/gocache-muslc" ;;
diff --git a/etc/defaults.conf b/etc/defaults.conf
index f70e4ea3d0067..2a8cf14d6adac 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -165,3 +165,14 @@ XBPS_SUCMD="sudo /bin/sh -c"
 # This can also be set or exported as a regular environment variable.
 #
 #XBPS_UPDATE_CHECK_VERBOSE=yes
+
+# [OPTIONAL]
+# Set the environment variable 'GOPROXY' when building go packages.
+# When set to 'direct', will download modules directly from source repositories
+#XBPS_GOPROXY=direct
+
+# [OPTIONAL]
+# Set the environment variable 'GOSUMDB' when building go packages.
+# When set to 'off', will disable querying for module checksum which is
+# undefined in go.sum.
+#XBPS_GOSUMDB=off
diff --git a/xbps-src b/xbps-src
index cdb5f8c6d643e..96c7562a57987 100755
--- a/xbps-src
+++ b/xbps-src
@@ -665,7 +665,7 @@ export XBPS_SHUTILSDIR XBPS_CROSSPFDIR XBPS_TRIGGERSDIR \
     XBPS_LIBEXECDIR XBPS_DISTDIR XBPS_DISTFILES_MIRROR XBPS_ALLOW_RESTRICTED \
     XBPS_USE_GIT_COMMIT_DATE XBPS_PKG_COMPTYPE XBPS_REPO_COMPTYPE \
     XBPS_BUILDHELPERDIR XBPS_USE_BUILD_MTIME XBPS_BUILD_ENVIRONMENT \
-    XBPS_PRESERVE_PKGS XBPS_IGNORE_BROKENNESS
+    XBPS_PRESERVE_PKGS XBPS_IGNORE_BROKENNESS XBPS_GOPROXY XBPS_GOSUMDB
 
 for i in REPOSITORY DESTDIR BUILDDIR SRCDISTDIR; do
     eval val="\$XBPS_$i"

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

* Re: [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (18 preceding siblings ...)
  2024-01-05  1:57 ` hazen2215
@ 2024-04-05  1:45 ` github-actions
  2024-04-05  2:34 ` [PR PATCH] [Updated] " hazen2215
  20 siblings, 0 replies; 22+ messages in thread
From: github-actions @ 2024-04-05  1:45 UTC (permalink / raw)
  To: ml

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

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/43668#issuecomment-2038602588

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

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

* Re: [PR PATCH] [Updated] [RFC] optionally set GOPROXY, GOSUMDB when building go packages
  2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
                   ` (19 preceding siblings ...)
  2024-04-05  1:45 ` github-actions
@ 2024-04-05  2:34 ` hazen2215
  20 siblings, 0 replies; 22+ messages in thread
From: hazen2215 @ 2024-04-05  2:34 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by hazen2215 against master on the void-packages repository

https://github.com/hazen2215/void-packages XBPS_GOPROXY
https://github.com/void-linux/void-packages/pull/43668

[RFC] optionally set GOPROXY, GOSUMDB when building go packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

<!-- #### Testing the changes -->
- I tested the changes in this PR: **YES**

This will allow xbps-src to set environment variable `GOPROXY` and `GOSUMDB` when building go packages.
When `GOPROXY` is set to `direct`, it pulls modules from source repositories like github and `git` and `mercurial` needs to be in `hostmakedepends`.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43668.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-XBPS_GOPROXY-43668.patch --]
[-- Type: text/x-diff, Size: 2633 bytes --]

From 53730eed4f710a87877ca925f4af1f175ba5f5c6 Mon Sep 17 00:00:00 2001
From: hazen2215 <haz@disroot.org>
Date: Sat, 29 Apr 2023 17:33:50 +0900
Subject: [PATCH] xbps-src: optionally set GOPROXY, GOSUMDB when building go
 packages.

---
 common/environment/build-style/go.sh |  8 ++++++--
 etc/defaults.conf                    | 11 +++++++++++
 xbps-src                             |  2 +-
 3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/common/environment/build-style/go.sh b/common/environment/build-style/go.sh
index 223bba83ff11b4..7efc396fff9454 100644
--- a/common/environment/build-style/go.sh
+++ b/common/environment/build-style/go.sh
@@ -17,6 +17,10 @@ else
 	fi
 fi
 
+case "$XBPS_GOPROXY" in
+	*direct*) hostmakedepends+=" git mercurial" ;;
+esac
+
 case "$XBPS_TARGET_MACHINE" in
 	aarch64*) export GOARCH=arm64;;
 	armv5*) export GOARCH=arm; export GOARM=5;;
@@ -41,8 +45,8 @@ export CGO_LDFLAGS="$LDFLAGS"
 export CGO_ENABLED="${CGO_ENABLED:-1}"
 export GO111MODULE=auto
 export GOTOOLCHAIN="${GOTOOLCHAIN:-local}"
-export GOPROXY="https://proxy.golang.org,direct"
-export GOSUMDB="sum.golang.org"
+export GOPROXY="${XBPS_GOPROXY:-https://proxy.golang.org,direct}"
+export GOSUMDB="${XBPS_GOSUMDB:-sum.golang.org}"
 
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) export GOCACHE="${XBPS_HOSTDIR}/gocache-muslc" ;;
diff --git a/etc/defaults.conf b/etc/defaults.conf
index f70e4ea3d0067e..2a8cf14d6adacf 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -165,3 +165,14 @@ XBPS_SUCMD="sudo /bin/sh -c"
 # This can also be set or exported as a regular environment variable.
 #
 #XBPS_UPDATE_CHECK_VERBOSE=yes
+
+# [OPTIONAL]
+# Set the environment variable 'GOPROXY' when building go packages.
+# When set to 'direct', will download modules directly from source repositories
+#XBPS_GOPROXY=direct
+
+# [OPTIONAL]
+# Set the environment variable 'GOSUMDB' when building go packages.
+# When set to 'off', will disable querying for module checksum which is
+# undefined in go.sum.
+#XBPS_GOSUMDB=off
diff --git a/xbps-src b/xbps-src
index 97ca0bc5564523..f0d4dc31f2fe42 100755
--- a/xbps-src
+++ b/xbps-src
@@ -692,7 +692,7 @@ export XBPS_SHUTILSDIR XBPS_CROSSPFDIR XBPS_TRIGGERSDIR \
     XBPS_LIBEXECDIR XBPS_DISTDIR XBPS_DISTFILES_MIRROR XBPS_ALLOW_RESTRICTED \
     XBPS_USE_GIT_COMMIT_DATE XBPS_PKG_COMPTYPE XBPS_REPO_COMPTYPE \
     XBPS_BUILDHELPERDIR XBPS_USE_BUILD_MTIME XBPS_BUILD_ENVIRONMENT \
-    XBPS_PRESERVE_PKGS XBPS_IGNORE_BROKENNESS
+    XBPS_PRESERVE_PKGS XBPS_IGNORE_BROKENNESS XBPS_GOPROXY XBPS_GOSUMDB
 
 for i in REPOSITORY DESTDIR BUILDDIR SRCDISTDIR; do
     eval val="\$XBPS_$i"

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

end of thread, other threads:[~2024-04-05  2:34 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-29  9:16 [PR PATCH] [RFC] optionally set GOPROXY, GOSUMDB when building go packages hazen2215
2023-04-29  9:18 ` classabbyamp
2023-04-29  9:21 ` classabbyamp
2023-04-29  9:33 ` [PR PATCH] [Updated] " hazen2215
2023-04-29  9:49 ` hazen2215
2023-04-29  9:49 ` hazen2215
2023-04-29  9:49 ` hazen2215
2023-04-29  9:50 ` hazen2215
2023-04-29  9:50 ` hazen2215
2023-04-29  9:52 ` hazen2215
2023-04-29 10:15 ` classabbyamp
2023-04-29 11:03 ` ahesford
2023-04-29 11:07 ` hazen2215
2023-04-29 11:20 ` hazen2215
2023-07-29  1:48 ` github-actions
2023-07-29  3:22 ` [PR PATCH] [Updated] " hazen2215
2023-08-23 22:17 ` hazen2215
2023-11-22  1:47 ` github-actions
2023-11-22  2:47 ` [PR PATCH] [Updated] " hazen2215
2024-01-05  1:57 ` hazen2215
2024-04-05  1:45 ` github-actions
2024-04-05  2:34 ` [PR PATCH] [Updated] " hazen2215

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).