Bug 67398

Summary: error: 'scanner' was not declared in this scope
Product: Mesa Reporter: Alexandre Demers <alexandre.f.demers>
Component: glsl-compilerAssignee: Ian Romanick <idr>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: medium CC: maxijac
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Alexandre Demers 2013-07-27 13:57:43 UTC
Since yesterday, I'm getting the following error when building mesa from git

make[4]: Entering directory `/home/dema1701/projects/display/mesa/src/glsl/builtin_compiler'
  CXX      glsl_parser.lo
glsl_parser.cpp: In function 'int _mesa_glsl_parse(_mesa_glsl_parse_state*)':
glsl_parser.cpp:2616:41: error: 'scanner' was not declared in this scope
make[4]: *** [glsl_parser.lo] Error 1
Comment 1 Bruno Jacquet (Xaapyks) 2013-07-28 14:05:55 UTC
I'm getting this too since some days.
I tried to bisect, but it does not seem to be related to mesa since old commits do not build for me anymore.
So IMO it's either one of the depends or build switches that I mayu have changed...
Comment 2 Bruno Jacquet (Xaapyks) 2013-07-28 14:13:08 UTC
OK, so this is caused by bison 3.
Downgrading to bison 2.7 fixes the build.
Comment 3 Alexandre Demers 2013-07-28 14:17:52 UTC
(In reply to comment #1)
> I'm getting this too since some days.
> I tried to bisect, but it does not seem to be related to mesa since old
> commits do not build for me anymore.
> So IMO it's either one of the depends or build switches that I mayu have
> changed...

I'm experiencing the same thing: older commits that were building can't be built anymore. My system also uses bison 3 now. It may have been upgraded in the last week (Arch Linux 64).
Comment 4 Bruno Jacquet (Xaapyks) 2013-07-28 14:22:23 UTC
(In reply to comment #3)
> (In reply to comment #1)
> > I'm getting this too since some days.
> > I tried to bisect, but it does not seem to be related to mesa since old
> > commits do not build for me anymore.
> > So IMO it's either one of the depends or build switches that I mayu have
> > changed...
> 
> I'm experiencing the same thing: older commits that were building can't be
> built anymore. My system also uses bison 3 now. It may have been upgraded in
> the last week (Arch Linux 64).

Yes, just downgrade to 2.7 (I can send you the package if needed) and it works again.

Now, where is the bug? In bison or mesa? Both?
Comment 5 Bruno Jacquet (Xaapyks) 2013-07-28 23:23:39 UTC
Bison 3 has several warning when using -W :
$ bison  -o glsl_parser.cpp -p "_mesa_glsl_" --defines=../../src/glsl/glsl_parser.h glsl_parser.yy -W
glsl_parser.yy:270.18: avertissement: règle vide sans %empty [-Wempty-rule]
 version_statement:
                  ^
glsl_parser.yy:306.25: avertissement: règle vide sans %empty [-Wempty-rule]
 extension_statement_list:
                         ^
glsl_parser.yy:884.4-886.4: avertissement: règle vide sans %empty [-Wempty-rule]
    {
    ^
glsl_parser.yy:1989.4-1991.4: avertissement: règle vide sans %empty [-Wempty-rule]
    {
    ^
glsl_parser.yy:2194.4-2197.4: avertissement: règle vide sans %empty [-Wempty-rule]
    {
    ^

Whereas using the same command with bison 2.7 produces absolutely no warning output.
Comment 6 Bruno Jacquet (Xaapyks) 2013-07-28 23:24:39 UTC
(In reply to comment #5)
> Bison 3 has several warning when using -W :
> $ bison  -o glsl_parser.cpp -p "_mesa_glsl_"
> --defines=../../src/glsl/glsl_parser.h glsl_parser.yy -W
> glsl_parser.yy:270.18: avertissement: règle vide sans %empty [-Wempty-rule]
>  version_statement:
>                   ^
> glsl_parser.yy:306.25: avertissement: règle vide sans %empty [-Wempty-rule]
>  extension_statement_list:
>                          ^
> glsl_parser.yy:884.4-886.4: avertissement: règle vide sans %empty
> [-Wempty-rule]
>     {
>     ^
> glsl_parser.yy:1989.4-1991.4: avertissement: règle vide sans %empty
> [-Wempty-rule]
>     {
>     ^
> glsl_parser.yy:2194.4-2197.4: avertissement: règle vide sans %empty
> [-Wempty-rule]
>     {
>     ^
> 
> Whereas using the same command with bison 2.7 produces absolutely no warning
> output.

Oops, sorry, same output in english:
$ LC_ALL=C bison  -o glsl_parser.cpp -p "_mesa_glsl_" --defines=../../src/glsl/glsl_parser.h glsl_parser.yy -W
glsl_parser.yy:270.18: warning: empty rule without %empty [-Wempty-rule]
 version_statement:
                  ^
glsl_parser.yy:306.25: warning: empty rule without %empty [-Wempty-rule]
 extension_statement_list:
                         ^
glsl_parser.yy:884.4-886.4: warning: empty rule without %empty [-Wempty-rule]
    {
    ^
glsl_parser.yy:1989.4-1991.4: warning: empty rule without %empty [-Wempty-rule]
    {
    ^
glsl_parser.yy:2194.4-2197.4: warning: empty rule without %empty [-Wempty-rule]
    {
    ^
Comment 7 Laurent carlier 2013-07-29 08:39:41 UTC

*** This bug has been marked as a duplicate of bug 67354 ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.