ack icon indicating copy to clipboard operation
ack copied to clipboard

Failed to compile in CentOS 7

Open dram opened this issue 8 years ago • 7 comments

ACK failed to compile in CentOS 7, following is a snippet of error messages:

/tmp/ack-build/obj/util/ncgg/cggparser/y.tab.h: In function ‘enterkeyw’:
/tmp/ack-build/obj/util/ncgg/cggparser/y.tab.h:161:66: error: ‘ADDR’ undeclared (first use in this function)
 int yyparse ();
                                                                  ^
/tmp/ack-build/obj/util/ncgg/cggparser/y.tab.h:161:66: note: each undeclared identifier is reported only once for ea
ch function it appears in
/tmp/ack-build/obj/util/ncgg/cggparser/y.tab.h:162:71: error: ‘COERCIONS’ undeclared (first use in this function)
 #endif
                                                                       ^
/tmp/ack-build/obj/util/ncgg/cggparser/y.tab.h:163:74: error: ‘INSTRUCTIONS’ undeclared (first use in this function)
 #endif /* ! YYPARSE_PARAM */
                                                                          ^
/tmp/ack-build/obj/util/ncgg/cggparser/y.tab.h:164:65: error: ‘INT’ undeclared (first use in this function)

                                                                 ^
/tmp/ack-build/obj/util/ncgg/cggparser/y.tab.h:165:67: error: ‘MOVES’ undeclared (first use in this function)
 #endif /* !YY_YY_TMP_ACK_BUILD_OBJ_UTIL_NCGG_CGGPARSER_Y_TAB_H_INCLUDED  */
                                                                   ^
/tmp/ack-build/obj/util/ncgg/cggparser/y.tab.h:166:70: error: ‘PATTERNS’ undeclared (first use in this function)

...

dram avatar Jan 15 '17 02:01 dram

It seems that it's caused by old version of Bison (2.7 in CentOS 7), which do not include macro definitions for those constants (only enum definition is included), but util/ncgg/cvtkeywords relys on those macros to work properly.

dram avatar Jan 15 '17 07:01 dram

Complied successfully after I change bison to byacc, I'll close this issue.

dram avatar Jan 15 '17 07:01 dram

Bison 3.0.4 still uses enum, not macros, for the token names. I don't use bison with ack, but this is a parse.c from Ruby:

/* A Bison parser, made by GNU Bison 3.0.4.  */
...
  enum yytokentype
  {
    END_OF_INPUT = 0,
    keyword_class = 258,
    keyword_module = 259,
    keyword_def = 260,
...

Either we should fix ncgg to work with bison, or we should document in the top-level README that yacc can't be bison.

kernigh avatar Jan 17 '17 00:01 kernigh

I found that Bison 3.0.4 does make the token macros, if I run it in yacc mode (bison -y). So ncgg works with bison -y.

kernigh avatar Jan 17 '17 03:01 kernigh

Are there any non-Bison yaccs still around? Could we just switch to bison -y instead?

davidgiven avatar Jan 17 '17 20:01 davidgiven

The other two flavors are Berkeley yacc and System V yacc. I am using OpenBSD's Berkeley yacc. I haven't tried System V yacc; it is part of systems like Solaris and Illumos, or in the Heirloom tools.

I don't see any reason to switch to bison -y.

kernigh avatar Jan 18 '17 05:01 kernigh

I built the current github tree on RHEL 7 with no problem.

Visit http://oberon07/dee/ and click on RPMs for an RPM you can install.

deevans avatar Sep 13 '17 03:09 deevans