Go: x/xerrors: fails to compile on tip

Created on 25 May 2019  路  12Comments  路  Source: golang/go

What version of Go are you using (go version)?

$ go version
go version devel +385b2e0cac Fri May 24 21:34:53 2019 +0000 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output

$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/artyom/Library/Caches/go-build"
GOENV="/Users/artyom/Library/Preferences/go/env"
GOEXE=""
GOFLAGS="-ldflags=-w"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/artyom/go"
GOPROXY="https://proxy.golang.org"
GOROOT="/Users/artyom/Repositories/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/artyom/Repositories/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/tmp/foo/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/lb/3rk8rqs53czgb4v35w_342xc0000gn/T/go-build219175411=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

https://play.golang.org/p/CqTSV8-Wcg0

What did you expect to see?

Program compiles.

What did you see instead?

foo 露 go build
# golang.org/x/xerrors
/Users/artyom/go/pkg/mod/golang.org/x/[email protected]/adaptor_go1_13.go:16:14: undefined: errors.Frame
/Users/artyom/go/pkg/mod/golang.org/x/[email protected]/format_go1_13.go:12:18: undefined: errors.Formatter
FrozenDueToAge NeedsFix

Most helpful comment

@zchee: thank you. Added:

golang.org/x/xerrors v0.0.0-20190528162220-0421b64034aa

to my go.mod and it helped.

All 12 comments

Changes in master was reverted in https://github.com/golang/go/commit/3e2c522d5c712fa2b1d18a101272abefc7dcb074#diff-c93f2f0db26f58ae432e8d8f1dc9bd73

@neild @mpvl - Shouldn't the changes in xerrors be also reverted ?

@agnivade
I was send CL but still review status(actually no reply...)
https://go-review.googlesource.com/c/xerrors/+/177379

Thanks. Replied.

@agnivade
Thanks reply, will fix

Change https://golang.org/cl/177379 mentions this issue: xerrors: Revert "xerrors: redirect to go1.13 primitives for 1.13"

ping/fyi @neild @jba

xerrors can't be built on the recently released go1.13beta1 (and tip) since errors.{Frame,Formatter} were reverted in 3e2c522.

@mpx Thanks comment.

And yes, has been released go1.13beta1 but this version can't compiling xerrors package.
It might be many Gophers will confused, and will post meaningless issues to Go mainline repository.

I know that the discussion of the next error package implementation proposal takes a long time. also I know still discussing.
However, If reason of my CLs is still not merged because of that discuss, I think we should first to make the master branch compilable. After that, should be some proposal reimplemented to xerrors or implements to the Go core.

also ping @rsc, @ianlancetaylor @bradfitz

Is there any (hacky) workaround for now?

Update: looks like this helped:

~/go/src/golang.org/x/xerrors$ git revert d61658bd2e18010be0e21349cc92b1b706e35146

@xaionaro

Just go get -u -m(if you use devel, -d) -v golang.org/x/xerrors@0421b64034aa326c388bbb256730b518991d36ae which my CL hash.

Change https://golang.org/cl/184937 mentions this issue: xerrors: update to current 1.13

@zchee: thank you. Added:

golang.org/x/xerrors v0.0.0-20190528162220-0421b64034aa

to my go.mod and it helped.

Was this page helpful?
0 / 5 - 0 ratings