Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#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)

Portfile-go.diff (2.8 KB) - added by gaochangjian@… 13 years ago.
Portfile-go.2.diff (2.9 KB) - added by gaochangjian@… 13 years ago.
place doc in the standard hierarchy

Download all attachments as: .zip

Change History (9)

Changed 13 years ago by gaochangjian@…

Attachment: Portfile-go.diff added

comment:1 Changed 13 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to singingwolfboy@…

Please remember to cc the maintainer.

comment:2 Changed 13 years ago by singingwolfboy@…

Resolution: wontfix
Status: newclosed

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 in reply to:  1 Changed 13 years ago by gaochangjian@…

Replying to jmr@…:

Please remember to cc the maintainer.

Sorry for about that, I will next time.

comment:4 in reply to:  2 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 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 in reply to:  5 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 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.

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.

comment:7 Changed 12 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

Note: See TracTickets for help on using tickets.