macports thinks xcode is not installed...?

Mihai Moldovan ionic at macports.org
Sun Aug 2 20:50:18 PDT 2015


On 03.08.2015 04:01 AM, Carlo Tambuatco wrote:
> I recently upgraded my harddrive to a hybrid SSD and had to reinstall OS X
> Yosemite then restore everything from Time Machine backup.
> 
> I then re installed XCode albeit a newer version, this time I went with the
> XCode 7 beta 4 release.

The problem is that you are using an unreleased, testing Xcode version.


> It seems to automatically install the xcode command line
> tools without me needing to do xcode-select --install. 
> 
> Anyway, I recently did an upgrade of all my outdated ports and got this warning
> message:
> 
> Warning: Xcode does not appear to be installed; most ports will likely fail to
> build.
> 
> 
> Meanwhile it is downloading, compiling, installing, activating and cleaning
> everything just fine. It seems macports thinks xcode is not there while it is
> using its compilers to do its work...
> 
> What is going on and is this going to lead to problems down the road?


First, answering the second question. Yes, it will lead to problems down the
road, for the first port that requires Xcode (or more specifically xcodebuild.)

The answer to the first question is more sophisticated.

OS X 10.11, as you may know, introduces the "rootless" mode, which means that
write access to locations such as /usr and /System (lest /usr/local) are
prohibited - even for the root user.

Due to this, the command line tools cannot be installed into the usual location
- which has traditionally been /usr. Instead, they are now installed in
/Library/Developer/CommandLineTools. The Xcode SDK path seems also to be set to
this value.

The backside of that coin, however, is, that the normal tools as shipped by
Xcode (like xcodebuild) are still installed in
/Applications/Xcode.app/Contents/Developer - and as port checks the path
registered with xcode-select, it will not find these tools.

That's a "tiny bit of a problem".


> Is there anything I need to do to fix this?

At the moment, I have no idea how to fix that.

Then again, I haven't seen xcode-select --help for the Beta version of Xcode
yet, either.

It may be that Apple has decoupled the SDK path from the CLT path (xcode-select
-p), but as I said, I don't know.

A workaround *might* be setting the SDK path to
/Applications/Xcode.app/Contents/Developer and adding
/Library/Developer/CommandLineTools to the PATH value in
${prefix}/etc/macports.conf, but I doubt that's a proper solution and may well
break Xcode itself (or more specifically, xcodebuild.)




Mihai



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <https://lists.macosforge.org/pipermail/macports-users/attachments/20150803/ccfb53b0/attachment.sig>


More information about the macports-users mailing list