-
Notifications
You must be signed in to change notification settings - Fork 17.3k
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
All.bash exits with "opnames" undeclared error #406
Labels
Comments
Do you have ed installed? Owner changed to r...@golang.org. Status changed to WaitingForReply. |
Okay, interesting. Try cd $GOROOT/src/cmd/gc ./mkopnames and see if it produces any output. It should print something like // auto generated by mkopnames static char* opnames[] = { [OADD] = "ADD", [OADDR] = "ADDR", [OADDSTR] = "ADDSTR", [OAND] = "AND", [OANDAND] = "ANDAND", [OANDNOT] = "ANDNOT", [OAPPENDSTR] = "APPENDSTR", [OARRAY] = "ARRAY", [OARRAYBYTESTR] = "ARRAYBYTESTR", [OARRAYLIT] = "ARRAYLIT", [OARRAYRUNESTR] = "ARRAYRUNESTR", ... }; |
Yep, here is the output: seth@server:~/go/src/cmd/gc$ ./mkopnames // auto generated by mkopnames static char* opnames[] = { [OADD] = "ADD", [OADDR] = "ADDR", [OADDSTR] = "ADDSTR", [OAND] = "AND", [OANDAND] = "ANDAND", [OANDNOT] = "ANDNOT", [OAPPENDSTR] = "APPENDSTR", [OARRAY] = "ARRAY", [OARRAYBYTESTR] = "ARRAYBYTESTR", [OARRAYLIT] = "ARRAYLIT", [OARRAYRUNESTR] = "ARRAYRUNESTR", [OAS] = "AS", [OAS2] = "AS2", [OAS2DOTTYPE] = "AS2DOTTYPE", [OAS2FUNC] = "AS2FUNC", [OAS2MAPR] = "AS2MAPR", [OAS2MAPW] = "AS2MAPW", [OAS2RECV] = "AS2RECV", [OASOP] = "ASOP", [OBAD] = "BAD", [OBLOCK] = "BLOCK", [OBREAK] = "BREAK", [OCALL] = "CALL", [OCALLFUNC] = "CALLFUNC", [OCALLINTER] = "CALLINTER", [OCALLMETH] = "CALLMETH", [OCAP] = "CAP", [OCASE] = "CASE", [OCLOSE] = "CLOSE", [OCLOSED] = "CLOSED", [OCLOSURE] = "CLOSURE", [OCMP] = "CMP", [OCMPIFACE] = "CMPIFACE", [OCMPSTR] = "CMPSTR", [OCOM] = "COM", [OCOMPLIT] = "COMPLIT", [OCONTINUE] = "CONTINUE", [OCONV] = "CONV", [OCONVIFACE] = "CONVIFACE", [OCONVNOP] = "CONVNOP", [OCONVSLICE] = "CONVSLICE", [OCOPY] = "COPY", [ODCL] = "DCL", [ODCLCONST] = "DCLCONST", [ODCLFIELD] = "DCLFIELD", [ODCLFUNC] = "DCLFUNC", [ODCLTYPE] = "DCLTYPE", [ODEC] = "DEC", [ODEFER] = "DEFER", [ODIV] = "DIV", [ODOT] = "DOT", [ODOTINTER] = "DOTINTER", [ODOTMETH] = "DOTMETH", [ODOTPTR] = "DOTPTR", [ODOTTYPE] = "DOTTYPE", [OEMPTY] = "EMPTY", [OEQ] = "EQ", [OEXTEND] = "EXTEND", [OFALL] = "FALL", [OFOR] = "FOR", [OGE] = "GE", [OGOTO] = "GOTO", [OGT] = "GT", [OHMUL] = "HMUL", [OIF] = "IF", [OINC] = "INC", [OIND] = "IND", [OINDEX] = "INDEX", [OINDEXMAP] = "INDEXMAP", [OINDEXSTR] = "INDEXSTR", [OINDREG] = "INDREG", [OIOTA] = "IOTA", [OKEY] = "KEY", [OLABEL] = "LABEL", [OLE] = "LE", [OLEN] = "LEN", [OLITERAL] = "LITERAL", [OLRC] = "LRC", [OLSH] = "LSH", [OLT] = "LT", [OMAKE] = "MAKE", [OMAKECHAN] = "MAKECHAN", [OMAKEMAP] = "MAKEMAP", [OMAKESLICE] = "MAKESLICE", [OMAPLIT] = "MAPLIT", [OMINUS] = "MINUS", [OMOD] = "MOD", [OMUL] = "MUL", [ONAME] = "NAME", [ONE] = "NE", [ONEW] = "NEW", [ONONAME] = "NONAME", [ONOT] = "NOT", [OOR] = "OR", [OOROR] = "OROR", [OPACK] = "PACK", [OPANIC] = "PANIC", [OPANICN] = "PANICN", [OPARAM] = "PARAM", [OPLUS] = "PLUS", [OPRINT] = "PRINT", [OPRINTN] = "PRINTN", [OPROC] = "PROC", [ORANGE] = "RANGE", [ORECV] = "RECV", [OREGISTER] = "REGISTER", [ORETURN] = "RETURN", [ORRC] = "RRC", [ORSH] = "RSH", [ORUNESTR] = "RUNESTR", [OSELECT] = "SELECT", [OSELRECV] = "SELRECV", [OSEND] = "SEND", [OSENDNB] = "SENDNB", [OSLICE] = "SLICE", [OSLICEARR] = "SLICEARR", [OSLICESTR] = "SLICESTR", [OSTRUCTLIT] = "STRUCTLIT", [OSUB] = "SUB", [OSWITCH] = "SWITCH", [OTARRAY] = "TARRAY", [OTCHAN] = "TCHAN", [OTFUNC] = "TFUNC", [OTINTER] = "TINTER", [OTMAP] = "TMAP", [OTSTRUCT] = "TSTRUCT", [OTYPE] = "TYPE", [OTYPECASE] = "TYPECASE", [OTYPESW] = "TYPESW", [OXCASE] = "XCASE", [OXDOT] = "XDOT", [OXFALL] = "XFALL", [OXOR] = "XOR", [OXXX] = "XXX", }; |
However, after running that $GOROOT/src/all.bash still exits with the same error. Complete log attached. Additional error(s): conflicts: 3 shift/reduce /bin/sh: ./mkbuiltin: Permission denied go.y:977.9-980.9: warning: rule useless in parser due to conflicts: non_expr_type: '(' non_expr_type ')' make: *** [subr.o] Error 1 make: *** Waiting for unfinished jobs.... Attachments:
|
This is very strange. You've run into at least three seemingly unrelated problems. 1. It looks like maybe the first attempt at building opnames.h failed, and because make clean doesn't delete it (I'll fix that), all.bash doesn't try to recreate it. Open $GOROOT/src/cmd/gc/opnames.h. It should look like the output you pasted in earlier. If it doesn't, try doing cd $GOROOT/src/cmd/gc rm opnames.h make opnames.h and see if that makes it look better. 2. I don't see this in the log.txt you uploaded, but your message said that you had this error: /bin/sh: ./mkbuiltin: Permission denied This makes it look like either you don't have an executable /bin/sh (pretty unlikely) or /bin/sh cannot open ./mkbuiltin (also unlikely). Try to run cd $GOROOT/src/cmd/gc ./mkbuiltin by hand and see if it runs ok. If not, that's another thing to debug. But your log.txt makes it look like mkbuiltin ran okay. 3. Bison seems to be misbehaving on the input grammar. conflicts: 3 shift/reduce go.y:977.9-980.9: warning: rule useless in parser due to conflicts: non_expr_type: '(' non_expr_type ')' This shouldn't happen - there should be no shift/reduce conflicts reported by bison. What version of bison do you have (bison --version)? My Ubuntu system says Bison 2.3. Another user had a problem where there was another program called Bison++ installed instead of Bison, and that program wasn't quite implementing the right parsing algorithms. In that case, though, it compiled and just produced different syntax errors. #1 and #2 might both be explained by your Mercurial checkout for some reason dropping the executable bits on the scripts and then you having to fix them up by hand. Did something like that happen? |
I get the same for #3: > bison -V bison (GNU Bison) 2.4.1 Written by Robert Corbett and Richard Stallman. Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > bison --report-file=/tmp/report -v -y -d go.y go.y:950.9-953.9: warning: rule useless in parser due to conflicts: non_expr_type: '(' non_expr_type ')' Additionally: > bison --report-file=/tmp/report -v -y -d cc.y conflicts: 3 shift/reduce Attached are report files in case that's useful. Attachments:
|
1. It was blank when I viewed it, so after following these instructions the file seems normal now. 2. seth@server:~/go/src/cmd/gc$ ./mkbuiltin -bash: ./mkbuiltin: Permission denied 3. seth@server:~/go/src/cmd/gc$ bison --version bison (GNU Bison) 2.4 Written by Robert Corbett and Richard Stallman. Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > #1 and #2 might both be explained by your Mercurial checkout > for some reason dropping the executable bits on the scripts > and then you having to fix them up by hand. Did something > like that happen? I didn't modify any files. I simply checked as stated in <http://golang.org/doc/install.html>;: hg clone -r release https://go.googlecode.com/hg/ Except I had to checkout on my own (Windows) machine, then upload the files to the machine that has the problem because Mercurial would not install there. Attached new log file reflecting changes. ***NOTE*** Apparently when logging the text of all.bash I typed the wrong syntax, which left stderr from being redirected to the file. This new log contains both stdout and stderr. |
1. It was blank when I viewed it, so after following these instructions the file seems normal now. 2. seth@server:~/go/src/cmd/gc$ ./mkbuiltin -bash: ./mkbuiltin: Permission denied 3. seth@server:~/go/src/cmd/gc$ bison --version bison (GNU Bison) 2.4 Written by Robert Corbett and Richard Stallman. Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > #1 and #2 might both be explained by your Mercurial checkout > for some reason dropping the executable bits on the scripts > and then you having to fix them up by hand. Did something > like that happen? I didn't modify any files. I simply checked as stated in <http://golang.org/doc/install.html>;: hg clone -r release https://go.googlecode.com/hg/ Except I had to checkout on my own (Windows) machine, then upload the files to the machine that has the problem because Mercurial would not install there. Attached new log file reflecting changes. ***NOTE*** Apparently when logging the text of all.bash I typed the wrong syntax, which left stderr from being redirected to the file. This new log contains both stdout and stderr. Attachments:
|
> I didn't modify any files. I simply checked as stated in > <http://golang.org/doc/install.html>;: > > hg clone -r release https://go.googlecode.com/hg/ > > Except I had to checkout on my own (Windows) machine, then upload > the files to the machine that has the problem because Mercurial > would not install there. I think this is your problem. The checkout on windows discards many of the important permission bits, and then the build doesn't run cleanly. Mercurial should install fine on any Linux box; there is a Debian package, or you can use easy_install. I think if you install check the tree out using Mercurial on Linux, you will find that it works much better. Russ |
I was also experiencing this issue on one machine because I had exported "GREP_OPTIONS=--color=always" in my environment, thus corrupting the opnames.h created by the mkopnames script. In my case, I fixed it by switching to the much more sane "GREP_OPTIONS=-- color=auto" instead. But to prevent others from being tripped up in the same way we could patch every occurrence of 'grep' in the build scripts with 'GREP_OPTIONS= grep'. Please let me know if you'd like a CL for that. |
This issue was closed by revision 1ca39fb. Status changed to Fixed. Merged into issue #-. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by srlegoking:
The text was updated successfully, but these errors were encountered: