xcode 4.3 breaks macports

James Berry jberry at macports.org
Sun Jan 29 08:44:43 PST 2012


On Jan 29, 2012, at 1:34 AM, Andrea D'Amore wrote:

> On Sat, Jan 28, 2012 at 18:04, James Berry <jberry at macports.org> wrote:
> 
>>  (3) With my recent changes to finding compilers, we now use xcrun to find a compiler, but not to invoke it. One possible change that could help this issue of the sdk setting would be to use the xcrun to actually invoke the compiler, passing the -sdk option to it (this option takes the sdk name, rather than the full path, letting it use its knowledge of the Xcode and sdk locations to form the ultimate path). But this option wouldn't help at all for invoking non-xcode compiler versions.
>>  (4) I played around with various ideas for getting the Xcode tools xcrun or xcodebuild to actually spit out the needed sdk path. One thing that would I think work would be to build, and include with MacPorts, a simple xcode project that contained a script phase that would print out needed paths. This project could be invoked with xcodebuild, passing it the needed -sdk name, and the output from the script phase parsed to garner any needed paths for isysroot, and even for Xcode itself if needed.
> 
>> Hopefully somebody with time and/or inclination can implement one of these options, or one of their own ;)
> 
> Generally speaking I'd say that 4) seems wrong to me, I haven't
> checked how compiler is actually invoked (exec, open, mp's tcl
> extension?) but I'd say that 3) would be a better option.

Let me be clear that #4 is just a way to get Xcode to tell us the path to the sdk(s). It wouldn't actually be used to actually build. We would just call xcodebuild with the project, and parse the output, which would give us the sdk path as needed to build our configure.sdkroot.


> I see that xcrun has a "-find" option that prints the full path to the
> tool passed as argument, has this option gone in 4.3?

In macports trunk, we call xcrun with the -find option to get it to tell us the path to the desired compiler. This seems to be working well. I suspect that final builds of Xcode 4.3 may improve the compiler installations such that this may not be necessary, but it also lets us work with the Xcode 4.3 of today, and should't hurt anything in the future. If xcrun is unable to give a path to the compiler, we fall-back to looking in /usr/bin/, etc..


More information about the macports-dev mailing list