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

x/tools/cmd/cover: isolate, tag, and delete package #56783

Closed
bcmills opened this issue Nov 17, 2022 · 6 comments
Closed

x/tools/cmd/cover: isolate, tag, and delete package #56783

bcmills opened this issue Nov 17, 2022 · 6 comments
Assignees
Labels
Proposal Proposal-Accepted Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Nov 17, 2022

The documentation for x/tools/cmd/cover says:

Deprecated: For Go releases 1.5 and later, this tool lives in the standard repository. The code here is not maintained.

I count 11 CLs updating the package since that notice was first added in CL 9539.
Keeping the code around clearly isn't doing anyone any good — at the very least, it adds noise in git grep results (which is how I came to notice it in the first place).

I propose that we give it the same treatment as x/exp/winfsnotify: carve it out into a nested module, tag that module cmd/cover/v0.1.0-deprecated, and then delete it from the x/tools repo at HEAD.

@gopherbot gopherbot added this to the Proposal milestone Nov 17, 2022
@mvdan
Copy link
Member

mvdan commented Nov 17, 2022

I wonder - is this trick a general solution to deleting code from stable modules? I guess it technically is a breaking change, but we're OK with that given that x/tools is a v0, and the workaround is easy - use the new module instead.

@gopherbot
Copy link

Change https://go.dev/cl/451595 mentions this issue: cmd/cover: carve out deprecated command into its own module

@gopherbot
Copy link

Change https://go.dev/cl/451596 mentions this issue: cmd/cover: delete package

@rsc
Copy link
Contributor

rsc commented Nov 30, 2022

No change in consensus, so accepted. 🎉
This issue now tracks the work of implementing the proposal.
— rsc for the proposal review group

@rsc rsc changed the title proposal: x/tools/cmd/cover: isolate, tag, and delete package x/tools/cmd/cover: isolate, tag, and delete package Nov 30, 2022
@rsc rsc modified the milestones: Proposal, Backlog Nov 30, 2022
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Nov 30, 2022
@bcmills bcmills self-assigned this Jan 11, 2023
gopherbot pushed a commit to golang/tools that referenced this issue Jan 11, 2023
Since cmd/cover imports x/tools/cover (which is not itself
deprecated), its go.mod file needs to require a version of x/tools
that includes cover but not cmd/cover.
Arbitrarily choose x/tools v0.4.0 as the likely next x/tools release
tag and slot it in using a 'replace' directive.

For golang/go#56783.

Change-Id: I26a5829d0421724ab14437955a8cec4acbfd62b0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/451595
Run-TryBot: Bryan Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
@gopherbot
Copy link

Change https://go.dev/cl/461656 mentions this issue: cmd/cover: remove replace directive

@gopherbot
Copy link

Change https://go.dev/cl/461655 mentions this issue: cmd/cover: carve out deprecated command into its own module

gopherbot pushed a commit to golang/tools that referenced this issue Jan 11, 2023
Since cmd/cover imports x/tools/cover (which is not itself
deprecated), its go.mod file needs to require a version of x/tools
that includes cover but not cmd/cover.
Arbitrarily choose x/tools v0.6.0 as the likely next x/tools release
tag and slot it in using a 'replace' directive.

In a followup commit, I will remove the replace directive and update
the x/tools dependency to the pseudo-version of the exact commit of
this CL.

For golang/go#56783.

Change-Id: Ia70206cb8c4e6128b90a048aad4e2607db19740b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/461655
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopherbot pushed a commit to golang/tools that referenced this issue Jan 11, 2023
This makes it so that 'go install golang.org/x/tools/cmd/cover@latest'
will continue to work. ('go install pkg@version' does not allow
replace directives.)

For golang/go#56783.

Change-Id: I9f899eee36ab4118367b0a3118f701b7b9a5cceb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/461656
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
@dmitshur dmitshur modified the milestones: Backlog, Unreleased Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Proposal Proposal-Accepted Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

5 participants