Installation problems: $GOROOT is not set correctly or not exported

649 views
Skip to first unread message

inigoini

unread,
Nov 11, 2009, 12:18:24 PM11/11/09
to golang-nuts
If I try to run ./all.bash I get the next message: make.bash: line
41: /usr/local/bin/quietgcc: Permiso denegado

Then I try to run sudo ./all.bash and I get the next message: $GOROOT
is not set correctly or not exported

Please help me,

thanks

Sebastian Koch

unread,
Nov 11, 2009, 12:35:03 PM11/11/09
to inigoini, golang-nuts
Did you put export GOROOT=path_to_go in your .bashrc ?

Adam Langley

unread,
Nov 11, 2009, 12:39:13 PM11/11/09
to inigoini, golang-nuts
On Wed, Nov 11, 2009 at 9:18 AM, inigoini <inig...@gmail.com> wrote:
> Then I try to run  sudo ./all.bash and I get the next message: $GOROOT
> is not set correctly or not exported

$GOROOT needs to be the directory of your source tree. (i.e.
$GOROOT/src/make.bash should exist).

$GOBIN (defaults to $HOME/bin) needs to exist, we writeable and be in your PATH.


AGL

Patrick O'Doherty

unread,
Nov 11, 2009, 1:05:51 PM11/11/09
to golang-nuts
I have set $GOROOT as the directory containing the go source and
$GOROOT/src/make.bash exists yet when I try and run the installer I
get the following error $GOROOT is not set correctly or not exported.
Running without sudo gives a permissions error when trying to run
quietgcc.

Any suggestions appreciated

Patrick

On Nov 11, 5:39 pm, Adam Langley <a...@golang.org> wrote:

Hui Chen

unread,
Nov 11, 2009, 3:13:17 PM11/11/09
to golang-nuts
you must have $GOROOT exported for root to install the binaries to /
usr/local/bin

add it in the root user's .bashrc
or
set $GOBIN to a folder that your normal non-root user has written
privilege.

mal

unread,
Nov 11, 2009, 4:34:54 PM11/11/09
to golang-nuts
on OS/X Snow Leopard I couldn't install it either - there were several
problems. First I had to use a different temp folder because GO didn't
like that mine had a trailing /. Then I tried running the contents of
the all.bash individually as sudo and got your problem $GOROOT is not
set correctly. You have to add the GO* environment variables to /etc/
sudoers (Defaults env_keep += "GOROOT GOBIN GOOS GOBIN GOARCH") so
they are maintained when you run sudo. Then I ran sudo ./all.bash and
got further - now I have a failing test.


rm -f _test/os.a
gopack grc _test/os.a _gotest_.6
--- FAIL: os_test.TestRemoveAll
RemoveAll "_obj/_TestRemoveAll_" succeeded with chmod 0 subdirectory?
(extra *os.PathError=lstat _obj/_TestRemoveAll_: no such file or
directory)
FAIL
make[1]: *** [test] Error 1
make: *** [os.test] Error 2


