Xcode fails to update Command Line Tools
| Originator: | fjarlq | ||
| Number: | rdar://11972830 | Date Originated: | 27-Jul-2012 06:27 AM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 4.4 |
| Classification: | Serious Bug | Reproducible: | Sometimes |
26-Jul-2012 06:27 PM Matt Day: Summary: The day Xcode 4.4 was released, I updated my installation of Xcode 4.3 on my Macbook running OSX 10.7.4. After updating Xcode using the Mac App Store, I noticed (by running "gcc -v") that my Command Line Tools had not been updated. So I ran Xcode and entered Preferences>Downloads and clicked the "Check and Install Now" button, but it reported "No updates available". The Command Line Tools had an Install button, so I clicked that, expecting it to install the latest CLT. However, after reinstalling the CLT this way, "gcc -v" still reported the old version number (LLVM build 2336.9.00). The next day, on my Mac Pro, I updated my Xcode in the same way. This time, Preferences>Downloads showed an Update button for Command Line Tools, and it worked fine -- gcc -v reported the new version number (LLVM build 2336.11.00) and all is well. So I ran Xcode on my Macbook and it still reported "No updates available", and clicking Install for Command Line Tools still failed to update my CLT. After some investigation I found that despite the last modified timestamp on my Macbook's /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 being updated, the executable still reports the old version number. But, /Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 reports the NEW version number, and is a different executable than the version in /usr/llvm-gcc-4.2/bin. I also found that /usr/bin/ld reports an old version number (Apple Clang 3.1 (build 318.0.61)), while /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld reports a new version number (Apple Clang 4.0 (build 421.0.57)). So, the Command Line Tools files in /usr/bin and /usr/llvm-gcc-4.2 are apparently not being updated, despite newer versions of the executables residing in /Applications/Xcode.app. I don't know why. Steps to Reproduce: 1. Update Xcode to version 4.4 2. Run Xcode 3. Select Preferences > Downloads 4. Select "Check and Install Now" Expected Results: I expect the Command Line Tools installed in /usr/bin and /usr/llvm-gcc-4.2 to report version numbers corresponding with the Xcode 4.4 release: $ /usr/bin/ld -v @(#)PROGRAM:ld PROJECT:ld64-133.3 configured to support archs: armv6 armv7 i386 x86_64 LTO support using: LLVM version 3.1svn, from Apple Clang 4.0 (build 421.0.57) $ /usr/bin/gcc -v Using built-in specs. Target: i686-apple-darwin11 Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~28/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~28/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1 Thread model: posix gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) Actual Results: Command Line Tools installed in /usr/bin and /usr/llvm-gcc-4.2 report old version numbers: $ /usr/bin/ld -v @(#)PROGRAM:ld PROJECT:ld64-128.2 llvm version 3.1svn, from Apple Clang 3.1 (build 318.0.61) $ /usr/bin/gcc -v Using built-in specs. Target: i686-apple-darwin11 Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1 Thread model: posix gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00) Regression: Notes: Other people have noticed this (or similar) issues and some discussion can be found here: https://github.com/mxcl/homebrew/issues/13591 At least one person has reported that the problem can be worked around manually by installing the latest Command Line Tools found at https://developer.apple.com/downloads/
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
workaround found
28-Jul-2012 04:49 AM Matt Day: I was able to work around this problem by manually deleting this file:
~/Library/Caches/com.apple.dt.Xcode/Downloads/Xcode.CLTools.10.7-1.3.1.dmg
and then running Xcode and reinstalling Command Line Tools. According to the file timestamp, this file was not being updated correctly.
Kudos to Github user adapt0 for finding this workaround: https://github.com/adapt0
Before:
$ ls -la ~/Library/Caches/com.apple.dt.XCode/Downloads total 151020 drwxr-xr-x 5 xxxx staff 170 Jul 27 05:58 ./ drwxr-xr-x 5 xxxx staff 170 Jul 27 05:58 ../ -rw-r--r--@ 1 xxxx staff 154619824 Jul 13 01:25 Xcode.CLTools.10.7-1.3.1.dmg -rw-r--r-- 1 xxxx staff 11349 Jul 27 05:58 eded78df8bfabaf6560841d10cf8e53766f74f28.dvtdownloadableindex -rw-r--r-- 1 xxxx staff 8486 Jul 13 01:24 f7133e82a08bdb4ebf724f16beed2bbac2a265cf.dvtdownloadableindex
After:
$ ls -la ~/Library/Caches/com.apple.dt.XCode/Downloads total 139672 drwxr-xr-x 5 xxxx staff 170 Jul 28 04:30 ./ drwxr-xr-x 5 xxxx staff 170 Jul 28 04:28 ../ -rw-r--r--@ 1 xxxx staff 142997814 Jul 28 04:30 Xcode.CLTools.10.7-1.3.1.dmg -rw-r--r-- 1 xxxx staff 11349 Jul 28 04:28 eded78df8bfabaf6560841d10cf8e53766f74f28.dvtdownloadableindex -rw-r--r-- 1 xxxx staff 8486 Jul 13 01:24 f7133e82a08bdb4ebf724f16beed2bbac2a265cf.dvtdownloadableindex