________________________________________
From: Michael Ströder
On Fri, Jan 15, 2021 at 2:24 PM Michael Ströder
wrote: But how does OBS get the Go modules, if not via proxy? AFAIK OBS has only *very* limited access to the outside.
It doesn't get them at all. There is no access to the outside in the OBS build environment.
You need to generate a vendor tarball and add it as a source.
Hello Michael, Yes, OBS is a fully offline environment and go tools assume online access, defaulting to the community proxy. The OBS source service obs-service-go_modules [1] installed locally will automate the process for offline use. The hugo package [2] provides a _service and RPM .spec usage example. As of go1.14+, go build mode "-mod=vendor" is set automatically when directory /vendor is detected. Network access is not attempted in this mode. For additional control the GOPROXY=off environment variable is available [3] to ensure go commands in module mode are disallowed from using the network for dependencies. I would recommend not setting GOPROXY as the default behavior is sufficient, and please let me know if you do encounter network access attempts when using the defaults. Jeff [1] https://github.com/openSUSE/obs-service-go_modules [2] https://build.opensuse.org/package/show/devel:languages:go/hugo [3] https://github.com/thepudds/go-module-knobs/blob/master/README.md#list-of-go... -- Jeff Kowalczyk Software Engineer, Go Developer Experience SUSE Linux Email jkowalczyk@suse.com Timezone US/Pacific http://suse.com