Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: -cover flag is not reported by go version -m #67366

Closed
Jorropo opened this issue May 14, 2024 · 4 comments
Closed

cmd/go: -cover flag is not reported by go version -m #67366

Jorropo opened this issue May 14, 2024 · 4 comments
Labels
GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@Jorropo
Copy link
Member

Jorropo commented May 14, 2024

Go version

go version devel go1.23-0767ffdf27 Tue May 14 17:18:10 2024 +0000 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/tmp/go-build'
GOENV='/home/hugo/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/hugo/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/hugo/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/hugo/k/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/home/hugo/k/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='devel go1.23-0767ffdf27 Tue May 14 17:18:10 2024 +0000'
GODEBUG=''
GCCGO='/usr/bin/gccgo'
GOAMD64='v4'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build428153909=/tmp/go-build -gno-record-gcc-switches'

What did you do?

// a.go
package main

import "fmt"

func main() {
	fmt.Println("☀								🪐")
}
> go build -cover a.go
> go version -m a

What did you see happen?

a: devel go1.23-0767ffdf27 Tue May 14 17:18:10 2024 +0000
	path	command-line-arguments
	build	-buildmode=exe
	build	-compiler=gc
	build	CGO_ENABLED=1
	build	CGO_CFLAGS=
	build	CGO_CPPFLAGS=
	build	CGO_CXXFLAGS=
	build	CGO_LDFLAGS=
	build	GOARCH=amd64
	build	GOOS=linux
	build	GOAMD64=v3

What did you expect to see?

a: devel go1.23-0767ffdf27 Tue May 14 17:18:10 2024 +0000
	path	command-line-arguments
	build	-buildmode=exe
	build	-compiler=gc
	build	-cover=true
	build	CGO_ENABLED=1
	build	CGO_CFLAGS=
	build	CGO_CPPFLAGS=
	build	CGO_CXXFLAGS=
	build	CGO_LDFLAGS=
	build	GOARCH=amd64
	build	GOOS=linux
	build	GOAMD64=v3
@Jorropo Jorropo added the NeedsFix The path to resolution is known, but the work has not been done. label May 14, 2024
@Jorropo Jorropo added this to the Backlog milestone May 14, 2024
@Jorropo Jorropo changed the title cmd/go: -cover flag is not reported by go version -m cmd/build: -cover flag is not reported by go version -m May 14, 2024
@Jorropo Jorropo changed the title cmd/build: -cover flag is not reported by go version -m cmd/go: -cover flag is not reported by go version -m May 14, 2024
@Jorropo
Copy link
Member Author

Jorropo commented May 14, 2024

cc @matloob @samthanawalla (https://dev.golang.org/owners)
I don't exactly know who is responsible for this, might be @golang/compiler

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/587375 mentions this issue: cmd/go: add -cover flag to report by go version -m

khndhkx123 added a commit to khndhkx123/go that referenced this issue May 22, 2024
khndhkx123 added a commit to khndhkx123/go that referenced this issue May 22, 2024
@Jorropo
Copy link
Member Author

Jorropo commented May 22, 2024

@gopherbot please open backport issues

@gopherbot
Copy link
Contributor

Backport issue(s) opened: #67579 (for 1.21), #67580 (for 1.22).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants