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/cover: cannot run in directory with no .go files [1.13 backport] #33984

Closed
gopherbot opened this issue Aug 30, 2019 · 6 comments
Closed

cmd/cover: cannot run in directory with no .go files [1.13 backport] #33984

gopherbot opened this issue Aug 30, 2019 · 6 comments

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Aug 30, 2019

@rhysh requested issue #33855 to be considered for backport to the next 1.13 minor release.

@gopherbot, please backport to Go 1.13: this is a regression from Go 1.12.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Aug 30, 2019

Change https://golang.org/cl/192722 mentions this issue: [release-branch.go1.13] cmd/cover: skip go list when profile is empty

@andybons andybons added this to the Go1.13.1 milestone Sep 2, 2019
@julieqiu
Copy link
Contributor

@julieqiu julieqiu commented Sep 3, 2019

@rhysh @bcmills would you categorized this as a serious problem with no workaround?

Under our policy at https://github.com/golang/go/wiki/MinorReleases, only fixes for security issues, serious problems with no workaround, and documentation fixes will be backported.

@bcmills
Copy link
Member

@bcmills bcmills commented Sep 3, 2019

It's a regression from 1.12.

There is a workaround (which is to avoid running go tool cover in a directory that does not contain a Go package). However, the fix CL is also very small and seems low-risk.

@katiehockman
Copy link
Member

@katiehockman katiehockman commented Sep 3, 2019

@andybons commented in the change, but to re-iterate here: let's wait to approve and merge this until 1.13 is out.

This can be added to a point release since it isn't a major issue, even if the fix is small

@andybons
Copy link
Member

@andybons andybons commented Sep 21, 2019

OK. 1.13 is out. Will let whomever is on rotation make the final call.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Sep 24, 2019

Closed by merging 7d1c61c to release-branch.go1.13.

@gopherbot gopherbot closed this Sep 24, 2019
gopherbot pushed a commit that referenced this issue Sep 24, 2019
Only call "go list" when explicitly listing packages. An empty coverage
profile references no packages, and would otherwise lead to "go list"
implicitly looking at the package in "." (which might not exist).

Fixes #33984

Change-Id: I02d4e374405d86f03d105fe14648aa03b4d2284c
Reviewed-on: https://go-review.googlesource.com/c/go/+/192340
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit 9d480ed)
Reviewed-on: https://go-review.googlesource.com/c/go/+/192722
@bcmills bcmills modified the milestones: Go1.13.1, Go1.13.2 Sep 25, 2019
@katiehockman katiehockman modified the milestones: Go1.13.2, Go1.13.3 Oct 17, 2019
@golang golang locked and limited conversation to collaborators Oct 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.