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/pkgsite: Can’t display any non-stdlib docs #66781

Open
vfaronov opened this issue Apr 11, 2024 · 1 comment
Open

x/pkgsite: Can’t display any non-stdlib docs #66781

vfaronov opened this issue Apr 11, 2024 · 1 comment
Labels
Milestone

Comments

@vfaronov
Copy link

What is the URL of the page with the issue?

http://localhost:8080/golang.org/x/sync/errgroup (and any other)

What is your user agent?

any

Screenshot

Screenshot 2024-04-11 at 16-06-25 424 Failed Dependency - Go Packages

What did you do?

go mod init some.test/module
go get golang.org/x/sync/errgroup   # or any other
pkgsite

Then open the supposed URL for this package’s docs: http://localhost:8080/golang.org/x/sync/errgroup

This seems to happen with any package other than standard library. The standard library works, e.g. http://localhost:8080/net/http

It does work if I run pkgsite -cache, but then the standard library doesn’t work.

What did you see happen?

An error page (see screenshot). pkgsite produces the following log:

2024/04/11 16:09:14 Info: go/packages.Load(["all"]) loaded 0 packages from . in 7.62895ms
2024/04/11 16:09:14 Info: go/packages.Load(std) loaded 289 packages from /home/vasiliy/my.bulk/ware/go/1.22.0 in 227.310508ms
2024/04/11 16:09:14 Info: FetchDataSource: fetching some.test/module@v0.0.0
2024/04/11 16:09:14 Info: FetchDataSource: fetched some.test/module@v0.0.0 using <nil> in 27.44µs with error some.test/module@v0.0.0: not found
2024/04/11 16:09:14 Info: FetchDataSource: fetching std@latest
2024/04/11 16:09:14 Info: Listening on addr http://localhost:8080
2024/04/11 16:09:14 Info: FetchDataSource: fetched std@latest using *fetch.goPackagesModuleGetter in 141.052419ms with error <nil>
2024/04/11 16:09:24 Info: FetchDataSource: fetching golang.org/x/sync/errgroup@latest
2024/04/11 16:09:24 Info: FetchDataSource: fetched golang.org/x/sync/errgroup@latest using <nil> in 12.851µs with error golang.org/x/sync/errgroup@latest: not found
2024/04/11 16:09:24 Info: FetchDataSource: fetching golang.org/x/sync@latest
2024/04/11 16:09:24 Info: FetchDataSource: fetched golang.org/x/sync@latest using <nil> in 3.525µs with error golang.org/x/sync@latest: not found
2024/04/11 16:09:24 Info: returning 424 (Failed Dependency) for error serveUnitPage(ctx, w, r, ds, &{golang.org/x/sync/errgroup unknownModulePath latest}): 424 (Failed Dependency): <nil> (epage=&{{   <nil> false false   false false    }  <h3 class="Error-message">This page is not supported by this datasource.</h3> <nil>})

What did you expect to see?

The documentation for the golang.org/x/sync/errgroup package.

@gopherbot gopherbot added this to the Unreleased milestone Apr 11, 2024
@adonovan
Copy link
Member

adonovan commented Apr 11, 2024

I agree, these seem like two real usability bugs. To recap:

  1. Without the rather obscure -cache flag, the server has no knowledge of modules not in the workspace, which is frustrating when starting a new module, or when browsing available modules to evaluate possible new dependencies.
  2. With the -cache flag, std packages are not displayed at all.

@matloob

@adonovan adonovan modified the milestones: Unreleased, Backlog Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants