Title: [118621] trunk/Tools
Revision
118621
Author
[email protected]
Date
2012-05-26 23:52:07 -0700 (Sat, 26 May 2012)

Log Message

Use xcrun to find path to nm for Mac port
<http://webkit.org/b/87588>

Reviewed by Dan Bernstein.

* Scripts/webkitpy/layout_tests/port/mac.py:
(MacPort.nm_command): Add. Tries to find a path for the nm
command using xcrun.  Falls back to returning 'nm'.
* Scripts/webkitpy/layout_tests/port/webkit.py:
(WebKitPort.nm_command): Add. Returns 'nm'.
(WebKitPort._webcore_symbols_string): Call self.nm_command().

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (118620 => 118621)


--- trunk/Tools/ChangeLog	2012-05-27 01:51:03 UTC (rev 118620)
+++ trunk/Tools/ChangeLog	2012-05-27 06:52:07 UTC (rev 118621)
@@ -1,3 +1,17 @@
+2012-05-26  David Kilzer  <[email protected]>
+
+        Use xcrun to find path to nm for Mac port
+        <http://webkit.org/b/87588>
+
+        Reviewed by Dan Bernstein.
+
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        (MacPort.nm_command): Add. Tries to find a path for the nm
+        command using xcrun.  Falls back to returning 'nm'.
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+        (WebKitPort.nm_command): Add. Returns 'nm'.
+        (WebKitPort._webcore_symbols_string): Call self.nm_command().
+
 2012-05-25  Lynn Neir  <[email protected]>
 
         Added windows implementation in DRT for TextInputController, https://bugs.webkit.org/show_bug.cgi?id=32021

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py (118620 => 118621)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py	2012-05-27 01:51:03 UTC (rev 118620)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py	2012-05-27 06:52:07 UTC (rev 118621)
@@ -1,4 +1,5 @@
 # Copyright (C) 2011 Google Inc. All rights reserved.
+# Copyright (C) 2012 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
@@ -239,3 +240,10 @@
                 _log.debug("IOError raised while stopping helper: %s" % str(e))
                 pass
             self._helper = None
+
+    def nm_command(self):
+        try:
+            return self._executive.run_command(['xcrun', '-find', 'nm']).rstrip()
+        except ScriptError, e:
+            _log.warn("xcrun failed; falling back to 'nm'.")
+            return 'nm'

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py (118620 => 118621)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py	2012-05-27 01:51:03 UTC (rev 118620)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py	2012-05-27 06:52:07 UTC (rev 118621)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 # Copyright (C) 2010 Google Inc. All rights reserved.
 # Copyright (C) 2010 Gabor Rapcsanyi <[email protected]>, University of Szeged
-# Copyright (C) 2011 Apple Inc. All rights reserved.
+# Copyright (C) 2011, 2012 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
@@ -262,12 +262,15 @@
         """If a port makes certain features available only through runtime flags, it can override this routine to indicate which ones are available."""
         return None
 
+    def nm_command(self):
+        return 'nm'
+
     def _webcore_symbols_string(self):
         webcore_library_path = self._path_to_webcore_library()
         if not webcore_library_path:
             return None
         try:
-            return self._executive.run_command(['nm', webcore_library_path], error_handler=Executive.ignore_error)
+            return self._executive.run_command([self.nm_command(), webcore_library_path], error_handler=Executive.ignore_error)
         except OSError, e:
             _log.warn("Failed to run nm: %s.  Can't determine WebCore supported features." % e)
         return None
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to