diff options
author | Dmitri Goutnik <dmgk@FreeBSD.org> | 2020-04-03 12:51:25 +0000 |
---|---|---|
committer | Dmitri Goutnik <dmgk@FreeBSD.org> | 2020-04-03 12:51:25 +0000 |
commit | 060b4585d5f380502b86db09fdf2c3b141400843 (patch) | |
tree | 5fb7671faffdf43939dc5ff11268ba40177435fd /lang | |
parent | 4d048e6bc7519031472abd16ae39262f6225131c (diff) | |
download | ports-060b4585d5f380502b86db09fdf2c3b141400843.tar.gz ports-060b4585d5f380502b86db09fdf2c3b141400843.zip |
MFH: r530387
lang/go: relax module consistency checks if vendor/modules.txt is missing
Starting from go1.14, go verifies that vendor/modules.txt matches the
requirements and replacements listed in the main module go.mod file, and it is
a hard failure if vendor/modules.txt is missing.
Relax module consistency checks and switch back to pre go1.14 behaviour if
vendor/modules.txt is missing and GO_NO_VENDOR_CHECKS=1 is set in the
environment regardless of go version requirement in go.mod.
Upstream PR: https://github.com/golang/go/issues/37948
PR: 244783
Reported by: Christopher Hall <hsw@bitmark.com>
Reviewed by: mikael swills yuri
Approved by: jlaffaye (maintainer timeout, 2 weeks)
Differential Revision: https://reviews.freebsd.org/D24122
Approved by: ports-secteam (joneum)
Notes
Notes:
svn path=/branches/2020Q2/; revision=530488
Diffstat (limited to 'lang')
-rw-r--r-- | lang/go/Makefile | 1 | ||||
-rw-r--r-- | lang/go/files/patch-src_cmd_go_internal_modload_init.go | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/lang/go/Makefile b/lang/go/Makefile index b7091e059f2c..3f6e297d095d 100644 --- a/lang/go/Makefile +++ b/lang/go/Makefile @@ -3,6 +3,7 @@ PORTNAME= go PORTVERSION= 1.14.1 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= lang MASTER_SITES= https://golang.org/dl/ \ diff --git a/lang/go/files/patch-src_cmd_go_internal_modload_init.go b/lang/go/files/patch-src_cmd_go_internal_modload_init.go new file mode 100644 index 000000000000..f9042fa87bff --- /dev/null +++ b/lang/go/files/patch-src_cmd_go_internal_modload_init.go @@ -0,0 +1,12 @@ +Upstream PR: https://github.com/golang/go/issues/37948 +--- src/cmd/go/internal/modload/init.go.orig 2020-02-25 18:32:50 UTC ++++ src/cmd/go/internal/modload/init.go +@@ -562,7 +562,7 @@ func checkVendorConsistency() { + readVendorList() + + pre114 := false +- if modFile.Go == nil || semver.Compare("v"+modFile.Go.Version, "v1.14") < 0 { ++ if modFile.Go == nil || semver.Compare("v"+modFile.Go.Version, "v1.14") < 0 || (os.Getenv("GO_NO_VENDOR_CHECKS") == "1" && len(vendorMeta) == 0) { + // Go versions before 1.14 did not include enough information in + // vendor/modules.txt to check for consistency. + // If we know that we're on an earlier version, relax the consistency check. |