-
Notifications
You must be signed in to change notification settings - Fork 18k
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: -gorepo flag does not work #68533
Comments
I believe this is a dupe of #57742 |
@seankhliao I read that issue, and it caused me to try a few other things I didn't mention above, such as I assume that @matloob did fix something, so I interpreted that as meaning that there's some subtlety about what #57742 is about that's different from this issue. But I'm also okay with just declaring that #57742 was never fixed and reopening that one and closing this one. |
Just this (without cd $(go env GOROOT)/src
pkgsite . |
@seankhliao I do not want to serve files from GOROOT. I want to serve the files out of my local repo checkout in One thing I tried is to set
(Another bad error message: it again mentions GOPATH, and it ends with a colon and no further text.) In any case, I want what the |
does the |
@seankhliao sure, if I build a
|
@cespare Thanks for reporting this! We recognize that cmd/pkgsite's user experience is not quite there yet and appreciate you bearing with us. There's a bug where we print There's a bug where we use the value of the gorepo flag before the flag is parsed. I'll send a change to fix that. I wasn't able to get the error in #68533 (comment) but I can look into that once we fix the first two issues. I think we should also probably remove the |
Change https://go.dev/cl/600917 mentions this issue: |
The value of the gorepo flag variable was being used before flags were parsed. Fix that. Also fix a couple of other issues that came up in golang/go#68533: First, don't print "searching GOPATH" when we're not searching GOPATH. Second, print the stderr from the go command in the error when it fails because it's the stderr that usually provides information about the failure, not the stdout. For golang/go#68533 Change-Id: Ic6321d6e071dd82415474f2a2c54146e9eabbef7 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/600917 Reviewed-by: Jonathan Amsterdam <jba@google.com> Auto-Submit: Michael Matloob <matloob@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> kokoro-CI: kokoro <noreply+kokoro@google.com>
@matloob Can you close this issue if cl/600917 fixes the gorepo flag? |
Go version
go version go1.22.3 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I'm making some documentation changes in the standard library and I want to check the HTML rendered form, so I'm trying to use pkgsite to show it.
I'm using the latest version of pkgsite as of right now (
v0.0.0-20240716182356-3166cf6ec5e3
).I see that
pkgsite
offers a-gorepo
flag:What did you see happen?
The copy of the repo I'm editing is in
~/apps/godev
.So I tried:
This error message is confusing. I have no GOPATH set. GOPATH is nearly dead these days. Why does it mention GOPATH?
I take the error to mean that it doesn't like the fact that I'm invoking
pkgsite
from$HOME
. So the next thing I can try is to make a dummy Go module to satisfy pkgsite:Now the server starts, but notice that it's loading std packages from
~/apps/go
, which is my GOROOT, rather than the-gorepo
location that I provided. And indeed, when I visit (for example) http://localhost:8080/cmp, I see the stale documentation from GOROOT, not my edited code in~/apps/godev
.What did you expect to see?
I expect to see rendered documentation from the
-gorepo
location I provided. I expect to see changes I make on disk reflected immediately. I expect flags to work as documented. I expect pkgsite to be as easy-to-use as godoc was.The text was updated successfully, but these errors were encountered: