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

godoc changed - godev fails to autostart godoc and load js and css files #16

Open
the42 opened this issue Jan 20, 2014 · 12 comments
Open

Comments

@the42
Copy link

the42 commented Jan 20, 2014

As I don't know what the expected behaviour in this regard is, I can only describe how things have changed:

A godoc of ca. two weeks ago go get -u code.google.com/p/go.tools/cmd/godoc was auto-started by godev, however some js and css files failed to load.

A godoc as of Jan 20 failes to auto-load and many (all?) css and js files fail to load.

  • If I start godoc manually godoc -http=:6060 and browse to localhost:6060 it seems as godoc is working without issues.
  • If I start godoc manualy and browse within to godev to godoc, the package list get's displayed, but without any js or css files:

07:31:57.374 GET http://127.0.0.1:2022/godoc/pkg/ [HTTP/1.1 200 OK 59ms]
07:31:57.820 GET http://127.0.0.1:2022/lib/godoc/style.css [HTTP/1.1 404 Not Found 1ms]
07:31:57.821 GET http://127.0.0.1:2022/doc/gopher/pkg.png [HTTP/1.1 404 Not Found 1ms]
07:31:57.823 GET http://127.0.0.1:2022/lib/godoc/jquery.js [HTTP/1.1 404 Not Found 2ms]
07:31:57.824 GET http://127.0.0.1:2022/lib/godoc/godocs.js [HTTP/1.1 404 Not Found 1ms]
07:31:58.164 GET http://127.0.0.1:2022/doc/gopher/pkg.png [HTTP/1.1 404 Not Found 1ms]
07:31:58.165 GET http://127.0.0.1:2022/lib/godoc/jquery.js [HTTP/1.1 404 Not Found 1ms]
07:31:58.166 GET http://127.0.0.1:2022/lib/godoc/godocs.js

Clicking Go Doc above the editor area always works, regardless of godoc running in the background or not

@sirnewton01
Copy link
Owner

Godev tries to launch its own private godoc server using port 6060 as the default. It uses custom templates so that links work as expected within godev and it looks a little more integrated.

It won't work at the moment with a godoc server that you launch yourself because it won't have the special godev templates.

Can you try killing all of the godoc servers on your system and restart godev? Try navigating to the Go Docs through the godev menu instead of navigating directly to localhost:6060.

It's a little clunky at the moment but hopefully it works if you follow the intended flow.

Thanks,
Chris

@the42
Copy link
Author

the42 commented Jan 21, 2014

That was the actual issue I tried to report. godev doesn't start godoc automatically, whereas a version of godev two weeks ago did. If I browse to Go Doc (with no godoc service started by myself, I get

{
  "Severity": "Error",
  "HttpCode": 500,
  "Message": "Error connecting to godoc server",
  "DetailedMessage": "Get http://127.0.0.1:6060/pkg/: dial tcp 127.0.0.1:6060: connection refused"
}

That's why I start it manually. I understand that godev is supposed to start godoc automatically.

@sirnewton01
Copy link
Owner

Ok, I understand now. Thanks for your response.

Can you try running godoc manually for me to see why it fails to start?
godoc -http=127.0.0.1:6060 -index=true -templates=<path_to_godev_source_code>/godoc-templates

In the mean time I will add better logging to help diagnose the problem with the godev "-debug" parameter.

Chris

@sirnewton01
Copy link
Owner

The godoc command above should really be:

godoc -http=127.0.0.1:6060 -index=true -templates=/path/to/godev/source/code/godoc-templates

It looks like github strips out anything that looks like html (ie. angle brackets) instead of escaping it.

@the42
Copy link
Author

the42 commented Jan 21, 2014

This is the output of the command:
john@ebola:~$ godoc -http=127.0.0.1:6060 -index=true -templates=/home/john/dev/gocode/src/github.com/sirnewton01/godev/godoc-templates/
2014/01/21 21:49:48 readTemplate: open /home/john/dev/gocode/src/github.com/sirnewton01/godev/godoc-templates/searchdoc.html: no such file or directory

ls of the directory is
total 16
-rw-r--r-- 1 john john 0 Jän 13 17:57 codewalkdir.html
-rw-r--r-- 1 john john 0 Jän 13 17:57 codewalk.html
-rw-r--r-- 1 john john 0 Jän 13 17:57 dirlist.html
-rw-r--r-- 1 john john 0 Jän 13 17:57 error.html
-rw-r--r-- 1 john john 0 Jän 13 17:57 example.html
-rw-r--r-- 1 john john 1732 Jän 13 17:57 godoc.html
-rw-r--r-- 1 john john 0 Jän 13 17:57 opensearch.xml
-rw-r--r-- 1 john john 7164 Jän 13 17:57 package.html
-rw-r--r-- 1 john john 0 Jän 13 17:57 package.txt
-rw-r--r-- 1 john john 738 Jän 13 17:57 search.html
-rw-r--r-- 1 john john 0 Jän 13 17:57 search.txt
john@ebola:~/dev/gocode/src/github.com/sirnewton01/godev/godoc-templates$

zero-sized files and no searchdoc.html at all. Did a go get -u github.com/sirnewton01/godev before.

@sirnewton01
Copy link
Owner

It looks like your godoc requires this extra template file. What version of Go is this? I don't think I saw this with either 1.1.2 or 1.2 GA.

@the42
Copy link
Author

the42 commented Jan 22, 2014

go version says
go1.2 linux/amd64

I installed it from source hg pull; hg update go1.2

You mention my godoc misses that file, but the directory you pointed me to belongs to godev.

As godoc no longer belongs to the go core, I installed it by
go get code.google.com/p/go.tools/cmd/godoc

@sirnewton01
Copy link
Owner

Thanks, I will go get this version of godoc and add the necessary templates.

@sirnewton01
Copy link
Owner

I have pushed new templates that should satisfy the new version of godoc.

Thanks again for reporting the problem.

@sirnewton01
Copy link
Owner

Hi, @dalu is this happening with the latest Go beta (1.3)?

@sirnewton01
Copy link
Owner

Hi @dalu, can you try creating a blank file for /p/home/darko/go/src/github.com/sirnewton01/godev/godoc-templates/package.txt and see if that fixes the problem?

@sirnewton01
Copy link
Owner

Ah, I see what's going on now. The path arithmetic is failing because one of the gopaths is a prefix of the other. I'm re-opening this so that I can fix that part.

Thanks for reporting this!

@sirnewton01 sirnewton01 reopened this May 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants