goinstall install failed on GOPATH

448 views
Skip to first unread message

dlin

unread,
Aug 16, 2011, 11:44:06 AM8/16/11
to golang-nuts
I don't have root permission, but want to install package.

So,

export GOPATH=$HOME/gocode
goinstall -v -clean github.com/ajstarks/svgo

and I found $HOME/gocode/pkg/linux_386/github.com/ajstarks/svgo.a

But, I don't know why my program can not find the svgo library by
import it.

import "github.com/ajstarks/svgo"

the install log here
---------------------
goinstall: github.com/ajstarks/svgo: download
goinstall: /: /usr/bin/git clone http://github.com/ajstarks/svgo.git /
home/dlin/gocode/src/github.com/ajstarks/svgo


goinstall: /home/dlin/gocode/src/github.com/ajstarks/svgo: /usr/bin/
git show-ref release
/usr/bin/git: === cd /home/dlin/gocode/src/github.com/ajstarks/svgo;
git show-ref release
--- exit status 1
goinstall: /home/dlin/gocode/src/github.com/ajstarks/svgo: /usr/bin/
git pull
goinstall: strings: skipping standard library
goinstall: os: skipping standard library
goinstall: fmt: skipping standard library
goinstall: io: skipping standard library
goinstall: xml: skipping standard library
goinstall: /home/dlin/gocode/src/github.com/ajstarks/svgo: /bin/bash
gomake -f- clean install
goinstall: open /usr/lib/go/goinstall.log: permission denied



ajstarks

unread,
Aug 16, 2011, 1:38:30 PM8/16/11
to golan...@googlegroups.com
what is the error you are seeing in your program?  Can you post a simple example?

Andrew Gerrand

unread,
Aug 16, 2011, 4:17:55 PM8/16/11
to golan...@googlegroups.com
It looks like svgo is installed correctly, but how are you building your program?

Goinstall is the only build tool that understands GOPATH. If you are building your Go program with make, it won't work. Put your program in $GOPATH/src/dlin/foo and run "goinstall dlin/foo" to build it.

Andrew

dlin

unread,
Aug 16, 2011, 7:30:46 PM8/16/11
to golang-nuts
Andrew, you are right.

I use make to make my program and my programs on other directory.

I'll try your method.
But, It is a little difficult. Because I use many Makefile function.

dlin

unread,
Aug 17, 2011, 1:06:23 AM8/17/11
to golang-nuts
Why just goinstall support GOPATH?

Will the default compiler, link support GOPATH in the future?

On 8月17日, 上午4時17分, Andrew Gerrand <a...@golang.org> wrote:

Daniel Lin

unread,
Aug 17, 2011, 1:08:38 AM8/17/11
to golang-nuts
What's goc?

2011/8/17 ajstarks <ajst...@gmail.com>
Note that if your program is simple, you can just do:

goc foo 

to build from and executable foo from foo.go, where goc is something like:

     6g -I . $i.go && 6l -L . -o $i $i.6 

(change 6g  and 6l to the compiler and linker that you use)

Also, you can use goplay as described in http://mindchunk.blogspot.com/2011/05/svgo-and-google-web-fonts.html to interactively build and see the pictures that your program draws.



On Tuesday, August 16, 2011 7:30:46 PM UTC-4, dlin wrote:
Andrew, you are right.

I use make to make my program and my programs on other directory.

I'll  try your method.
But, It is a little difficult.  Because I use many Makefile function.

unread,
Aug 17, 2011, 1:10:27 AM8/17/11
to golang-nuts
The goinstall tool uses GCIMPORTS and LDIMPORTS internally. So, this
should work (haven't tried it myself):

export GOPATH=$HOME/gocode
export GCIMPORTS="-I $GOPATH"
export LDIMPORTS="-L $GOPATH"
make

Andrew Gerrand

unread,
Aug 17, 2011, 2:07:51 AM8/17/11
to golan...@googlegroups.com
We intend to replace the 'gomake' shell script (which invokes make) with a version of goinstall.

If you want to use Make with a GOPATH you can use the technique described by \xe2\x9a\x9b with GCIMPORTS and LDIMPORTS, but that won't be supported forever.

Make isn't great. We're trying to get rid of it.

Andrew

John Asmuth

unread,
Aug 17, 2011, 9:18:57 AM8/17/11
to golan...@googlegroups.com
go-gb.googlecode.com also supports GOPATH.

Daniel Lin

unread,
Aug 17, 2011, 10:11:32 AM8/17/11
to golang-nuts
1. It is successful when I move the svgo_ex.go to $GOPATH's subdirectory. And use 'goinstall' to install.

2. It is failed by manual keyin command.

  8g -I . svgo_ex.go && 8l -L . -o svgo_ex svgo_ex.8
svgo_ex.go:4: can't find import: github.com/ajstarks/svgo


2011/8/17 Anthony Starks <ajst...@gmail.com>
no.  just copy:

#!/bin/sh
for i in $*
do
6g -I . $i.go && 6l -L . -o $i $i.6 
done

into a file, call it goc, make it executable, place it in your PATH.

On Aug 17, 2011, at 7:56 AM, Daniel Lin wrote:

Do u mean u have sent attachment file goc?

2011-8-17 下午7:18 於 "Anthony Starks" <ajst...@gmail.com> 寫道:
> goc is a shell script that you must write. I sent an example.

>
> On Aug 17, 2011, at 1:08 AM, Daniel Lin wrote:
>
>> What's goc?
>>
>> 2011/8/17 ajstarks <ajst...@gmail.com>
>> Note that if your program is simple, you can just do:
>>
>> goc foo
>>
>> to build from and executable foo from foo.go, where goc is something like:
>>
>> 6g -I . $i.go && 6l -L . -o $i $i.6
>>
>> (change 6g and 6l to the compiler and linker that you use)
>>
>> Also, you can use goplay as described in http://mindchunk.blogspot.com/2011/05/svgo-and-google-web-fonts.html to interactively build and see the pictures that your program draws.
>>
>>
>>
>> On Tuesday, August 16, 2011 7:30:46 PM UTC-4, dlin wrote: 8g -I . svgo_ex.go && 8l -L . -o svgo_ex svgo.8
svgo_ex.go:4: can't find import: github.com/ajstarks/svgo
Reply all
Reply to author
Forward
0 new messages