XCode 7.0 to XCode 7.2 Upgrade Question- CLI Tools

rqomsiya
Contributor III

Hi all,

Quick question regarding CLI tools. I have a post-isntall script that installs the CLI tools after installing XCode 7.2. My question is do I need to uninstall the XCode 7.0 CLI tools or does the CLI tools package just write over the old tools? Or does it keep both and default to the newer version.

Also, I noticed that when i installed XCode 7.2 i ran a gcc --version this was the output. Is the 7.0.2 GCC version correct?

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin14.5.0
Thread model: posix

Thanks all!

-Ronnie

4 REPLIES 4

bpavlov
Honored Contributor

Xcode 7.2 does not automatically install Xcode CLI Tools. That's a separate package. However if you already have older Xcode CLI Tools installed ( say very 7.0 and now you've updated Xcode) then I believe Software Update will tell you there is an update available for the Xcode CLI Tools. I'm not sure if it's reliant on the version of Xcode. In other words, I'm not sure if SU will look at what version of Xcode you have before telling you what the latest version of CLI Tools are, or if it just gives you the latest CLI tools that are available for your OS regardless of the version of Xcode.

rqomsiya
Contributor III

@bpavlov I have a script that calls the CLI tools installer post Xcode install. Yea, I'm not sure if it uninstalls any old versions or if it just installs on top....

bpavlov
Honored Contributor

I haven't broken the Xcode CLI Tools package installer apart so I could be wrong here, but by and large Apple tends to put the pieces it wants to go into a computer in the package payload.

Now this is my understanding of this based on a workshop I attended by @gregneagle and Sam Keeley at PSU MacAdmins last year.

Without getting too much into it, when a package is installed, it should be leaving a package receipt. This package receipt says that a specific version of package X was run on this computer. If a newer package is created with a newer package, then the package goes through the update process where it:
1 removes files that on the disk that are no longer a part of the new package payload
2. replaces files already on the disk that are a part of the new package payload
3. installs new files that are NOT on the disk that are a part of the new package payload.

This is why most admins will tell you to put as much as you can into the payload with a consistent package receipt and properly assign a version to your packages instead of relying on pre/postinstall scripts to take care of the majority of file placement.

That's probably more than you wanted to hear. FWIW this specific package does have pre/postinstall scripts.

rqomsiya
Contributor III

Appreciate the feedback. Did some testing. Nothing seems to break. When just uninstalling the old XCode.app and installing the new one.

Thanks again @bpavlov for all your feedback/help/advice!!

-Ronnie