[MacPorts] #24661: go-devel: fatal error: can't find import: fmt on MacPorts

MacPorts noreply at macports.org
Thu Apr 29 14:32:37 PDT 2010

#24661: go-devel: fatal error: can't find import: fmt on MacPorts
 Reporter:  tsumekiri@…          |       Owner:  singingwolfboy@…           
     Type:  defect               |      Status:  assigned                   
 Priority:  Normal               |   Milestone:                             
Component:  ports                |     Version:  1.8.2                      
 Keywords:                       |        Port:  go-devel                   

Comment(by singingwolfboy@…):

 It looks like the deeper problem here is that Go does not allow you to
 change the GOBIN location once Go has been compiled (as far as I'm aware).
 As a result, since we compile in `${worksrcpath}/src`, Go's tools are
 going to look for their packages in `${worksrcpath}/pkg` rather than
 looking in `${prefix}`.

 I figured that the best place to keep Go's packages was `lib/gopkg`, since
 Go already has a `lib/godoc` directory. I implemented this in r67125. So
 the workaround to compile Go files is to specify the path to these package
 files with every compilation. For example, with `${prefix}` as

 6g -I /opt/local/lib/gopkg/ hello.go
 6l -L /opt/local/lib/gopkg/ hello.6
 Hello, 世界

 If anyone finds a way to change Go's GOBIN directory after it's been
 built, let me know!

Ticket URL: <http://trac.macports.org/ticket/24661#comment:5>
MacPorts <http://www.macports.org/>
Ports system for Mac OS

More information about the macports-tickets mailing list