Symlinks under $GOROOT break godoc

Bug #1743452 reported by Dave Rolsky
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
golang (Ubuntu)
New
Undecided
Unassigned
golang-1.10 (Ubuntu)
Confirmed
Undecided
Unassigned
golang-1.11 (Ubuntu)
New
Undecided
Unassigned
golang-1.17 (Ubuntu)
New
Undecided
Unassigned
golang-1.9 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

If I attempt to run `godoc -http=:6060` I get this error:

    2018/01/15 13:56:07 godoc: corpus fstree is nil

Some googling brought me to this go core bug - https://github.com/golang/go/issues/15049

On closing the bug, Russ Cox says "I think this is basically working as intended. Every time anyone tries to make godoc do more with symlinks it ends up chasing its own tail. Symlinks in Go file trees should just be disallowed, honestly."

Of course, I realize that the symlinks are there to put things where the FHS says they should be, but Go knows the one true way to do everything, and it says "don't do that". And since it's Go, not only does it say "don't do that", it breaks in the presence of it and will never be changed to work any other way.

In this case, I think getting godoc to work trumps the FHS.

I'm sure this applies to other golang-1.X packages too, but I haven't looked at them.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in golang-1.9 (Ubuntu):
status: New → Confirmed
Revision history for this message
Conrado PLG (conradoplg) wrote :

This also breaks the Go extension of Visual Studio Code: https://github.com/Microsoft/vscode-go/issues/1636#issuecomment-387962213
A tool used by it, gopkgs, uses filepath.Walk (actually a parallel implementation of it, but it's the same issue) to list the packages in GOROOT, but filepath.Walk does not follow symlinks.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in golang-1.10 (Ubuntu):
status: New → Confirmed
Revision history for this message
Julian Alarcon (julian-alarcon) wrote :

It is still broken on Ubuntu 22.04 (dev release) with go v1.17

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.