-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
proposal: x/tools/{godoc,cmd/godoc}: isolate, tag, and delete godoc #59056
Comments
I don't like that the recommended way to see documentation locally is something with 43 direct dependencies and 57 indirect dependencies. Why does it need two database drivers (redis and postgres), a VM for a scripting language (lua), an implementation of SSH, two RPC layers (grpc and protobuf), oauth2 and bindings to OpenTelemetry? Pkgsite starts slower, serves pages slower, takes 30 seconds to load a standard library package every time I start it and it doesn't have the convenient list of packages that godoc has. |
@aarzilli FWIW I plan to fix both the slow loading and the downloading of the stdlib as part of https://go.dev/issue/40371. The slowness is due to rendering the entire module at once (rather than rendering packages as they are accessed). The stdlib loading time is due to downloading the stdlib rather than rendering GOROOT. Both should be fixable, and are definitely worth fixing. As for why it needs so many dependencies: it is in the same module as pkg.go.dev, which integrates with cloud services. I suppose we could avoid this by splitting x/pkgsite into multiple modules, but that seems like a non-trivial amount of complexity and maintenance burden for little gain. I could be convinced otherwise, if folks have strong reasons why this is a problem. |
That's what I'm saying, there's always been two programs, what pkgsite is now used to be called gddo, it's not worth the effort trying to make pkgsite work well for both. The maintenance burden of godoc has been small so far, it should just be undeprecated. |
I agree that the maintenance burden has been light thus far, and really appreciate all the community members that have stepped in to help with godoc. But having godoc live in x/tools means that it is ultimately the responsibility of the Go team to (at the very least) review CLs and not break the build. Ultimately, this requires attention, and attention is an extremely valuable resource! Furthermore, there is no guarantee that the burden of this responsibility will continue to be light in the future. If in the future some change in Go causes godoc tests to fail, or if some critical bug is discovered in godoc, it will be incumbent upon the Go team to address the problem quickly, even if the fix is only to e.g. skip the test. (and if that's the fix, isn't it clearer to remove godoc from x/tools so as to not imply a level of support?). |
If that were to happen it could be removed then. On what basis do you predict the burden of maintenance will increase? |
Yes, as Golds provides some richer features, such as showing be-direction relations between deping and deped packages (such as type implementation relation), there are some difficulties to parse multiple versions of a package at the same time, which is often caused by parsing multiple seed modules. I believe the limitation originates from the golang.org/x/tools/go/packages package, though it is possible to make (some heavy) efforts to let Golds work through the limitation. |
What's the recommended alternative for rendering private modules? |
wouldn't the dependency graph sort that instead of assuming the first package is the leaf? |
Could you elaborate? As of last week, pkgsite should display docs reflecting locally edited packages each time you reload the page. |
if you run pkgsite as-is you don't get any CSS or image, and to run frontend you need postgresql. pretty high requirements just to see the generated docs as godoc does out of the box |
@amery please run x/pkgsite/cmd/pkgsite, which is the local version of pkgsite. Edit: more specifically: Install: $ go install golang.org/x/pkgsite/cmd/pkgsite@master Run: $ pkgsite |
I can confirm it now works. no idea why yesterday it was getting 404 from all static content pulled by the template. thanks a lot @findleyr |
Some of the texts on the website mentioning godoc should probably be revised:
--> godoc hasn't been included in the Go distribution since Go 1.13
--> the website (now go.dev) is no longer served by godoc
--> not wrong, but draws unnecessary attention to godoc, which is deprecated |
There are also several reasons not to delete cmd/godoc
|
@qiulaidongfeng note that you could always continue to use the last tag for godoc, as described in the original post. It won't get updates, but godoc isn't currently getting updates in master either. |
@qiulaidongfeng I've reported #60114 for the slow std download problem and #40371 (comment) for the unexported symbols feature. |
Change https://go.dev/cl/541237 mentions this issue: |
Find another reason not to delete cmd/godoc. See #64920 and #61976 , If my use godoc, my experience is don't have to use the Internet. More importantly, if my CL is used to modify documentation, in cmd, type godoc and you will see the revised std documentation in your browser. See #60114 (comment) , use pkgsite can't see. |
I believe the current consensus on the plan is for In other news, VS Code is likely to get client-side support for rendering documentation within a pane of VS Code itself; see #64936 (comment). Other LSP clients will open a browser connected to a local pkgsite instance, or, perhaps, to the gopls server itself, which may serve pkgsite-like documentation; again there are details to work out. |
Change https://go.dev/cl/571101 mentions this issue: |
Updates golang/go#59056 Change-Id: I43ff06556e06c5bd76ee17632d3b316a7fbb7e70 Reviewed-on: https://go-review.googlesource.com/c/website/+/571101 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
gopls/v0.16.0, released today, contains an integrated documentation viewer, similar in style to pkg.go.dev, but that works on local unpublished packages and even unsaved editor buffers. The remaining blocker for this issue is to make |
@adonovan Love the idea with the new update, but question on this:
The style feels closer to the old Has it been discussed to at least have similar stylesheets to (Not a huge criticism by any means, still love the update :) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Yes, I think that would be a definite improvement; it's simply been a matter of time/effort. We'll get there eventually, and would be happy to accept contributions. |
The godoc command, golang.org/x/tools/cmd/godoc, was never redesigned to make full use of modules, has been deprecated in favor of pkgsite (https://pkg.go.dev), and has been neglected for some time. We propose to isolate, tag, and delete it from the golang.org/x/tools repository, using a similar process to the deletion of cmd/cover.
The main objection to doing so was that godoc is still useful for previewing the documentation of locally edited code, and that its replacement, pkgsite, was not well suited to the local preview use case and really needs additional features such as the ability to run without the network and to load packages on demand after startup. However, @findleyr recently added those features.
Are there any remaining reasons why we should not tag and delete cmd/godoc?
Related:
The text was updated successfully, but these errors were encountered: