Created attachment 227870 [details]
Probably not the right fix, but when FETCH_DEPENDS tries to install go it fails with missing pkg-static. This is a workaround/POC that can be used to make it continue.
Noticed when trying to fetch distfiles for net-mgmt/telegraf in a clean jail since go:modules was added there.
Please reassign, easy fix.
I just tested this on a fresh installation of 12.3-RELEASE. The first thing make does is pull freebsd-pkg-1.17.2_GH0.tar.gz and start building it, so it appears there's not need to add a dependency on pkg.
Perhaps something is missing in jail?
After you remove all packages and remove distfiles, go to net-mgmt/telegraf and type "make fetch". It will only fetch go and build it, but install will fail which in turn leads to not fetching telegraf distfiles because go is needed but cannot be installed.
`make fetch` also starts by fetching freebsd-pkg-1.17.2_GH0.tar.gz on my install. What does `make all-depends-list` say? Is CLEAN_FETCH_ENV defined?
Nice catch, CLEAN_FETCH_ENV use seems to be it dating back to 2016... https://github.com/opnsense/tools/commit/7c007d7bb55
Is this to be considered "working as intended"? I understand the mechanics but seems like it's sabotaging itself then.
I'm not sure why OPNsense insists on having CLEAN_FETCH_ENV set, but it appears to not be compatible with GO_MODULE.
Well the idea is a fetch stage that isn't tainted with package builds at all (could always produce unnecessary errors) but GO_MODULE would leave this concept behind anyway. Stuffing package dependency in there or blocking fetch when CLEAN_FETCH_ENV is set would both be useful changes. What would you prefer?
Blocking fetch with a message that CLEAN_FETCH_ENV is defined seems cleaner to me. I'll look into it, thanks for the report.
Fair enough, thanks for the help. I will revisit CLEAN_FETCH_ENV use locally then.
A commit in branch main references this bug:
Author: Dmitri Goutnik <dmgk@FreeBSD.org>
AuthorDate: 2022-05-13 18:34:15 +0000
Commit: Dmitri Goutnik <dmgk@FreeBSD.org>
CommitDate: 2022-05-13 18:38:01 +0000
Mk/Uses/go.mk: Block modules download when CLEAN_FETCH_ENV is defined
Additionally, stop overriding post-fetch and post-extract targets.
Differential Revision: https://reviews.freebsd.org/D35145
Mk/Uses/go.mk | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)