When webkitdirs.pm runs 'which' it redirects its stdout to /dev/null. At least GNU which prints to stderr when a binary is not found, so we should redirect stderr as well. This fixes an annoying warning that prints at the top of the output of build-webkit on distros that rename ninja to ninja-build.
Created attachment 244315 [details]
Comment on attachment 244315 [details]
We should take this opportunity to write these functions in terms of webkitdirs::commandExists() instead of duplicating effort. Notice that webkitdirs::commandExists() assumes that a command that exists will emit a non-empty string to stdout when passed --version. We may need to improve the implementation of webkitdirs::commandExists() if it's insufficient to use to test for the existence of ninja, eclipse, and ninja-build.
The existing function works fine for ninja, but in the Java tradition, eclipse does not support --version.
Created attachment 244412 [details]
The Windows support is speculative, based on  and . I hope that will be tested by the EWS?
Comment on attachment 244412 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=244412&action=review
> + return $? == 0;
$? encodes both the exit status and signal code that caused termination of the child process and I'm unclear whether the signal code would be zero under normal circumstances on Windows. Regardless, we should make use of exitStatus() extract the exit status of the child before comparing to 0. Specifically, we should pass the return value of system() to exitStatus().
> + return commandExists('ninja') || commandExists('ninja-build');
Nit: ' (single quote) => " (double quote)
> + return commandExists('eclipse');
The Windows portion of this patch looks sane to me given the referenced documents in comment 5.
CC'ed Brent Fulgham who is familiar with the Windows command line environment.
Created attachment 244414 [details]
Comment on attachment 244414 [details]
Clearing flags on attachment: 244414
Committed r178243: <http://trac.webkit.org/changeset/178243>
All reviewed patches have been landed. Closing bug.