Bug 15228

Summary: Missing flex, bison, or gperf produces a failing build
Product: WebKit Reporter: Tuukka Hastrup <Tuukka.Hastrup>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, ddkilzer
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Proposed fix
ddkilzer: review-
Updated fix ddkilzer: review+

Description Tuukka Hastrup 2007-09-17 15:48:19 PDT
If a build for Gdk or Qt is started with flex, bison, or gperf unavailable, the build will fail with non-obvious error messages even after those tools are later installed.
Comment 1 Tuukka Hastrup 2007-09-17 15:52:25 PDT
Created attachment 16309 [details]
Proposed fix

Attached a proposed fix for this bug, requesting review.
Comment 2 David Kilzer (:ddkilzer) 2007-09-18 09:48:43 PDT
Comment on attachment 16309 [details]
Proposed fix

>+    } elsif (isGdk() or isQt()) {
>+        my @cmds = qw(flex bison gperf);
>+        foreach my $cmd (@cmds) {
>+            if (not `$cmd --version`) {
>+                die ((join ", ", @cmds) . " required to build WebKit.\n");
>+            }
>+        }
>     }

Thanks for taking the time to file a bug and create a patch!  This looks good, but I'd like to see the code changed to test for all three commands and report only the ones that are missing.

For example if flex and bison are installed but not gperf, the developer gets a message about all three being required to build instead of a message about "gperf" missing.
Comment 3 Tuukka Hastrup 2007-09-18 13:41:18 PDT
Created attachment 16317 [details]
Updated fix

Actually the initial patch prints an error message for the first command that can't be executed, followed by the message about the list of all required commands. 

But why not take one more step towards usability indeed. I've updated the patch according to the feedback, requesting a new review. Example output:

~/svn/WebKit$ WebKitTools/Scripts/build-webkit --gdk
Can't exec "flex": No such file or directory at /home/tuukka/svn/WebKit/WebKitTools/Scripts/webkitdirs.pm line 497.
Can't exec "gperf": No such file or directory at /home/tuukka/svn/WebKit/WebKitTools/Scripts/webkitdirs.pm line 497.
flex, gperf missing but required to build WebKit.
~/svn/WebKit$
Comment 4 David Kilzer (:ddkilzer) 2007-09-19 09:14:56 PDT
Comment on attachment 16317 [details]
Updated fix

Looks good!  r=me
Comment 5 David Kilzer (:ddkilzer) 2007-09-19 09:20:10 PDT
Committed revision 25639.

Added "ERROR: " to the die() statement to make it clearer that this is an error.