Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1199)

Unified Diff: third_party/chrome/tools/diagnose-me.py

Issue 12300042: Update idlsync.py to pull in dependencies required for chrome api generation. (Closed) Base URL: git://github.com/dart-lang/bleeding_edge.git@master
Patch Set: From another checkout Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/chrome/tools/cpp_util_test.py ('k') | third_party/chrome/tools/find_depot_tools.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/chrome/tools/diagnose-me.py
diff --git a/third_party/chrome/tools/diagnose-me.py b/third_party/chrome/tools/diagnose-me.py
new file mode 100755
index 0000000000000000000000000000000000000000..bbd9429cb1e241f3e448d8638355ae43847ed724
--- /dev/null
+++ b/third_party/chrome/tools/diagnose-me.py
@@ -0,0 +1,95 @@
+#!/usr/bin/python
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Diagnose some common system configuration problems on Linux, and
+suggest fixes."""
+
+import os
+import subprocess
+import sys
+
+all_checks = []
+
+def Check(name):
+ """Decorator that defines a diagnostic check."""
+ def wrap(func):
+ all_checks.append((name, func))
+ return func
+ return wrap
+
+
+@Check("/usr/bin/ld is not gold")
+def CheckSystemLd():
+ proc = subprocess.Popen(['/usr/bin/ld', '-v'], stdout=subprocess.PIPE)
+ stdout = proc.communicate()[0]
+ if 'GNU gold' in stdout:
+ return ("When /usr/bin/ld is gold, system updates can silently\n"
+ "corrupt your graphics drivers.\n"
+ "Try 'sudo apt-get remove binutils-gold'.\n")
+ return None
+
+
+@Check("random lds are not in the $PATH")
+def CheckPathLd():
+ proc = subprocess.Popen(['which', '-a', 'ld'], stdout=subprocess.PIPE)
+ stdout = proc.communicate()[0]
+ instances = stdout.split()
+ if len(instances) > 1:
+ return ("You have multiple 'ld' binaries in your $PATH:\n"
+ + '\n'.join(' - ' + i for i in instances) + "\n"
+ "You should delete all of them but your system one.\n"
+ "gold is hooked into your build via gyp.\n")
+ return None
+
+
+@Check("/usr/bin/ld doesn't point to gold")
+def CheckLocalGold():
+ # Check /usr/bin/ld* symlinks.
+ for path in ('ld.bfd', 'ld'):
+ path = '/usr/bin/' + path
+ try:
+ target = os.readlink(path)
+ except OSError, e:
+ if e.errno == 2:
+ continue # No such file
+ if e.errno == 22:
+ continue # Not a symlink
+ raise
+ if '/usr/local/gold' in target:
+ return ("%s is a symlink into /usr/local/gold.\n"
+ "It's difficult to make a recommendation, because you\n"
+ "probably set this up yourself. But you should make\n"
+ "/usr/bin/ld be the standard linker, which you likely\n"
+ "renamed /usr/bin/ld.bfd or something like that.\n" % path)
+
+ return None
+
+
+@Check("random ninja binaries are not in the $PATH")
+def CheckPathNinja():
+ proc = subprocess.Popen(['which', 'ninja'], stdout=subprocess.PIPE)
+ stdout = proc.communicate()[0]
+ if not 'depot_tools' in stdout:
+ return ("The ninja binary in your path isn't from depot_tools:\n"
+ + " " + stdout +
+ "Remove custom ninjas from your path so that the one\n"
+ "in depot_tools is used.\n")
+ return None
+
+
+def RunChecks():
+ for name, check in all_checks:
+ sys.stdout.write("* Checking %s: " % name)
+ sys.stdout.flush()
+ error = check()
+ if not error:
+ print "ok"
+ else:
+ print "FAIL"
+ print error
+
+
+if __name__ == '__main__':
+ RunChecks()
« no previous file with comments | « third_party/chrome/tools/cpp_util_test.py ('k') | third_party/chrome/tools/find_depot_tools.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698