From: Elan Ruusamäe Date: Tue, 7 Sep 2021 06:05:14 +0000 (+0300) Subject: Force -mod=vendor mode X-Git-Tag: auto/th/gitlab-runner-13.12.0-1 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fgitlab-runner.git;a=commitdiff_plain Force -mod=vendor mode The default should be -mod=readonly for go.mod version 1.13 (present in go.mod), but that still ends up making a network connection http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2021-September/026359.html go: cloud.google.com/go/storage at v1.12.0: Get "https://proxy.golang.org/cloud.google.com/go/storage/@v/v1.12.0.mod": dial tcp 142.250.203.209:443: connect: connection refused https://golang.org/ref/mod#build-commands The -mod flag controls whether go.mod may be automatically updated and whether the vendor directory is used. -mod=mod tells the go command to ignore the vendor directory and to automatically update go.mod, for example, when an imported package is not provided by any known module. -mod=readonly tells the go command to ignore the vendor directory and to report an error if go.mod needs to be updated. -mod=vendor tells the go command to use the vendor directory. In this mode, the go command will not use the network or the module cache. By default, if the go version in go.mod is 1.14 or higher and a vendor directory is present, the go command acts as if -mod=vendor were used. Otherwise, the go command acts as if -mod=readonly were used. --- diff --git a/gitlab-runner.spec b/gitlab-runner.spec index 9970bdc..ed46f92 100644 --- a/gitlab-runner.spec +++ b/gitlab-runner.spec @@ -49,7 +49,7 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) # go stuff %define _enable_debug_packages 0 -%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v %{?debug:-x} %{?**}; +%define gobuild(o:) go build -mod=vendor -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v %{?debug:-x} %{?**}; %define import_path gitlab.com/gitlab-org/gitlab-runner %description