#29906 closed defect (wontfix)
go @57.1 Patch for GOROOT, violate_mtree, etc
Reported by: | gaochangjian@… | Owned by: | singingwolfboy@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 1.9.2 |
Keywords: | haspatch | Cc: | cooljeanius (Eric Gallager) |
Port: | go |
Description
According to official document, GOROOT
is "the root of Go tree", it impact of linker, gomake
, godoc
, goinstall
and so on. Current port sets GOROOT
to ${prefix
} (usually /opt/local
, through GOROOT_FINAL
environment variable during build phase). It's inconvenient, cause we must violate the standard file hierarchy, and do some tricks like #29321.
This patch try to unify the location of GOROOT
. Meanwhile, tell user to set GOBIN
environment variable in their shell profile, cause gomake install
may need this.
Attachments (2)
Change History (9)
Changed 13 years ago by gaochangjian@…
Attachment: | Portfile-go.diff added |
---|
comment:1 follow-up: 3 Changed 13 years ago by jmroot (Joshua Root)
Owner: | changed from macports-tickets@… to singingwolfboy@… |
---|
comment:2 follow-up: 4 Changed 13 years ago by singingwolfboy@…
Resolution: | → wontfix |
---|---|
Status: | new → closed |
The purpose of the standard filesystem layout is to keep files of the same type together: executable files go in the bin directory, libraries go in the lib directory, and so on. Users installing Go (or any other package) from a package management system like Macports shouldn't have to modify their environment to find executables, libraries, and so on. With the notable exception of the apache2 port, all ports in Macports install into this standard hierarchy, and I see no reason to make an exception for Go -- in my opinion, the apache2 port should also be fixed to conform to this standard.
If you would like your Go installation to be in /opt/local/src/go, you can certainly install Go to that directory yourself and change your environment accordingly, but I see no reason to change this for everyone else.
comment:3 Changed 13 years ago by gaochangjian@…
comment:4 Changed 13 years ago by gaochangjian@…
Replying to singingwolfboy@…:
The purpose of the standard filesystem layout is to keep files of the same type together: executable files go in the bin directory, libraries go in the lib directory, and so on. Users installing Go (or any other package) from a package management system like Macports shouldn't have to modify their environment to find executables, libraries, and so on. With the notable exception of the apache2 port, all ports in Macports install into this standard hierarchy, and I see no reason to make an exception for Go -- in my opinion, the apache2 port should also be fixed to conform to this standard.
If you would like your Go installation to be in /opt/local/src/go, you can certainly install Go to that directory yourself and change your environment accordingly, but I see no reason to change this for everyone else.
Actually build Go program won't need header files (*.h) and library files (*.a), they just meaningful during compile Go itself. So you could delete them safely.
As for doc directory, I'll attach another patch file. It place doc in the standard hierarchy (${prefix}/share/doc/go
), then create one symbolic link in GOROOT
. So we could use godoc -http=:6060
command comfortably.
Interesting thing is, another programming language port, Python, place most files in ${prefix}/Library/Frameworks/Python.framework
directory. Maybe the Go port could follow this mode.
Changed 13 years ago by gaochangjian@…
Attachment: | Portfile-go.2.diff added |
---|
place doc in the standard hierarchy
comment:5 follow-up: 6 Changed 13 years ago by singingwolfboy@…
Unless there's a very, very good reason, I don't want the user to have to change their environment in order to use Go. Sounds like the actual issue you're having is that running godoc -http=:6060
doesn't work properly. At the moment, it doesn't appear that the godoc
command accepts any way of changing the path to the Go documentation files: perhaps you should file a bug report with the developers of godoc
requesting this feature.
comment:6 Changed 13 years ago by gaochangjian@…
Replying to singingwolfboy@…:
Unless there's a very, very good reason, I don't want the user to have to change their environment in order to use Go. Sounds like the actual issue you're having is that running
godoc -http=:6060
doesn't work properly. At the moment, it doesn't appear that thegodoc
command accepts any way of changing the path to the Go documentation files: perhaps you should file a bug report with the developers ofgodoc
requesting this feature.
No, it's not about godoc
, but GOROOT
. As you know, Go commands (compiler, linker, godoc
, gomake
, goinstall
etc.) rely heavily on GOROOT
environment variable. So we need set this variable carefully and correctly. My suggestion is to set GOROOT
to ${prefix}/src/${name}/${name}-${version}
, however, maybe we could refer to Python's mode.
P.S. godoc
does accept way of changing the path to the GOROOT
through --goroot
option.
Please remember to cc the maintainer.