Use xcrun to find path to make for Mac port
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jan 2013 05:31:46 +0000 (05:31 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jan 2013 05:31:46 +0000 (05:31 +0000)
<http://webkit.org/b/107091>

Reviewed by Dan Bernstein.

* Scripts/webkitpy/layout_tests/port/mac.py:
(MacPort._build_java_test_support): Call self.make_command().
(MacPort.make_command): Add.  Call xcrun_find().
(MacPort.nm_command): Use self.xcrun_find().
(MacPort.xcrun_find): Add.  Extract from nm_command().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139965 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/layout_tests/port/mac.py

index a0de022..db2b161 100644 (file)
@@ -1,3 +1,16 @@
+2013-01-16  David Kilzer  <ddkilzer@apple.com>
+
+        Use xcrun to find path to make for Mac port
+        <http://webkit.org/b/107091>
+
+        Reviewed by Dan Bernstein.
+
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        (MacPort._build_java_test_support): Call self.make_command().
+        (MacPort.make_command): Add.  Call xcrun_find().
+        (MacPort.nm_command): Use self.xcrun_find().
+        (MacPort.xcrun_find): Add.  Extract from nm_command().
+
 2013-01-16  Sam Weinig  <sam@webkit.org>
 
         Make debug-safari --target-web-process work again
index c5b2bbc..30b3255 100644 (file)
@@ -1,5 +1,5 @@
 # Copyright (C) 2011 Google Inc. All rights reserved.
-# Copyright (C) 2012 Apple Inc. All rights reserved.
+# Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
@@ -130,7 +130,7 @@ class MacPort(ApplePort):
 
     def _build_java_test_support(self):
         java_tests_path = self._filesystem.join(self.layout_tests_dir(), "java")
-        build_java = ["/usr/bin/make", "-C", java_tests_path]
+        build_java = [self.make_command(), "-C", java_tests_path]
         if self._executive.run_command(build_java, return_exit_code=True):  # Paths are absolute, so we don't need to set a cwd.
             _log.error("Failed to build Java support files: %s" % build_java)
             return False
@@ -268,9 +268,15 @@ class MacPort(ApplePort):
                 _log.debug("IOError raised while stopping helper: %s" % str(e))
             self._helper = None
 
+    def make_command(self):
+        return self.xcrun_find('make', '/usr/bin/make')
+
     def nm_command(self):
+        return self.xcrun_find('nm', 'nm')
+
+    def xcrun_find(self, command, fallback):
         try:
-            return self._executive.run_command(['xcrun', '-find', 'nm']).rstrip()
+            return self._executive.run_command(['xcrun', '-find', command]).rstrip()
         except ScriptError:
-            _log.warn("xcrun failed; falling back to 'nm'.")
-            return 'nm'
+            _log.warn("xcrun failed; falling back to '%s'." % fallback)
+            return fallback