about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/go/go_no_vendor_checks-1_14.patch
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-02-16 18:32:21 +0000
committerAlyssa Ross <hi@alyssa.is>2021-02-16 18:32:21 +0000
commit9becdcc5df71b47a5da84ad670e9a7eae9e0c65a (patch)
tree2ddf0335eb393f89501e3753b50c3f7ab0552d12 /nixpkgs/pkgs/development/compilers/go/go_no_vendor_checks-1_14.patch
parent49f2a77ac9abc88c253f68952eda26557fc3b555 (diff)
parentff96a0fa5635770390b184ae74debea75c3fd534 (diff)
downloadnixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.gz
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.bz2
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.lz
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.xz
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.zst
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.zip
nixpkgs: merge nixos-unstable
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/go/go_no_vendor_checks-1_14.patch')
-rw-r--r--nixpkgs/pkgs/development/compilers/go/go_no_vendor_checks-1_14.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/compilers/go/go_no_vendor_checks-1_14.patch b/nixpkgs/pkgs/development/compilers/go/go_no_vendor_checks-1_14.patch
new file mode 100644
index 000000000000..53e4ba78ff18
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/go/go_no_vendor_checks-1_14.patch
@@ -0,0 +1,23 @@
+Starting from go1.14, go verifes 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 regardless of go version requirement in go.mod.
+
+This has been ported from FreeBSD: https://reviews.freebsd.org/D24122
+See https://github.com/golang/go/issues/37948 for discussion.
+
+diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go
+index 71f68efbcc..3c566d04dd 100644
+--- a/src/cmd/go/internal/modload/init.go
++++ b/src/cmd/go/internal/modload/init.go
+@@ -133,7 +133,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.