* Andrew Gerrand <
a...@golang.org> [120517 19:28]:
> >> The argument against following symlinks is that it confuses import paths.
> >>
> >> If you search golang-dev for "godoc symlink" you'll find more details.
I didn't find anything that I thought was relevant here. Can you point
me to a specific thread?
I can imagine how symlinks in the middle of the import path might cause
problems, but my proposal below only allows the symlinks at the top
level, where they would not show up in any import statement.
> I suggest consolidating the golang-src and golang-doc packages. Treat
> the source code as documentation - which is what it is used for,
> nobody is going to use the golang-src package to build the go tree.
> This should still be within the rules of the FHS.
>
> Then you can set godoc's GOROOT to the documentation root (and
> preserve the existing go doc/ lib/godoc/ and pkg/ directories).
Combining these packages is completely orthogonal to the problem. It
would not solve the symlink issue, and putting the contents of these
packages directly under /usr/lib without symlinks can be done without
combining the packages (but not without violating the FHS).
The FHS issue is that $GOROOT/lib must be somewhere under /usr/lib (or
/lib, which isn't appropriate here), but the contents of golang-src and
golang-doc belong under /usr/share (or potentially under /usr/src for
golang-src, but I think it is better where Ondřej has put it).
You already allow an exception to the not-following-symlinks rule for
the explicit arguments provided on the godoc command line. Would you
entertain a patch that allows the immediate children of GOROOT to be
symbolic links?
What I have in mind is in godoc main() after
fs.Bind("/", OS(*goroot), "/", bindReplace)
loop through the contents of the goroot directory and bindReplace each
symlink with the directory to which it points.
There is the potential for a minor inconvenience with this approach in
what I believe is a very rare circumstance. If an administrator
(someone with permission to make changes under GOROOT) changes one of
these directories from a real directory to a symlink or vice versa, any
currently running instances of godoc will need to be restarted.
Alternatively, if GOROOT were /usr/share/go with a symlink for
$GOROOT/lib pointing to /usr/lib/go, would the go tool handle this
correctly for building and installing packages? Note that the files
under GOROOT only change on package upgrade (for Debian).
I am not sure if a symlink in /usr/share that points to somewhere in
/usr/lib that is not architecture independent is acceptable; I would
have to ask Ondřej or someone who understands this better than I.
...Marvin
(Does this thread belong on golang-dev? I have not subscribed to
that group yet, but I will.)