Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build errors using Go 1.13 #659

Closed
bvwells opened this issue Sep 4, 2019 · 27 comments
Closed

Build errors using Go 1.13 #659

bvwells opened this issue Sep 4, 2019 · 27 comments
Labels
bug Something isn't working

Comments

@bvwells
Copy link
Contributor

bvwells commented Sep 4, 2019

I'm currently getting build errors (master branch) trying to build golangci-lint with Go 1.13.

The build error is:
go: github.com/golangci/bodyclose@v0.0.0-20190713050349-65da19158fa2: invalid pseudo-version: does not match version-control timestamp (2019-07-14T14:40:26Z)

Here are a few details of my go env:
GOARCH=amd64
GOOS=windows

Let me know if you need any more details to reproduce.

The reason I came across this is that go get with go 1.13 returns the errors below and I thought I'd try to use a locally build version of golangci-lint.

go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
verifying github.com/golangci/ineffassign@v0.0.0-20180808204949-42439a7714cc/go.mod: github.com/golangci/ineffassign@v0.0.0-20180808204949-42439a7714cc/go.mod: reading https://sum.golang.org/lookup/github.com/golangci/ineffassign@v0.0.0-20180808204949-42439a7714cc: 410 Gone
verifying github.com/go-critic/go-critic@v0.0.0-20181204210945-1df300866540/go.mod: github.com/go-critic/go-critic@v0.0.0-20181204210945-1df300866540/go.mod: reading https://sum.golang.org/lookup/github.com/go-critic/go-critic@v0.0.0-20181204210945-1df300866540: 410 Gone

@panchoh
Copy link

panchoh commented Sep 4, 2019

Same issue here, on archlinux, when building v1.17.1.
master builds OK, though.

$ GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.17.1
go: finding github.com v1.17.1
go: finding github.com/golangci/golangci-lint/cmd v1.17.1
go: finding github.com/golangci v1.17.1
go: finding github.com/golangci/golangci-lint/cmd/golangci-lint v1.17.1
go get: github.com/golangci/golangci-lint@v1.17.1 requires
	github.com/go-critic/go-critic@v0.0.0-20181204210945-1df300866540: invalid pseudo-version: does not match version-control timestamp (2019-05-26T07:48:19Z)

@brunetto
Copy link

brunetto commented Sep 4, 2019

Master branch doesn't build for me with go1.13 (on mac)

$ go version
go version go1.13 darwin/amd64
$ git clone git@github.com:golangci/golangci-lint.git
$ cd golangci-lint/cmd/golangci-lint
$ go build
go: github.com/go-critic/go-critic@v0.0.0-20181204210945-1df300866540: invalid pseudo-version: does not match version-control timestamp (2019-05-26T07:48:19Z)

@lunemec
Copy link

lunemec commented Sep 4, 2019

There were changes in go.mod, try running go mod tidy and also setting go version to 1.13 with go mod edit -go=1.13.

@brunetto
Copy link

brunetto commented Sep 4, 2019

Doesn't seems to work either...

$ go mod tidy
go: github.com/go-critic/go-critic@v0.0.0-20181204210945-1df300866540: invalid pseudo-version: does not match version-control timestamp (2019-05-26T07:48:19Z)

$ go mod edit -go=1.13

$ go mod tidy
go: github.com/go-critic/go-critic@v0.0.0-20181204210945-1df300866540: invalid pseudo-version: does not match version-control timestamp (2019-05-26T07:48:19Z)

$ go build
go: github.com/go-critic/go-critic@v0.0.0-20181204210945-1df300866540: invalid pseudo-version: does not match version-control timestamp (2019-05-26T07:48:19Z)

@lwaddicor
Copy link

lwaddicor commented Sep 4, 2019

I'm getting the same thing

Go build gives me the same thing:
$ go build
go: github.com/go-critic/go-critic@v0.0.0-20181204210945-1df300866540: invalid pseudo-version: does not match version-control timestamp (2019-05-26T07:48:19Z)



Go mod tidy gives this:
$ go mod tidy
go: github.com/golangci/bodyclose@v0.0.0-20190713050349-65da19158fa2: invalid pseudo-version: does not match version-control timestamp (2019-07-14T14:40:26Z)

