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

flex-2.6.0 introduced bison dependency #49

Closed
0-wiz-0 opened this issue Jan 8, 2016 · 4 comments
Closed

flex-2.6.0 introduced bison dependency #49

0-wiz-0 opened this issue Jan 8, 2016 · 4 comments
Assignees
Milestone

Comments

@0-wiz-0
Copy link
Contributor

0-wiz-0 commented Jan 8, 2016

Since 2.6.0, flex now needs bison during build.
Before that, at least on NetBSD, yacc was enough.

The error I see is

gmake[1]: Entering directory '/scratch/devel/flex/work/flex-2.6.0/tests'
/bin/sh ../build-aux/ylwrap bison_nr_parser.y y.tab.c bison_nr_parser.c y.tab.h `echo bison_nr_parser.c | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/` y.output bison_nr_parser.output -- yacc -d -p test
yacc: e - line 81 of "/scratch/devel/flex/work/flex-2.6.0/tests/bison_nr_parser.y", syntax error
        if( $1 != @1.first_line || $1 != testget_lineno())
                  ^
Makefile:2075: recipe for target 'bison_nr_parser.c' failed
gmake[1]: *** [bison_nr_parser.c] Error 1
../src/flex -o bison_nr_scanner.c bison_nr_scanner.l
/bin/sh ../build-aux/ylwrap bison_yylloc_parser.y y.tab.c bison_yylloc_parser.c y.tab.h `echo bison_yylloc_parser.c | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/` y.output bison_yylloc_parser.output -- yacc -d -p test
yacc: e - line 83 of "/scratch/devel/flex/work/flex-2.6.0/tests/bison_yylloc_parser.y", syntax error
        if( $1 != @1.first_line || $1 != testget_lineno(scanner))
                  ^
Makefile:2075: recipe for target 'bison_yylloc_parser.c' failed
gmake[1]: *** [bison_yylloc_parser.c] Error 1
../src/flex -o bison_yylloc_scanner.c bison_yylloc_scanner.l
/bin/sh ../build-aux/ylwrap bison_yylval_parser.y y.tab.c bison_yylval_parser.c y.tab.h `echo bison_yylval_parser.c | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/` y.output bison_yylval_parser.output -- yacc -d -p test
updating bison_yylval_parser.h

This is a problem because bison currently depends on flex, so we have
a dependency cycle.

As a workaround, I've locally disabled the bison tests:

--- tests/Makefile.in.orig  2015-11-17 16:19:46.000000000 +0000
+++ tests/Makefile.in
@@ -131,8 +131,8 @@ CONFIG_HEADER = $(top_builddir)/src/conf
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 am__EXEEXT_1 = alloc_extra$(EXEEXT) array_nr$(EXEEXT) array_r$(EXEEXT) \
-   basic_nr$(EXEEXT) basic_r$(EXEEXT) bison_nr$(EXEEXT) \
-   bison_yylloc$(EXEEXT) bison_yylval$(EXEEXT) c_cxx_nr$(EXEEXT) \
+   basic_nr$(EXEEXT) basic_r$(EXEEXT) \
+   c_cxx_nr$(EXEEXT) \
    c_cxx_r$(EXEEXT) ccl$(EXEEXT) cxx_basic$(EXEEXT) \
    cxx_multiple_scanners$(EXEEXT) debug_nr$(EXEEXT) \
    debug_r$(EXEEXT) extended$(EXEEXT) header_nr$(EXEEXT) \
@@ -1440,12 +1440,6 @@ string_r_SOURCES = string_r.l
 top_SOURCES = top.l top_main.c
 yyextra_SOURCES = yyextra.l
 BUILT_SOURCES = \
-   bison_nr_parser.h \
-   bison_nr_scanner.h \
-   bison_yylloc_parser.h \
-   bison_yylloc_scanner.h \
-   bison_yylval_parser.h \
-   bison_yylval_scanner.h \
    header_nr_scanner.h \
    header_r_scanner.h \
    multiple_scanners_nr_1.h \

Perhaps the configure script can test for bison availability and only
enable the tests in case bison is indeed available.

@westes westes modified the milestones: .7.02, 2.7.0 Feb 24, 2016
@westes westes self-assigned this Feb 24, 2016
@westes westes modified the milestone: 2.7.0 Mar 12, 2016
@westes
Copy link
Owner

westes commented Oct 6, 2016

What target are you running when you get this? The test suite shouldn't build unless you to make check or similar. if it's from "make" then that's a bug.

@westes
Copy link
Owner

westes commented Oct 6, 2016

Ah, it's BUILT_SOURCES causing these files to be built with make all.

@westes
Copy link
Owner

westes commented Oct 6, 2016

So there are two bugs that need to be adressed:

  • disable bison tests if bison is not present
  • get everything out of BUILT_SOURCES in the test suite since make all will trigger that.

@westes
Copy link
Owner

westes commented Jan 25, 2017

This is now fixed on master and will be included in the next release.

@westes westes closed this as completed Jan 25, 2017
eric-s-raymond added a commit to eric-s-raymond/flex that referenced this issue Oct 1, 2020
Now that all the mode conditionals are visible early, wverything that
used to be done in the prolog can be done as conditionalized code in the
skeleton.

Whitespace and comment diffs only.

westes#49 in the retargeting patch series
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants