macports thinks xcode is not installed...?
Ryan Schmidt
ryandesign at macports.org
Sun Aug 2 21:18:45 PDT 2015
On Aug 2, 2015, at 10:50 PM, Mihai Moldovan wrote:
> 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.
While we don't support beta or pre-release versions of Xcode or OS X, merely using them is not necessarily a problem.
>> 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.
This is the first I'd heard of it. I like it. Thanks for letting us know.
> 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.)
I haven't had any problems building most ports under OS X 10.11 beta with Xcode 7 betas so I suspect something else is going on.
As far as I know, you should still run "xcode-select --install" to install the command line tools. I'm not aware of them being installed automatically.
You should also select the Xcode location, using "sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer" (or wherever you put it).
You should also agree to the Xcode license agreement by running "sudo xcodebuild -license".
You should also open the Xcode application once before using MacPorts. Do this again anytime Xcode is updated.
More information about the macports-users
mailing list