[packages/gitlab-runner/dev-13.12] Force -mod=vendor mode

glen glen at pld-linux.org
Tue Sep 7 08:09:59 CEST 2021


commit 19c2ece1b357713056e21c35eb9c44acffa056df
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Tue Sep 7 09:05:14 2021 +0300

    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.

 gitlab-runner.spec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
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
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gitlab-runner.git/commitdiff/19c2ece1b357713056e21c35eb9c44acffa056df



More information about the pld-cvs-commit mailing list