zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
24.36k stars 1.16k forks source link

Build failure: vendoring in tcell #832

Open wvh opened 6 years ago

wvh commented 6 years ago

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
zyedidia commented 6 years ago

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.

rvolosatovs commented 6 years ago

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.

kyrios123 commented 6 years ago

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

ljrk0 commented 6 years ago

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

dmaluka commented 2 months ago

Is this issue still observed?