[LLVMbugs] [Bug 13345] New: set-xcode-analyzer does not work in Snow Leopard: Python is too old

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 12 10:57:54 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13345

             Bug #: 13345
           Summary: set-xcode-analyzer does not work in Snow Leopard:
                    Python is too old
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: jonathan.sauer at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8879
  --> http://llvm.org/bugs/attachment.cgi?id=8879
Patch

The script set-xcode-analyzer does not work on Snow Leopard. Running it results
in:

(+) Using Clang located at: myLLVM/build/Release+Asserts/bin/clang
Traceback (most recent call last):
 File "./set-xcode-analyzer", line 88, in <module>
   main()
 File "./set-xcode-analyzer", line 78, in main
   xcode_path = subprocess.check_output(["xcode-select", "-print-path"])
AttributeError: 'module' object has no attribute 'check_output'


This is because OS X 10.6.8 (which I'm running) only has Python 2.6.1
installed, but "check_output" was introduced in 2.7.0
(<http://docs.python.org/library/ subprocess.html>).

I have attached a small patch that tries to use check_output to get what
xcode-select prints and, if that fails, defaults XCode's installation path to
location "/Developer". According to <http://stackoverflow.com/a/7581689>, that
(i.e. trying and checking for errors instead of checking first) is The Python
Way(tm)(r) of doing things.

I tested it on Snow Leopard and it works as intended. I could not test it on
Lion or above.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list