On Nov 11, 11:05 am, "Patrick O'Doherty" <patr...@patrickodoherty.com>
wrote:
> I have set $GOROOTas the directory containing the go source and
> $GOROOT/src/make.bash exists yet when I try and run the installer I
> get the following error $GOROOTis not set correctly or not exported.
> Running without sudo gives a permissions error when trying to run
> quietgcc.
>
> Any suggestions appreciated
>
> Patrick
>
> On Nov 11, 5:39 pm, Adam Langley <a...@golang.org> wrote:
>
>
>
> > On Wed, Nov 11, 2009 at 9:18 AM, inigoini <inigo...@gmail.com> wrote:
> > > Then I try to run  sudo ./all.bash and I get the next message: $GOROOT
> > > isnotset correctly ornotexported
>
> > $GOROOTneeds to be the directory of your source tree. (i.e.

Wilson MacGyver

unread,
Nov 11, 2009, 4:38:42 PM11/11/09
to mal, golang-nuts
I must be very lucky. It worked for me on snow leopard for the first try.

as for the failing test, if you have firewall turned on that's why.
one of the tests is using go's own DNS resolver. It's being blocked
by firewall because it uses UDP.

--
Omnem crede diem tibi diluxisse supremum.

inig...@gmail.com

unread,
Nov 11, 2009, 5:14:01 PM11/11/09
to golang-nuts
Thank you very much


But I have now another problem when I execute ./all.bash
The shell prints this at the end of the execution:

main.go hello fib chain run.out
cgo file.go
could not determine kind of name for C.puts
could not determine kind of name for C.CString
could not determine kind of name for C.fflushstdout
could not determine kind of name for C.free
throw: runtime·mapaccess1: key not in map

panic PC=0x40081c38
throw+0x46 /home/inigo/go-hg/src/pkg/runtime/runtime.c:74
throw(0x80c5403, 0x40081c70)
runtime·mapaccess1+0x6c /home/inigo/go-hg/src/pkg/runtime/hashmap.c:769
runtime·mapaccess1(0x4004a6e0, 0x400405c8)
main·*Prog·loadDebugInfo+0xd83 /home/inigo/go-hg/src/cmd/cgo/gcc.go:164
main·*Prog·loadDebugInfo(0x4004a500, 0x56)
main·main+0x36a /home/inigo/go-hg/src/cmd/cgo/main.go:66
main·main()
mainstart+0xf /home/inigo/go-hg/src/pkg/runtime/386/asm.s:81
mainstart()
goexit /home/inigo/go-hg/src/pkg/runtime/proc.c:135
goexit()
make: *** [file.cgo1.go] Error 2

Thanks again


El , inigoini <inig...@gmail.com> escribió:

Russ Cox

unread,
Nov 11, 2009, 5:49:38 PM11/11/09
to inig...@gmail.com, golang-nuts
> panic PC=0x40081c38
> throw+0x46 /home/inigo/go-hg/src/pkg/runtime/runtime.c:74
> throw(0x80c5403, 0x40081c70)
> runtime·mapaccess1+0x6c /home/inigo/go-hg/src/pkg/runtime/hashmap.c:769
> runtime·mapaccess1(0x4004a6e0, 0x400405c8)
> main·*Prog·loadDebugInfo+0xd83 /home/inigo/go-hg/src/cmd/cgo/gcc.go:164
> main·*Prog·loadDebugInfo(0x4004a500, 0x56)

We haven't fixed this yet, but you can track the progress at
http://code.google.com/p/go/issues/detail?id=21

Russ

Ian Lance Taylor

unread,
Nov 11, 2009, 6:26:37 PM11/11/09
to mal, golang-nuts
mal <mala...@gmail.com> writes:

> on OS/X Snow Leopard I couldn't install it either - there were several
> problems. First I had to use a different temp folder because GO didn't
> like that mine had a trailing /. Then I tried running the contents of
> the all.bash individually as sudo and got your problem $GOROOT is not
> set correctly. You have to add the GO* environment variables to /etc/
> sudoers (Defaults env_keep += "GOROOT GOBIN GOOS GOBIN GOARCH") so
> they are maintained when you run sudo. Then I ran sudo ./all.bash and
> got further - now I have a failing test.
>
>
> rm -f _test/os.a
> gopack grc _test/os.a _gotest_.6
> --- FAIL: os_test.TestRemoveAll
> RemoveAll "_obj/_TestRemoveAll_" succeeded with chmod 0 subdirectory?
> (extra *os.PathError=lstat _obj/_TestRemoveAll_: no such file or
> directory)
> FAIL
> make[1]: *** [test] Error 1
> make: *** [os.test] Error 2

That happens if you runt the tests as root, which I don't really
recommend. In any case, at this point the compiler and libraries have
been built and installed, and you can use them.

Ian

inigo i

unread,
Nov 12, 2009, 10:33:43 AM11/12/09
to golang-nuts
Thnks to everybody,

I can compile and run the hello world.

This days I'll try to write any interesting thing.

See you, Thanks


2009/11/11 inigoini <inig...@gmail.com>

attilacsordas

unread,
Nov 13, 2009, 2:16:27 AM11/13/09
to golang-nuts
Hi,

tried to install go on Mac OS X 10.4.11 and ran ./all.bash and got the
following failed test output:

/usr/include/stdio.h:269: error: conflicting types for 'ccgetc'
/Users/admin/go/src/cmd/cc/cc.h:577: error: previous declaration of
'ccgetc' was here
make: *** [y.tab.o] Error 1
make: *** Waiting for unfinished jobs....

Any clues?

thanks,
Attila Csordas

On Nov 12, 4:33 pm, inigo i <inigo...@gmail.com> wrote:
> Thnks to everybody,
>
> I can compile and run the hello world.
>
> This days I'll try to write any interesting thing.
>
> See you, Thanks
>
> 2009/11/11 inigoini <inigo...@gmail.com>

Sebastian Koch

unread,
Nov 13, 2009, 2:23:48 AM11/13/09
to attilacsordas, golang-nuts

attilacsordas

unread,
Nov 13, 2009, 3:27:02 AM11/13/09
to golang-nuts
Hey,

thx for letting me know that Go is not running on Tiger,

finally Go is up&running on Mac OS X 10.5.8 :)

Attila
Reply all
Reply to author
Forward
0 new messages