owenthereal / ccat

Colorizing `cat`
https://github.com/owenthereal/ccat
MIT License
3.16k stars 118 forks source link

Fail to install on Ubuntu 14.04 #1

Closed raphink closed 9 years ago

raphink commented 9 years ago
$ env | grep GO
GOROOT=/usr/local/go
GOPATH=/home/rpinson/go
$ go install github.com/jingweno/ccat
../go/src/github.com/gogo/protobuf/proto/text.go:44:2: cannot find package "encoding" in any of:
    /usr/local/go/src/pkg/encoding (from $GOROOT)
    /home/rpinson/go/src/encoding (from $GOPATH)
../go/src/sourcegraph.com/sourcegraph/go-sourcegraph/sourcegraph/defs.go:10:2: cannot find package "sourcegraph.com/sourcegraph/go-nnz/nnz" in any of:
    /usr/local/go/src/pkg/sourcegraph.com/sourcegraph/go-nnz/nnz (from $GOROOT)
    /home/rpinson/go/src/sourcegraph.com/sourcegraph/go-nnz/nnz (from $GOPATH)
../go/src/sourcegraph.com/sourcegraph/go-sourcegraph/sourcegraph/repositories.go:9:2: cannot find package "sourcegraph.com/sourcegraph/go-vcs/vcs" in any of:
    /usr/local/go/src/pkg/sourcegraph.com/sourcegraph/go-vcs/vcs (from $GOROOT)
    /home/rpinson/go/src/sourcegraph.com/sourcegraph/go-vcs/vcs (from $GOPATH)
../go/src/sourcegraph.com/sourcegraph/go-sourcegraph/sourcegraph/build_data.go:8:2: cannot find package "sourcegraph.com/sourcegraph/rwvfs" in any of:
    /usr/local/go/src/pkg/sourcegraph.com/sourcegraph/rwvfs (from $GOROOT)
    /home/rpinson/go/src/sourcegraph.com/sourcegraph/rwvfs (from $GOPATH)
../go/src/sourcegraph.com/sourcegraph/go-sourcegraph/sourcegraph/defs.go:13:2: cannot find package "sourcegraph.com/sourcegraph/srclib/graph" in any of:
    /usr/local/go/src/pkg/sourcegraph.com/sourcegraph/srclib/graph (from $GOROOT)
    /home/rpinson/go/src/sourcegraph.com/sourcegraph/srclib/graph (from $GOPATH)
../go/src/sourcegraph.com/sourcegraph/go-sourcegraph/sourcegraph/defs.go:14:2: cannot find package "sourcegraph.com/sourcegraph/srclib/store" in any of:
    /usr/local/go/src/pkg/sourcegraph.com/sourcegraph/srclib/store (from $GOROOT)
    /home/rpinson/go/src/sourcegraph.com/sourcegraph/srclib/store (from $GOPATH)
../go/src/sourcegraph.com/sourcegraph/go-sourcegraph/sourcegraph/defs.go:15:2: cannot find package "sourcegraph.com/sourcegraph/srclib/unit" in any of:
    /usr/local/go/src/pkg/sourcegraph.com/sourcegraph/srclib/unit (from $GOROOT)
    /home/rpinson/go/src/sourcegraph.com/sourcegraph/srclib/unit (from $GOPATH)
../go/src/sourcegraph.com/sourcegraph/go-sourcegraph/sourcegraph/query_tokens.go:11:2: cannot find package "sourcegraph.com/sourcegraph/vcsstore/vcsclient" in any of:
    /usr/local/go/src/pkg/sourcegraph.com/sourcegraph/vcsstore/vcsclient (from $GOROOT)
    /home/rpinson/go/src/sourcegraph.com/sourcegraph/vcsstore/vcsclient (from $GOPATH)
$ go get github.com/jingweno/ccat
package encoding: unrecognized import path "encoding"
munmap of stack space failed: errno 22
Aborted

goroutine 1 [select]:
main.$nested27
    /build/buildd/gccgo-go-1.2.1/src/cmd/go/http.go:57
main.httpsOrHTTP
    /build/buildd/gccgo-go-1.2.1/src/cmd/go/http.go:65
main.repoRootForImportDynamic
    /build/buildd/gccgo-go-1.2.1/src/cmd/go/vcs.go:468
