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/go/pointer: isolate, tag, and delete the pointer analysis #59676

Closed
adonovan opened this issue Apr 17, 2023 · 8 comments
Closed

x/tools/go/pointer: isolate, tag, and delete the pointer analysis #59676

adonovan opened this issue Apr 17, 2023 · 8 comments

Comments

@adonovan
Copy link
Member

golang.org/x/tools/go/pointer is a pointer analysis for Go. it was originally developed for cmd/guru, which itself is moribund, succeeded by the much more sophisticated gopls. Pointer analysis in an IDE was an interesting idea, but it proved much less useful than expected: it is slow and scales poorly, and even when correct its results were often hard to comprehend. It requires some notion of a main (or test) entry point, which means it requires more configuration than most users are willing to spend on it. It is unsound: like most static analyses, it can't track information flow and call paths through reflection, even though these are widely used by text/template, encoding/json, encoding/gob, and many other packages. And it is inherently fragile, since it requires annotations for non-Go functions such as C and assembly. Few users are willing, able, or aware of the need to write such annotations, and the few annotations that do exist, for functions in the runtime and standard library, become stale almost as soon as they are updated.

We propose to create a new module for golang.org/x/tools/go/pointer, tag it, then delete it. At that point, applications that wish to depend on the last tagged version (after updating their go.mod file) may continue to do so, but there will be no more fixes to the package. Perhaps someone in the Go community will fork it and give it a new life.

It is currently imported by 233 projects.

See also: #59056

@timothy-king
Copy link
Contributor

All of the maintenance issues given in the proposal are somewhat to be expected with whole program static analysis. These are fixable with an additional investment of time. It is however clear that maintaining the package has not been a high priority for a while and issues with the package are not getting addressed. I think accepting this proposal would set better expectations for users going forward.

@rsc
Copy link
Contributor

rsc commented May 10, 2023

This proposal has been added to the active column of the proposals project
and will now be reviewed at the weekly proposal review meetings.
— rsc for the proposal review group

@rsc rsc moved this from Incoming to Active in Proposals May 10, 2023
@rsc
Copy link
Contributor

rsc commented May 17, 2023

Based on the discussion above, this proposal seems like a likely accept.
— rsc for the proposal review group

@rsc rsc moved this from Active to Likely Accept in Proposals May 17, 2023
@rsc
Copy link
Contributor

rsc commented May 24, 2023

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

@rsc rsc moved this from Likely Accept to Accepted in Proposals May 24, 2023
@rsc rsc changed the title proposal: x/tools/go/pointer: isolate, tag, and delete the pointer analysis x/tools/go/pointer: isolate, tag, and delete the pointer analysis May 24, 2023
@rsc rsc modified the milestones: Proposal, Backlog May 24, 2023
@adonovan adonovan self-assigned this May 31, 2023
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/499695 mentions this issue: go/pointer: create submodule

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/499696 mentions this issue: cmd/{guru,callgraph}: stop using go/pointer

gopherbot pushed a commit to golang/tools that referenced this issue May 31, 2023
This change removes the -algo=pta option from cmd/callgraph,
and all the subcommands of cmd/guru, that use pointer analysis.
These features have been poorly supported for a long time,
and the pointer analysis package is about to be tagged and
deleted.

Updates golang/go#59676

Change-Id: Id4ded651b8385c588991d01377b2f087d14ae191
Reviewed-on: https://go-review.googlesource.com/c/tools/+/499696
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopherbot pushed a commit to golang/tools that referenced this issue May 31, 2023
The pointer analysis is deprecated.
Once this module is tagged, we will delete it.
Clients will be able to use only the last version.

Updates golang/go#59676

Change-Id: If6e2214d964f0bbd1267634a1ad5c0d3166ecf0e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/499695
Run-TryBot: Alan Donovan <adonovan@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Alan Donovan <adonovan@google.com>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/499756 mentions this issue: go/pointer: remove replace directive

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/499757 mentions this issue: go/pointer: delete package

gopherbot pushed a commit to golang/tools that referenced this issue Jun 1, 2023
This makes it so that 'go install golang.org/x/tools/go/pointer@latest'
will continue to work. ('go install pkg@version' does not allow
replace directives.)

Updates golang/go#59676

Change-Id: I7dcb95a5730bd68d42a5873f9f9cec6bef773205
Reviewed-on: https://go-review.googlesource.com/c/tools/+/499756
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
@dmitshur dmitshur modified the milestones: Backlog, Unreleased Jun 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants