<html>
    <head>
      <base href="https://bugs.webkit.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - run-gtk-tests (glib/common.py) cannot determine build directory when webKitBranchBuild=true"
   href="https://bugs.webkit.org/show_bug.cgi?id=185643">185643</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>run-gtk-tests (glib/common.py) cannot determine build directory when webKitBranchBuild=true
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>WebKit Gtk
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned@lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>fred.wang@free.fr
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>bugs-noreply@webkitgtk.org, rwlbuis@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If webKitBranchBuild=true and your build directory is e.g. WebKitBuild/MyBranchName then Tools/Scripts/run-gtk-tests fails with error "Could not determine build directory". If you have already built the master branch in WebKitBuild/ then you don't get this error and probably the tests are executed with the wrong build. This is where get_build_path() is called:

 File "Tools/Scripts/run-gtk-tests", line 142, in <module>
    runner = GtkTestRunner(options, args)
  File "Tools/Scripts/run-gtk-tests", line 38, in __init__
    super(GtkTestRunner, self).__init__("gtk", options, tests)
  File "./Tools/glib/api_test_runner.py", line 47, in __init__
    self._programs_path = common.binary_build_path()
  File "./Tools/glib/common.py", line 53, in binary_build_path
    binary_build_dir = build_path('bin', *args)
  File "./Tools/glib/common.py", line 104, in build_path
    return os.path.join(*(get_build_path(),) + args)

For people hitting this problem, here is a quick workaround:

diff --git a/Tools/glib/common.py b/Tools/glib/common.py
index 8a7b2fb465b..43dca365733 100644
--- a/Tools/glib/common.py
+++ b/Tools/glib/common.py
@@ -77,7 +77,7 @@ def get_build_path(fatal=True):

     global build_types
     for build_type in build_types:
-        build_dir = top_level_path('WebKitBuild', build_type)
+        build_dir = top_level_path('WebKitBuild', "MyBranchName", build_type)
         if is_valid_build_directory(build_dir):
             return build_dir</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>