micro icon indicating copy to clipboard operation
micro copied to clipboard

Build failure: vendoring in tcell

Open wvh opened this issue 8 years ago • 5 comments

Hello,

Following the exact commands given in the README, I get a build failure with the latest version. Go 1.7.4 on Debian Linux, GOPATH set correctly.

Seems related to vendoring:

go get -d github.com/zyedidia/micro/cmd/micro
cd $GOPATH/src/github.com/zyedidia/micro
make install
git pull
Already up-to-date.
git submodule update --init
go install -ldflags "-s -w -X main.Version=1.3.4-1 -X main.CommitHash=ac29e30 -X 'main.CompileDate=September 29, 2017' " ./cmd/micro
# github.com/zyedidia/micro/cmd/micro/vendor/github.com/zyedidia/tcell
cmd/micro/vendor/github.com/zyedidia/tcell/encoding.go:124: cannot use "github.com/gdamore/encoding".ASCII (type "golang.org/x/text/encoding".Encoding) as type "github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Encoding in return argument:
        "golang.org/x/text/encoding".Encoding does not implement "github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Encoding (wrong type for NewDecoder method)
                have NewDecoder() *"golang.org/x/text/encoding".Decoder
                want NewDecoder() *"github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Decoder
cmd/micro/vendor/github.com/zyedidia/tcell/encoding.go:134: cannot use "github.com/gdamore/encoding".UTF8 (type "golang.org/x/text/encoding".Encoding) as type "github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Encoding in assignment:
        "golang.org/x/text/encoding".Encoding does not implement "github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Encoding (wrong type for NewDecoder method)
                have NewDecoder() *"golang.org/x/text/encoding".Decoder
                want NewDecoder() *"github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Decoder
cmd/micro/vendor/github.com/zyedidia/tcell/encoding.go:135: cannot use "github.com/gdamore/encoding".UTF8 (type "golang.org/x/text/encoding".Encoding) as type "github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Encoding in assignment:
        "golang.org/x/text/encoding".Encoding does not implement "github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Encoding (wrong type for NewDecoder method)
                have NewDecoder() *"golang.org/x/text/encoding".Decoder
                want NewDecoder() *"github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Decoder
cmd/micro/vendor/github.com/zyedidia/tcell/encoding.go:136: cannot use "github.com/gdamore/encoding".ASCII (type "golang.org/x/text/encoding".Encoding) as type "github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Encoding in assignment:
        "golang.org/x/text/encoding".Encoding does not implement "github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Encoding (wrong type for NewDecoder method)
                have NewDecoder() *"golang.org/x/text/encoding".Decoder
                want NewDecoder() *"github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Decoder
cmd/micro/vendor/github.com/zyedidia/tcell/encoding.go:137: cannot use "github.com/gdamore/encoding".ASCII (type "golang.org/x/text/encoding".Encoding) as type "github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Encoding in assignment:
        "golang.org/x/text/encoding".Encoding does not implement "github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Encoding (wrong type for NewDecoder method)
                have NewDecoder() *"golang.org/x/text/encoding".Decoder
                want NewDecoder() *"github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Decoder
cmd/micro/vendor/github.com/zyedidia/tcell/encoding.go:138: cannot use "github.com/gdamore/encoding".ASCII (type "golang.org/x/text/encoding".Encoding) as type "github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Encoding in assignment:
        "golang.org/x/text/encoding".Encoding does not implement "github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Encoding (wrong type for NewDecoder method)
                have NewDecoder() *"golang.org/x/text/encoding".Decoder
                want NewDecoder() *"github.com/zyedidia/micro/cmd/micro/vendor/golang.org/x/text/encoding".Decoder
Makefile:26: recipe for target 'install' failed
make: *** [install] Error 2

wvh avatar Sep 29 '17 13:09 wvh

Huh my first instinct is to say this is happening because you are using Go 1.7, but that's really not that old a version of Go... I'll see if I can reproduce the problem with an older version of go.

zyedidia avatar Sep 29 '17 17:09 zyedidia

had the exact same issue after initial go get -d, on go1.9 linux/amd64. magically fixed by:

go get github.com/zyedidia/tcell
cd $GOPATH/src/github.com/zyedidia/micro
rm -rf cmd/micro/vendor/*
git checkout cmd/micro/vendor
make install

Now even after I rm -rf $GOPATH/src/github.com/zyedidia/{micro,tcell} and redo the suggested steps in README(go get -d github.com/zyedidia/micro/cmd/micro && cd $GOPATH/src/github.com/zyedidia/micro && make install) it works perfectly. Really, really weird.

rvolosatovs avatar Oct 07 '17 17:10 rvolosatovs

Same problem here: go version go1.9.2 linux/amd64

kyrios123 avatar Nov 13 '17 19:11 kyrios123

Same thing, go1.10 Linux/amd64, @rvolosatovs fix did the trick here too.

ljrk0 avatar Feb 21 '18 12:02 ljrk0

Is this issue still observed?

dmaluka avatar Apr 14 '24 23:04 dmaluka