<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>104523</bug_id>
          
          <creation_ts>2012-12-10 01:40:40 -0800</creation_ts>
          <short_desc>build-webkit --chromium --ninja should show a better error message when ninja is missing</short_desc>
          <delta_ts>2012-12-10 20:53:32 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eric Seidel (no email)">eric</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>dpranke</cc>
    
    <cc>robert</cc>
    
    <cc>thakis</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>787094</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-12-10 01:40:40 -0800</bug_when>
    <thetext>build-webkit --chromium --ninja should show a better error message when ninja is missing

Currently:

[robert@mwenge WebKit (101803-6)]$ lucid ./Tools/Scripts/update-webkit --chromium --ninja
Updating OpenSource
Current branch 101803-6 is up to date.
Updating chromium port dependencies using gclient...
Syncing projects:  98% (54/55), done.party/icu                     

________ running &apos;/usr/bin/python tools/clang/scripts/update.py --mac-only&apos; in &apos;/home/robert/Dev/WebKit/Source/WebKit/chromium&apos;

________ running &apos;/usr/bin/python gyp_webkit&apos; in &apos;/home/robert/Dev/WebKit/Source/WebKit/chromium&apos;
Updating webkit projects from gyp files...
Using overrides found in /home/robert/.gyp/include.gypi
[robert@mwenge WebKit (101803-6)]$ lucid ./Tools/Scripts/build-webkit --chromium --makearg=-j5
ninja not found. Install chromium&apos;s depot_tools by running update-webkit first
[robert@mwenge WebKit (101803-6)]$ 


We should show the path of the discovered depot_tools, and explain that chromium depot tools only contains ninja binaries for linux-64, mac and win and any other platforms will need to build ninja themselves.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>787099</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-12-10 01:43:06 -0800</bug_when>
    <thetext>With a link to ninja of course: http://martine.github.com/ninja/ :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>787369</commentid>
    <comment_count>2</comment_count>
    <who name="Nico Weber">thakis</who>
    <bug_when>2012-12-10 08:38:36 -0800</bug_when>
    <thetext>Now that I look at the code, my analysis was probably wrong. Here&apos;s the ninja discovery code from Tools/Scripts/webkitdirs.pm:

    # Find ninja.
    my $ninjaPath;
    if (commandExists(&apos;ninja&apos;)) {
        $ninjaPath = &apos;ninja&apos;;
    } elsif (-e &apos;Source/WebKit/chromium/depot_tools/ninja&apos;) {
        $ninjaPath = &apos;Source/WebKit/chromium/depot_tools/ninja&apos;;
    } else {
        die &quot;ninja not found. Install chromium&apos;s depot_tools by running update-webkit first\n&quot;;
    }

ninja is a bash script in depot_tools, and that should always be found. Robert, does Source/WebKit/chromium/depot_tools exist on your box? (If not, do you know how `update-webkit --chromium` manages to find gclient?)


Here&apos;s the ninja bash script in depot_tools:

#!/bin/bash

# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

OS=&quot;$(uname -s)&quot;
THIS_DIR=&quot;$(dirname &quot;${0}&quot;)&quot;

if [ &quot;${OS}&quot; = &quot;Linux&quot; ]; then
  exec &quot;${THIS_DIR}/ninja-linux64&quot; &quot;$@&quot;
elif [ &quot;${OS}&quot; = &quot;Darwin&quot; ]; then
  exec &quot;${THIS_DIR}/ninja-mac&quot; &quot;$@&quot;
elif [[ ${OS} == CYGWIN* ]]; then
  exec cmd.exe /c `cygpath -t windows $0`.exe &quot;$@&quot;
elif [[ ${OS} == MINGW32* ]]; then
  cmd.exe //c $0.exe &quot;$@&quot;
else
  echo &quot;Unsupported OS ${OS}&quot;
  exit 1
fi


exec will probably print something like &quot;don&apos;t know how to exec ninja-linux64&quot; on a 32bit linux, and that diagnostic should certainly be better -- but it looks like this script isn&apos;t even called, so we need to figure out why that&apos;s not happening first.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>787492</commentid>
    <comment_count>3</comment_count>
    <who name="Robert Hogan">robert</who>
    <bug_when>2012-12-10 10:26:44 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; ninja is a bash script in depot_tools, and that should always be found. Robert, does Source/WebKit/chromium/depot_tools exist on your box? (If not, do you know how `update-webkit --chromium` manages to find gclient?)

Turns out I had a very old depot_tools from a couple of years ago in my path. I got rid of that and progressed to the message you suggest here:

&gt; exec will probably print something like &quot;don&apos;t know how to exec ninja-linux64&quot; 

I think https://code.google.com/p/chromium/wiki/UsingALinuxChroot may work for me as my chroot is very old and not 64-bit. I will try it when I get the chance.

I will still be able to build with Makefiles though once ninja becomes default though right? I just need to pass an extra build flag?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>787588</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-12-10 11:34:20 -0800</bug_when>
    <thetext>We should just check in a linux32 binary to handle your case. :)  ninja is very tiny.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>787589</commentid>
    <comment_count>5</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-12-10 11:35:03 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; I will still be able to build with Makefiles though once ninja becomes default though right? I just need to pass an extra build flag?

Yes --no-ninja will work.  I believe --make exists to and will work in your case (or I&apos;ll make sure it does before I land!)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>787594</commentid>
    <comment_count>6</comment_count>
    <who name="Nico Weber">thakis</who>
    <bug_when>2012-12-10 11:40:25 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; We should just check in a linux32 binary to handle your case. :)  ninja is very tiny.

Dunno, the 32bit user base is also very tiny, and it&apos;s another binary for me to build when updating ninja.

I&apos;ll make the ninja shell script print something nicer on 32bit for now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>787596</commentid>
    <comment_count>7</comment_count>
    <who name="Nico Weber">thakis</who>
    <bug_when>2012-12-10 11:40:46 -0800</bug_when>
    <thetext>And yes, make will still work for now, but it might go away eventually.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>787618</commentid>
    <comment_count>8</comment_count>
    <who name="Nico Weber">thakis</who>
    <bug_when>2012-12-10 11:57:33 -0800</bug_when>
    <thetext>https://codereview.chromium.org/11485007/ is adding a friendlier message.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>787992</commentid>
    <comment_count>9</comment_count>
    <who name="Nico Weber">thakis</who>
    <bug_when>2012-12-10 20:53:32 -0800</bug_when>
    <thetext>We ended up needing a 32bit ninja binary for the 32bit bots anyway ( :-/ ), so that&apos;s now checked in. https://codereview.chromium.org/11485007 will make the error message friendlier for non-mac/win/linux platforms. I think this is all done.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>