main.repoRootForImportPath
    /build/buildd/gccgo-go-1.2.1/src/cmd/go/vcs.go:362
main.downloadPackage
    /build/buildd/gccgo-go-1.2.1/src/cmd/go/get.go:269
main.download
    /build/buildd/gccgo-go-1.2.1/src/cmd/go/get.go:166
main.download
    /build/buildd/gccgo-go-1.2.1/src/cmd/go/get.go:232
main.download
    /build/buildd/gccgo-go-1.2.1/src/cmd/go/get.go:232
main.runGet
    /build/buildd/gccgo-go-1.2.1/src/cmd/go/get.go:72
main.main
    /build/buildd/gccgo-go-1.2.1/src/cmd/go/main.go:161

goroutine 3 [syscall]:
    goroutine in C code; stack unavailable

Am I doing something wrong here?

professorjamesmoriarty commented 9 years ago

Just for the sake of mentioning, do you have git and mercurial installed?

raphink commented 9 years ago

git yes, mercurial no

raphink commented 9 years ago

Installed mercurial, and now I get:

$ go get github.com/jingweno/ccat
package encoding: unrecognized import path "encoding"
professorjamesmoriarty commented 9 years ago

Not sure if this is entirely on topic, but I don't think your meant to set goroot env variable. Read more here: http://dave.cheney.net/2013/06/14/you-dont-need-to-set-goroot-really

However, I also think its GOROOT=/usr/share/go not GOROOT=/usr/local/go

raphink commented 9 years ago

OK then…

$ unset GOROOT
$ go get github.com/jingweno/ccat
# sourcegraph.com/sourcegraph/srclib/store
../../go/src/sourcegraph.com/sourcegraph/srclib/store/fs_store.go:666: syntax error: unexpected range, expecting {
../../go/src/sourcegraph.com/sourcegraph/srclib/store/fs_store.go:676: syntax error: unexpected semicolon or newline, expecting )
../../go/src/sourcegraph.com/sourcegraph/srclib/store/fs_store.go:678: syntax error: unexpected ), expecting semicolon or newline or }
../../go/src/sourcegraph.com/sourcegraph/srclib/store/fs_store.go:682: non-declaration statement outside function body
../../go/src/sourcegraph.com/sourcegraph/srclib/store/fs_store.go:683: non-declaration statement outside function body
../../go/src/sourcegraph.com/sourcegraph/srclib/store/fs_store.go:684: non-declaration statement outside function body
../../go/src/sourcegraph.com/sourcegraph/srclib/store/fs_store.go:685: non-declaration statement outside function body
../../go/src/sourcegraph.com/sourcegraph/srclib/store/fs_store.go:686: syntax error: unexpected }
jkahrs commented 9 years ago

Maybe you can try:

mkdir -p ./ccat/bin cd ./ccat export GOPATH=$(pwd) export PATH=$PATH:$GOPATH/bin export GOBIN=$GOPATH/bin go get github.com/jingweno/ccat go install src/github.com/jingweno/ccat/*.go

yegortokmakov commented 9 years ago

I would say try to just properly install go with tools https://golang.org/doc/install

raphink commented 9 years ago

So the packaged Ubuntu version is not working @yegortokmakov ?

yegortokmakov commented 9 years ago

@raphink gccgo-go didn't work for me, it failed with similar errors. with official tarball it worked

Sarcasm commented 9 years ago

@raphink Ubuntu 14.04 Go version is to old (1.2), I add to install a more recent version manually.

This is due to the srclib dependency on Go 1.4+, see: https://srclib.org/install/#dependencies

owenthereal commented 9 years ago

You'd need Go 1.4+ to compile from source. I'm planning to provide pre-compiled binaries to make it easier for you. Let me know if you still can't get it working

mslinn commented 9 years ago

Fails with same error on XUbuntu 15.04

jordic commented 9 years ago

Packaged go in ubuntu is more than 1 year old. Just uninstal it and install from golang.org.

owenthereal commented 9 years ago

Precompiled binaries are now available for the latest version: https://github.com/jingweno/ccat/releases/tag/v0.1.0. Ideally you won't need to compile yourself with Go on any platform.

Closing.

mslinn commented 9 years ago

Is there a PPA?

owenthereal commented 9 years ago

@mslinn I'm planning to do that. Stay tuned.

dorian-marchal commented 8 years ago

Is there a PPA for Ubuntu 12.04 ?