golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.9k stars 17.65k forks source link

gollvm: go tool: no such tool "cover" #41480

Open advancedwebdeveloper opened 4 years ago

advancedwebdeveloper commented 4 years ago

Hello again. I am experience problems similar to cmd/cover: Not registered as a tool .

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

$ go version

go version go1.15rc2 gollvm LLVM 12.0.0git linux/amd64

Does this issue reproduce with the latest release?

Maybe.

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

go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/oceanfish81/.cache/go-build" GOENV="/home/oceanfish81/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/oceanfish81/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/oceanfish81/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/tools" GCCGO="/usr/local/bin/llvm-goc" AR="ar" CC="/usr/bin/clang" CXX="/usr/bin/clang++" CGO_ENABLED="1" GOMOD="/home/oceanfish81/faas-provider/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=/tmp/go-build709537862=/tmp/go-build -gno-record-gcc-switches -funwind-tables"
$ go env

What did you do?

Tried to build faasd .

$ make test

go test -cover ./... go tool: no such tool "cover"

make: *** [Makefile:6: test] Error 2

Ivan

ianlancetaylor commented 4 years ago

Historically gccgo and GoLLVM haven't bother to provide "go tool cover" because they already support -gccgoflags=-pg to get coverage reports.

advancedwebdeveloper commented 4 years ago

Historically gccgo and GoLLVM haven't bother to provide "go tool cover" because they already support -gccgoflags=-pg to get coverage reports.

I wouldn't be so sure about that

go test -gccgoflags='-pg' ./... github.com/openfaas/faas-provider/auth [github.com/openfaas/faas-provider/auth.test] /usr/local/bin/llvm-goc: error: unrecognized command line option '-pg'

ianlancetaylor commented 4 years ago

My apologies, I withdraw my statement about GoLLVM.

advancedwebdeveloper commented 4 years ago

CC @thanm @cherrymui

thanm commented 4 years ago

As Ian mentioned, "go tool cover" is specific to the GC toolchain.

Correct, gollvm doesn't implement "-pg" at the moment. I would imagine it's doable, I think nobody has bothered to look into it yet.

advancedwebdeveloper commented 4 years ago

As Ian mentioned, "go tool cover" is specific to the GC toolchain.

Correct, gollvm doesn't implement "-pg" at the moment. I would imagine it's doable, I think nobody has bothered to look into it yet.

@thanm , could you open a PR issue?

thanm commented 4 years ago

could you open a PR issue?

There are many features not supported by Gollvm; I am not sure what good it would do to create a laundry list of issues enumerating all the things that could be done but are not. Doing this simple clutters up the Go issue tracker as I see it (more productive I think to have these sorts of discussions (we should implement feature ABC instead of XYZ) on a mailing list like go-dev.

It also goes without saying that the main obstacle here is contributor bandwidth. I myself have a very limited amount of time to spend working on Gollvm-- there are many other higher-priority tasks for me at the moment. If we want to add new features, someone has to be willing to devote time to implementing them.

ianlancetaylor commented 4 years ago

Anyhow we don't need to open another issue, we already have this one.

In general I agree with @thanm: we don't need a list of things to improve in GoLLVM or gccgo. We know lots of things we can do. What we need is not things to do, but people willing to work on them.

robpike commented 4 years ago

Although the gcc and llvm tool chains have support for coverage, the Go cover tool should be completely portable. It should be very easy to get it working for other compilers since it requires no compiler support.

advancedwebdeveloper commented 4 years ago

@robpike , would you are interested to contribute into this?

advancedwebdeveloper commented 4 years ago

could you open a PR issue?

There are many features not supported by Gollvm; I am not sure what good it would do to create a laundry list of issues enumerating all the things that could be done but are not. Doing this simple clutters up the Go issue tracker as I see it (more productive I think to have these sorts of discussions (we should implement feature ABC instead of XYZ) on a mailing list like go-dev.

It also goes without saying that the main obstacle here is contributor bandwidth. I myself have a very limited amount of time to spend working on Gollvm-- there are many other higher-priority tasks for me at the moment. If we want to add new features, someone has to be willing to devote time to implementing them.

@thanm , I guess we could try to share things via Gophers Slack. I might spend some time on chatting. Mailing list sounds like a good idea - but we would still require a list of non-yet-supported features, for gollvm.