Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building go fails: quietgcc not found #178

Closed
gopherbot opened this issue Nov 14, 2009 · 7 comments
Closed

Building go fails: quietgcc not found #178

gopherbot opened this issue Nov 14, 2009 · 7 comments

Comments

@gopherbot
Copy link

by ulrich.hobelmann:

What steps will reproduce the problem?
1. Pull the go source as indicated in http://golang.org/doc/install.html
2. Set the environment variables.
3. Execute ./all.bash in $GOROOT/src

What is the expected output? What do you see instead?
Go should build.  Instead:
[...]
%%%% making lib9 %%%%

quietgcc -ggdb -I/home/ulli/go/include -O2 -fno-inline -c
/home/ulli/go/src/lib9/_p9dir.c
make: quietgcc: Command not found
make: *** [_p9dir.o] Error 127

What is your $GOOS?  $GOARCH?
GOOS=linux, GOARCH=386
Fedora 12, GNU make 3.81, gcc 4.4.2 20091027 (Red Hat 4.4.2-7)

Which revision are you sync'ed to?  (hg log -l 1)
4015

Please provide any additional information below.

$GOBIN is set (~/install/go/bin) and part of $PATH, PATH is exported, and
make even creates the quietgcc file in that directory.  quietgcc is
-rwxrwxr-x and contains valid code.

src $ which quietgcc
~/install/go/bin/quietgcc
src $ ./all.bash
[...]
%%%% making lib9 %%%%

quietgcc -ggdb -I/home/ulli/go/include -O2 -fno-inline -c
/home/ulli/go/src/lib9/_p9dir.c
make: quietgcc: Command not found
make: *** [_p9dir.o] Error 127

I also tried commands like "env PATH=$PATH ./all.bash" or "bash
all.bash",
but they all fail equally.  Specifically, I read issue #19, but it does not
work on my machine.

It may be a make problem (is the file "too new" to be found on the PATH
during make's run?), but I'm not sure.
@rsc
Copy link
Contributor

rsc commented Nov 14, 2009

Comment 1:

That's surprising.  My only theory is that make is reading some
system config file and overriding the path you've specified.
You might try tracing make to see what it is reading and see
where it is looking for quietgcc.
cd $GOROOT/src/lib9
strace -f -v -e execve,open -s 1024 make _p9dir.o
This will show every call to execve and open, which
will show what make is trying to execute as well as
what files it opened.

Owner changed to r...@golang.org.

Status changed to WaitingForReply.

@gopherbot
Copy link
Author

Comment 2 by ulrich.hobelmann:

Thanks for the pointer!  I'm now a happy owner of an 8g executable.
[...]
[pid 17927] execve("~/install/go/bin/quietgcc", ["quietgcc", "-ggdb", "-I/home/u
lli/go/include", "-O2", "-fno-inline", "-c", "/home/ulli/go/src/lib9/_p9dir.c"]
[...]
= -1 ENOENT (No such file or directory)
It seems that the execve() call does not use the full path with ~ expanded to the
value of $HOME.  Since it is (I presume) "make" that makes the system call, there
probably is no bug in "go".
Replacing the ~/install/go/bin entry in my PATH with the full, explicit path solved
the problem.  (Yet I've never needed to do that until now.)  $GOBIN has always
pointed to the explicit path value, which again I interpret as this not being a "go"
specific problem.
Anyway, the install instructions should probably mention that $PATH always needs to
include the full path, so others will not encounter the same problem.  Whom should I
email for that?

@gopherbot
Copy link
Author

Comment 3 by ulrich.hobelmann:

Um, and how do I close this bug now?

@rsc
Copy link
Contributor

rsc commented Nov 14, 2009

Comment 4:

Glad you found the problem.  We'll look at warning about this in the documentation.

Status changed to Retracted.

@gopherbot
Copy link
Author

Comment 5 by nerocrux:

ulrich.hobelmann,
Sorry for bothering
I have encountered this problem exactly as you do and I still cannot figure out how
to solve this problem...
[Replacing the ~/install/go/bin entry in my PATH with the full, explicit path solved
the problem.]
I'm new to linux and I wonder if you can tell me how exactly you solved the problem.
Thanks in advance.
nerocrux

@rsc
Copy link
Contributor

rsc commented Nov 23, 2009

Comment 6:

> [Replacing the ~/install/go/bin entry in my PATH with the full, explicit
> path solved
> the problem.]
> I'm new to linux and I wonder if you can tell me how exactly you solved the
> problem.
The problem in this bug was that the original poster used
PATH=$PATH:~/install/go/bin
instead of
PATH=$PATH:/home/you/install/go/bin
(or whatever the home directory is).  You apparently
do need to spell out the home directory instead of 
using the ~ syntax.  The latter is not a real file name,
just a shorthand often but not always interpreted by the shell.
The shell will probably meet you halfway if you want to
write $HOME/install/go/bin instead.

@gopherbot
Copy link
Author

Comment 7:

CL https://golang.org/cl/118310043 mentions this issue.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants