Bug 15228 - Missing flex, bison, or gperf produces a failing build
Summary: Missing flex, bison, or gperf produces a failing build
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 523.x (Safari 3)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-17 15:48 PDT by Tuukka Hastrup
Modified: 2007-09-19 09:20 PDT (History)
2 users (show)

See Also:


Attachments
Proposed fix (1.20 KB, patch)
2007-09-17 15:52 PDT, Tuukka Hastrup
ddkilzer: review-
Details | Formatted Diff | Diff
Updated fix (1.29 KB, patch)
2007-09-18 13:41 PDT, Tuukka Hastrup
ddkilzer: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.