Xcode is not installed where Command Line Tools for Xcode expects it
Summary
On a regular development machine Xcode is installed in /Applications/Xcode.app
whereas on macos-14-xcode-15
and macos-13-xcode-14
it is installed somewhere else (see #431424 (comment 1645676834)). As a result some tools installed by Command Line Tools for Xcode do not find it. For example, Python cannot find its pieces needed for building a Python extension.
Steps to reproduce
$ /usr/bin/python3 -m sysconfig | grep LIBPC
LIBPC = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/pkgconfig"
$ ls /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/pkgconfig
ls: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/pkgconfig: No such file or directory
What is the current bug behavior?
LIBPC
above should point to the directory containing the pkg-config files necessary to compile and link to the Python C API dynamic library; the Python interpreter is provided by Command Line Tools for Xcode, the pkg-config directory and the rest of all the Python C API development files are provided by Xcode.
What's wrong here is that Xcode is installed in eg. /Applications/Xcode-15.0.0.app
instead of /Applications/Xcode.app
(in the case of macos-14-xcode-15
) and therefore Python points to a path that does not exist.
What is the expected correct behavior?
The expected behavior is that Python can point to its corresponding development files. If Xcode cannot be installed in its regular place /Applications/Xcode.app
, that at least a symlink making /Applications/Xcode.app
reach the alternative path (eg. /Applications/Xcode-15.0.0.app
) is put in place.