Xcode 4.3 issues, potential solutions
James Berry
jberry at macports.org
Fri Feb 17 08:05:38 PST 2012
Sounds like there are at least several issues that MacPorts is facing with Xcode, not all of which are new:
(1) Make sure the Xcode terms have been accepted
(2) Find the proper Xcode is use. We can no longer assume /Developer
(3) Ensure the command line tools have been installed. While we use xcrun now to find Xcode compilers, I think we still have a dependency on the command line tools for thinks like the linker… (?) [the xcrun discovery code is not yet in a release MacPorts]
Some potential solutions to these issues:
(2) Likely, we should examine the result from xcodebuild or xcode-select to look for the case where the terms have not be accepted, and ask the user to first run Xcode. I haven't explored this at all.
(2) If developer_dir is not set, or is not correct, do the following, in order
(a) Use any valid value from: xcode-select -print-path (the user has chosen an Xcode, or Xcode's default is correct)
(b) Examine the output from: mdfind "kMDItemCFBundleIdentifier == 'com.apple.dt.Xcode'"
- This may give multiple results if the user has multiple Xcodes installed
- The best solution to multiple results would likely to display those results, and ask the user to run xcode-select to select one.
- Alternatively, we could examine the versions from mdls -name 'kMDItemVersion', and use the most recent version installed
(3) If we do have a dependency on the command line tools package, we could either look for key files we know we need (compilers, linker, etc) or use pkgutil to ensure the package has been installed:
pkgutil --pkgs | grep com.apple.pkg.DeveloperToolsCLI, potentially followed by something like pkgutil -pkg-info or -verify
(likely it would be easier to just look for some required tools and ask them to install the command line tools)
More information about the macports-dev
mailing list