Bug 119745 - [CMake] Always use the glslang_tab files from ANGLE instead of generating them.
Summary: [CMake] Always use the glslang_tab files from ANGLE instead of generating them.
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: ANGLE (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Raphael Kubo da Costa (:rakuco)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-13 07:01 PDT by Raphael Kubo da Costa (:rakuco)
Modified: 2013-08-15 04:18 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.65 KB, patch)
2013-08-13 07:03 PDT, Raphael Kubo da Costa (:rakuco)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raphael Kubo da Costa (:rakuco) 2013-08-13 07:01:24 PDT
[CMake] Always use the glslang_tab files from ANGLE instead of generating them.
Comment 1 Raphael Kubo da Costa (:rakuco) 2013-08-13 07:03:36 PDT
Created attachment 208626 [details]
Patch
Comment 2 Raphael Kubo da Costa (:rakuco) 2013-08-13 07:07:24 PDT
Feedback (and optionally testing) here is appreciated: the existing version check that makes us not use the files we generate if using Bison 2.5 is too restrictive and breaks with Bison > 2.5.

While we could fix the check in CMake, just using the existing files provided by ANGLE allows us to simplify the code.

I've CC'ed Joshua Netterfield because of <https://bugs.webkit.org/show_bug.cgi?id=93487#c7>; I don't know what problems the BlackBerry guys were having at the time, but if the files provided by ANGLE have been generated with Bison 2.3 I don't see the problem happening again these days.
Comment 3 Ming Xie 2013-08-13 08:10:39 PDT
The current BlackBerry port is using:
         ${THIRDPARTY_DIR}/ANGLE/src/compiler/glslang_lex.cpp
         ${THIRDPARTY_DIR}/ANGLE/src/compiler/glslang_tab.cpp

From http://trac.webkit.org/changeset/125496/trunk/Source/WebCore/CMakeLists.txt, it looks like the original problem was we included both:
        ${DERIVED_SOURCES_WEBCORE_DIR}/glslang.cpp
        ${DERIVED_SOURCES_WEBCORE_DIR}/glslang_tab.cpp
and
        ${THIRDPARTY_DIR}/ANGLE/src/compiler/glslang_lex.cpp 
        ${THIRDPARTY_DIR}/ANGLE/src/compiler/glslang_tab.cpp

Your patch should be fine.
Comment 4 Alex Christensen 2013-08-13 09:50:23 PDT
When I updated ANGLE a few weeks ago, I made it so Bison 2.3-2.7 will work.  We are in the process of making all ports run Bison as part of the build process so that we can not include the generated files in the WebKit repository to make updating ANGLE easier.  Right now we have to run Bison as part of the update process, so please use the files from ${DERIVED_SOURCES_WEBCORE_DIR}.
Comment 5 Raphael Kubo da Costa (:rakuco) 2013-08-13 10:03:35 PDT
Two questions:

 o Should <http://trac.webkit.org/changeset/153749> be reverted then?

 o How do I make the generated files build with Bison 3.0?

/b/webkit/efl/Debug/DerivedSources/WebCore/glslang_tab.cpp: In function 'int yyparse(TParseContext*)':
/b/webkit/efl/Debug/DerivedSources/WebCore/glslang_tab.cpp:1916:39: error: too few arguments to function 'int yylex(YYSTYPE*, TSourceLoc*, void*)'
/b/webkit/efl/Debug/DerivedSources/WebCore/glslang_tab.cpp:291:12: note: declared here
/b/webkit/efl/Debug/DerivedSources/WebCore/glslang_tab.cpp:1991:22: error: 'YYID' was not declared in this scope
/b/webkit/efl/Debug/DerivedSources/WebCore/glslang_tab.cpp:4754:18: error: 'YYID' was not declared in this scope
Comment 6 Alex Christensen 2013-08-13 10:15:46 PDT
(In reply to comment #5)
> Two questions:
> 
>  o Should <http://trac.webkit.org/changeset/153749> be reverted then?
Not right now, but we should all be working to run bison and flex as part of the build to make updating easier (so we can remove ExpressionParser.cpp, Tokenizer.cpp, glslang_lex.cpp, glslang_tab.h, and glslang_tab.cpp).
> 
>  o How do I make the generated files build with Bison 3.0?
> 
> /b/webkit/efl/Debug/DerivedSources/WebCore/glslang_tab.cpp: In function 'int yyparse(TParseContext*)':
> /b/webkit/efl/Debug/DerivedSources/WebCore/glslang_tab.cpp:1916:39: error: too few arguments to function 'int yylex(YYSTYPE*, TSourceLoc*, void*)'
> /b/webkit/efl/Debug/DerivedSources/WebCore/glslang_tab.cpp:291:12: note: declared here
> /b/webkit/efl/Debug/DerivedSources/WebCore/glslang_tab.cpp:1991:22: error: 'YYID' was not declared in this scope
> /b/webkit/efl/Debug/DerivedSources/WebCore/glslang_tab.cpp:4754:18: error: 'YYID' was not declared in this scope
That's ANGLE's fault.  You should go complain to them.  Maybe add this to my issue: https://code.google.com/p/angleproject/issues/detail?id=449
Comment 7 Raphael Kubo da Costa (:rakuco) 2013-08-15 04:17:40 PDT
It looks like carewolf is taking care of this in https://code.google.com/p/angleproject/issues/detail?id=462 and bug 119798 here.
Comment 8 Raphael Kubo da Costa (:rakuco) 2013-08-15 04:18:17 PDT
Comment on attachment 208626 [details]
Patch

Removing the r? flag, as Alex said it makes more sense to just fix the files we process.