Ff the source repo has a go.mod file containing: go 1.14 There will be lots of errors because go 1.14 does more strict version checking Sample errors: golang.org/x/crypto@v0.0.0-20200311171314-f7b00557c8c4: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt golang.org/x/sync@v0.0.0-20190423024810-112230192c58: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt golang.org/x/time@v0.0.0-20191024005414-555d28b269f0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt run 'go mod vendor' to sync, or use -mod=mod or -mod=readonly to ignore the vendor directory *** Error code 1 A workaround is to add a files/patch-go.mod changing the 1.14 to 1.13 to restore the earlier go behaviour.
Thank you for your report Christopher Can you provide an example list of ports that are affected?
currently only affects mine, I was just trying test build it before I created a review to upgrade it. So I do not think this affect any of the current go ports as they are all likely to be cointain "go 1.13" in their mod files
you can see the WIP version here: https://github.com/bitmark-inc/bitmarkd-ports/tree/master/FreeBSD/net-p2p/bitmark This built because this version patches the go.mod. So "rm files/patch-go.mod" should give you the same build errors I have with go-1.14_1,1
This looks like it could be a serious issue as more upstreams will be updating go.mod to require go1.14: "When -mod=vendor is set (explicitly or by default), the go command now verifies that the main module's vendor/modules.txt file is consistent with its go.mod file." [1] Because -mod=vendor is the only mode that works for ports due to restricted network access and there's no way to generate vendor/modules.txt during port build, the options we have seem to be (a) keep generated vendor/modules.txt in files/ and copy it over to ${WRKSRC}/vendor before build (b) patch go.mod go version back to 1.13 (probably could be automated with go.mk) (c) patch lang/go [2] to skip these consistency checks [1] https://golang.org/doc/go1.14#go-command [2] https://github.com/golang/go/blob/9d67a94217c0a46a2b02a1fc67bb3e436dac0c97/src/cmd/go/internal/modload/vendor.go#L135
https://github.com/golang/go/issues/37948 https://reviews.freebsd.org/D24122
A commit references this bug: Author: dmgk Date: Thu Apr 2 17:29:18 UTC 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 Changes: head/lang/go/Makefile head/lang/go/files/ head/lang/go/files/patch-src_cmd_go_internal_modload_init.go
A commit references this bug: Author: dmgk Date: Thu Apr 2 17:39:15 UTC 2020 New revision: 530388 URL: https://svnweb.freebsd.org/changeset/ports/530388 Log: Mk/Uses/go.mk: Set GO_NO_VENDOR_CHECKS=1 Set GO_NO_VENDOR_CHECKS=1 to signal lang/go to relax vendor checks during ports build. PR: 244783 Reported by: Christopher Hall <hsw@bitmark.com> Reviewed by: mikael swills yuri MFH: 2020Q2 Differential Revision: https://reviews.freebsd.org/D24122 Changes: head/Mk/Uses/go.mk
A commit references this bug: Author: dmgk Date: Fri Apr 3 12:51:25 UTC 2020 New revision: 530488 URL: https://svnweb.freebsd.org/changeset/ports/530488 Log: 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) Changes: _U branches/2020Q2/ branches/2020Q2/lang/go/Makefile branches/2020Q2/lang/go/files/
A commit references this bug: Author: dmgk Date: Fri Apr 3 12:53:12 UTC 2020 New revision: 530489 URL: https://svnweb.freebsd.org/changeset/ports/530489 Log: MFH: r530388 Mk/Uses/go.mk: Set GO_NO_VENDOR_CHECKS=1 Set GO_NO_VENDOR_CHECKS=1 to signal lang/go to relax vendor checks during ports build. PR: 244783 Reported by: Christopher Hall <hsw@bitmark.com> Reviewed by: mikael swills yuri Differential Revision: https://reviews.freebsd.org/D24122 Approved by: ports-secteam (joneum) Changes: _U branches/2020Q2/ branches/2020Q2/Mk/Uses/go.mk