@brunetto
Copy link

brunetto commented Sep 4, 2019

Ok, I've been able to have the master building recreating the go.mod.

A better (less lazy) way is to look here c3a532e

@thepudds
Copy link

thepudds commented Sep 4, 2019

If we follow the advice from the section of the Go 1.13 release notes on resolving invalid pseudo-version errors (https://golang.org/doc/go1.13#version-validation), we can make the go get work for v1.17.1:

   # first, setup from scratch

   export GOPATH=$(mktemp -d)               # using fresh module cache
   cd $(mktemp -d)                   
   go mod init example.com/tempmod

   # second, create 'replace' statements using *just* the commit hashes 
   # for each problematic module on the right-hand side

   echo 'replace github.com/go-critic/go-critic v0.0.0-20181204210945-1df300866540 => github.com/go-critic/go-critic 1df300866540' >> go.mod
   echo 'replace github.com/golangci/errcheck v0.0.0-20181003203344-ef45e06d44b6 => github.com/golangci/errcheck ef45e06d44b6' >> go.mod
   echo 'replace github.com/golangci/go-tools v0.0.0-20180109140146-af6baa5dc196 => github.com/golangci/go-tools af6baa5dc196' >> go.mod
   echo 'replace github.com/golangci/gofmt v0.0.0-20181105071733-0b8337e80d98 => github.com/golangci/gofmt 0b8337e80d98' >> go.mod
   echo 'replace github.com/golangci/gosec v0.0.0-20180901114220-66fb7fc33547 => github.com/golangci/gosec 66fb7fc33547' >> go.mod
   echo 'replace github.com/golangci/ineffassign v0.0.0-20180808204949-42439a7714cc => github.com/golangci/ineffassign 42439a7714cc' >> go.mod
   echo 'replace github.com/golangci/lint-1 v0.0.0-20180610141402-ee948d087217 => github.com/golangci/lint-1 ee948d087217' >> go.mod
   echo 'replace mvdan.cc/unparam v0.0.0-20190124213536-fbb59629db34 => mvdan.cc/unparam fbb59629db34' >> go.mod

This now works:

   go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.17.1

@bcmills
Copy link

bcmills commented Sep 4, 2019

Duplicate of #652

@powerman
Copy link

powerman commented Sep 5, 2019

Another way to install 1.17.1, with working --version flag like in released binaries:

GO111MODULE=off go get -d github.com/golangci/golangci-lint/cmd/golangci-lint
cd $(go env GOPATH)/src/github.com/golangci/golangci-lint
git checkout v1.17.1
go install -ldflags "-s -w -X main.version=1.17.1 -X main.commit=4ba2155 -X main.date=2019-06-10T09:06:49Z" ./cmd/golangci-lint

@pierrre
Copy link
Contributor

pierrre commented Sep 9, 2019

this should be fixed, because #605 has been merged

@zikaeroh
Copy link

zikaeroh commented Sep 9, 2019

Not sure about that, given all of the invalid versions via the commits that prevent it from tidying:

go: github.com/golangci/errcheck@v0.0.0-20181003203344-ef45e06d44b6: invalid pseudo-version: does not match version-control timestamp (2018-12-23T08:41:20Z)

Most likely going to be really fixed in #670 once the CI failures show that the versions need to be regenerated, like:

diff --git a/go.mod b/go.mod
index aa462b3..0ef957e 100644
--- a/go.mod
+++ b/go.mod
@@ -14,17 +14,17 @@ require (
 	github.com/golang/mock v1.0.0
 	github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2
 	github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a
-	github.com/golangci/errcheck v0.0.0-20181003203344-ef45e06d44b6
+	github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6
 	github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613
 	github.com/golangci/go-tools v0.0.0-20190318055746-e32c54105b7c
 	github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3
 	github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee
 	github.com/golangci/gofmt v0.0.0-20181222123516-0b8337e80d98
-	github.com/golangci/gosec v0.0.0-20180901114220-66fb7fc33547
+	github.com/golangci/gosec v0.0.0-20190211064107-66fb7fc33547
 	github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc
-	github.com/golangci/lint-1 v0.0.0-20180610141402-ee948d087217
+	github.com/golangci/lint-1 v0.0.0-20190420132249-ee948d087217
 	github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca
-	github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770
+	github.com/golangci/misspell v0.3.5-0.20180809174111-950f5d19e770
 	github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21
 	github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0
 	github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4
@@ -51,7 +51,7 @@ require (
 	github.com/spf13/pflag v1.0.1
 	github.com/spf13/viper v1.0.2
 	github.com/stretchr/testify v1.2.2
-	github.com/timakin/bodyclose v0.0.0-00010101000000-87058b9bfcec
+	github.com/timakin/bodyclose v0.0.0-20190721030226-87058b9bfcec
 	github.com/ultraware/funlen v0.0.1
 	github.com/valyala/quicktemplate v1.1.1
 	golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a // indirect
@@ -62,8 +62,8 @@ require (
 	gopkg.in/yaml.v2 v2.2.1
 	mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed
 	mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect
-	mvdan.cc/unparam v0.0.0-20190124213536-fbb59629db34
+	mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34
 )
 
 // https://github.com/golang/tools/pull/139
-replace golang.org/x/tools => github.com/golangci/tools v0.0.0-20190713050349-979bdb7f8cc8
+replace golang.org/x/tools => github.com/golangci/tools v0.0.0-20190909104219-979bdb7f8cc8

@jirfag
Copy link
Member

jirfag commented Sep 10, 2019

Hi!
Now GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@95d5b2c works. And today-tomorrow I will make a new release.

@jirfag
Copy link
Member

jirfag commented Sep 10, 2019

I've published the 1.18.0 release. Please, check that everything works

@joeblubaugh
Copy link

Unfortunately we're not seeing any changes in our linting - typecheck is still failing on DecodeRune, DecodeRuneInString, ValidString

@jirfag
Copy link
Member

jirfag commented Sep 10, 2019

@joeblubaugh can you provide more details on how to reproduce it, please?

@guiguan
Copy link

guiguan commented Sep 11, 2019

I got the same error and figured out that's because go 1.13 is validating downloaded modules, regardless of source, against the public Go checksum database at sum.golang.org (https://golang.org/cmd/go/#hdr-Module_configuration_for_non_public_modules). So it happens for modules in private repos. To solve this, I used GOPRIVATE="github.com/YourOrganizationName" go get .... You can also change the default setting using:

go env -w GOPRIVATE="github.com/YourOrganizationName"

@thepudds
Copy link

@guiguan what was the exact error you were seeing before you made that configuration change with GOPRIVATE?

@guiguan
Copy link

guiguan commented Sep 11, 2019

@thepudds yes, that 410 Gone error

@jirfag
Copy link
Member

jirfag commented Sep 12, 2019

I am closing the issue because of no new bug reports (except @joeblubaugh but waiting for details) for the v1.18.0 release.

@jirfag jirfag closed this as completed Sep 12, 2019
@mhindery
Copy link

mhindery commented Sep 12, 2019

@jirfag I'm still having issues on Go 1.13 using the 1.18.0 release. As shown below:

  • I'm having the GOPRIVATE env variable set (this is regardless of golangci-lint).
  • When running golang-ci the typecheck checkers fails
Mathieus-MacBook-Pro:newapi mhindery$ go version
go version go1.13 darwin/amd64
Mathieus-MacBook-Pro:newapi mhindery$ printenv | grep GO
GOPRIVATE=*.otainsight.com
Mathieus-MacBook-Pro:newapi mhindery$ go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.18.0
Mathieus-MacBook-Pro:newapi mhindery$ golangci-lint run --deadline=1m --disable-all -E deadcode,gosimple,govet,ineffassign,varcheck,unconvert,prealloc,unparam,typecheck
pkg/otabrands/otabrands.go:1: /usr/local/Cellar/go/1.13/libexec/src/encoding/json/fold.go:83:20: DecodeRune not declared by package utf8 (typecheck)
package otabrands
pkg/protos/benchmark.pb.go:1: /usr/local/Cellar/go/1.13/libexec/src/fmt/scan.go:1200:16: DecodeRuneInString not declared by package utf8 (typecheck)
// Code generated by protoc-gen-go. DO NOT EDIT.
pkg/utils/date/models.go:1: /usr/local/Cellar/go/1.13/libexec/src/strconv/quote.go:405:12: ValidString not declared by package utf8 (typecheck)
package date
pkg/monitoring/monitoring.go:1: /usr/local/Cellar/go/1.13/libexec/src/fmt/scan.go:1200:16: DecodeRuneInString not declared by package utf8 (typecheck)
package monitoring
pkg/utils/mysql/client.go:1: /usr/local/Cellar/go/1.13/libexec/src/regexp/regexp.go:967:22: DecodeRuneInString not declared by package utf8 (typecheck)
package mysql
pkg/utils/bigtable/client.go:1: /usr/local/Cellar/go/1.13/libexec/src/strings/strings.go:980:20: DecodeRuneInString not declared by package utf8 (typecheck)
package bigtable
pkg/utils/caching/inmemclient.go:1: /usr/local/Cellar/go/1.13/libexec/src/encoding/gob/type.go:558:18: DecodeRuneInString not declared by package utf8 (typecheck)
package caching
pkg/webapi/models/input.go:1: /usr/local/Cellar/go/1.13/libexec/src/strconv/quote.go:405:12: ValidString not declared by package utf8 (typecheck)
package models
pkg/api/controllers/base.go:1: /Users/mhindery/go/pkg/mod/github.com/golang/protobuf@v1.3.2/proto/text_parser.go:255:15: DecodeRuneInString not declared by package utf8 (typecheck)
package controllers
...  # ommited similar lines
Mathieus-MacBook-Pro:newapi mhindery$

@jirfag
Copy link
Member

jirfag commented Sep 14, 2019

@mhindery got it, create a separate issue for the GOPRIVATE problem, please. And does it work ok without GOPRIVATE?

@mhindery
Copy link

Turns out my issue had nothing to do with GOPRIVATE or not, but I had an install via brew of v1.17.1 which took precedence over the v1.18.0 version obtained from go get when invoking the golangci-lint command. The latest version works without problem.

@JingleCEF
Copy link

c3a532e

How did you generate go.sum? Thanks!

@tpounds
Copy link
Contributor

tpounds commented Oct 1, 2019

@JingleCEF There were a few known issues with Go 1.13 with previous releases. Try upgrading your go.mod file to the latest v1.19.1 release to see if that resolves your issue.

@tpounds tpounds added the bug Something isn't working label Oct 1, 2019
@JingleCEF
Copy link

@JingleCEF There were a few known issues with Go 1.13 with previous releases. Try upgrading your go.mod file to the latest v1.19.1 release to see if that resolves

What's v1.18 and 1.19 you guys talked about? I can only see the latest version is go 1.13 (1.13.1).

@tpounds
Copy link
Contributor

tpounds commented Oct 1, 2019

@JingleCEF Sorry there are two versions at play. The first is the Go version in this case Go 1.13. The other is the golangci-lint version which is v1.19.1 and is listed in the project releases. When using Go 1.11 or newer you can pin your project to a specific release of any dependency when using Go modules by adding it to your go.mod file. Please refer to the official Go documentation on how to do this.

@JingleCEF
Copy link

@JingleCEF Sorry there are two versions at play. The first is the Go version in this case Go 1.13. The other is the golangci-lint version which is v1.19.1 and is listed in the project releases. When using Go 1.11 or newer you can pin your project to a specific release of any dependency when using Go modules by adding it to your go.mod file. Please refer to the official Go documentation on how to do this.

It looks my problem is because the library version in go.mod and go.sum are too old. After updating with latest versions, it passed build. Thanks!

paganotoni added a commit to gobuffalo/buffalo that referenced this issue Oct 31, 2019
It seems that GolangCI-lint has some issues with Go 1.13 mentioned [here](golangci/golangci-lint#659). This PR updates the version we're using.
paganotoni added a commit to gobuffalo/buffalo that referenced this issue Nov 1, 2019
* changing plural to be singular on the modules variable

* Updates GolangCI lint 

It seems that GolangCI-lint has some issues with Go 1.13 mentioned [here](golangci/golangci-lint#659). This PR updates the version we're using.

* adding correct version to slim dockerfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests