Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Apr 2020 17:29:18 +0000 (UTC)
From:      Dmitri Goutnik <dmgk@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r530387 - in head/lang/go: . files
Message-ID:  <202004021729.032HTIru044534@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dmgk
Date: Thu Apr  2 17:29:17 2020
New Revision: 530387
URL: https://svnweb.freebsd.org/changeset/ports/530387

Log:
  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)
  MFH:		2020Q2
  Differential Revision:	https://reviews.freebsd.org/D24122

Added:
  head/lang/go/files/
  head/lang/go/files/patch-src_cmd_go_internal_modload_init.go   (contents, props changed)
Modified:
  head/lang/go/Makefile

Modified: head/lang/go/Makefile
==============================================================================
--- head/lang/go/Makefile	Thu Apr  2 16:53:50 2020	(r530386)
+++ head/lang/go/Makefile	Thu Apr  2 17:29:17 2020	(r530387)
@@ -3,6 +3,7 @@
 
 PORTNAME=	go
 PORTVERSION=	1.14.1
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	lang
 MASTER_SITES=	https://golang.org/dl/ \

Added: head/lang/go/files/patch-src_cmd_go_internal_modload_init.go
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/go/files/patch-src_cmd_go_internal_modload_init.go	Thu Apr  2 17:29:17 2020	(r530387)
@@ -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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004021729.032HTIru044534>