Xcode 4.3 Command Line Tools installer glitch

Rainer Müller raimue at macports.org
Mon Feb 20 00:36:39 PST 2012


On 02/17/2012 05:03 AM, Jack Howarth wrote:
>     I've confirmed that for both the clean install of Xcode 4.3/Command Line Tools
> as well as the upgrade install of Xcode 4.3/Command Line Tools over Xcode 4.2.1
> that the developer directory path isn't being set. This results in 'xcodebuild -version'
> producing the error message...
>
> Error: No developer directory found at /Developer. Run /usr/bin/xcode-select to update the developer directory path.
>
> until the user explicitly executes...
>
> sudo xcode-select -switch /Applications/Xcode.app

Joshua and James already added some code to trunk to handle this case. 
It advises to run the xcode-select -switch command while retrieving the 
location of Xcode.app with mdfind:

https://trac.macports.org/browser/trunk/base/src/macports1.0/macports.tcl?rev=90024#L422


However, there is another glitch in the process in case you are using a 
more restrictive umask value. xcode-select does not set proper 
permissions on /usr/share/xcode-select/xcode_dir_path in this case.

This file contains the chosen developer path and is meant to be 
world-readable, which it was obviously not on my system after executing 
the command above:

$ ls -l /usr/share/xcode-select/xcode_dir_path
-rw-------  1 root  wheel  43 Feb 19 23:07 
/usr/share/xcode-select/xcode_dir_path

This results in this error message:

$ xcrun -find clang
xcode-select: Error: Incorrect permissions for xcode-select data. Run 
xcode-select -switch <xcode_folder_path> to reset the path to the Xcode 
folder.
Error: /usr/bin/xcode-select returned unexpected error.

Although advised, running xcode-select does not correct the permissions. 
A workaround is to manually set the permissions to world-readable.

$ sudo chmod a+r /usr/share/xcode-select/xcode_dir_path

This is filed as rdar://10893107 "xcode-select -switch sets wrong 
permissions on /usr/share/xcode-select/xcode_dir".

Rainer


More information about the macports-dev mailing list