tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: OSX: No suitable Xcode SDK or Command Line Tools installed [patch/hack]

On Thu, 26 Nov 2015, Jonathan Perkin wrote:
I've updated XCode on my system running OS X 10.10.5 the other day,
and now pkgsrc tells me:

	promise% make
	ERROR: This package has set PKG_FAIL_REASON:
===> 	ERROR: No suitable Xcode SDK or Command Line Tools installed.
	ERROR: graphviz-2.38.0nb9 requires a working dlopen().
	*** Error code 1

	bmake: stopped in /usr/pkgsrc/graphics/graphviz

Most likely not, at least helloworld.c builds & runs fine.
So, digging deeper apparently latest XCode thinks it's 10.11 time,
and thus (in pkgsrc/mk/pkatform/ OSX_VERS gets set wrong,
then the SDK version is of course wrong, and then no proper headers can be
found, etc.

Digging deeper (see below), I whipped the attached patch together.

Any comments? Improvements (I'm sure there are many)?

How is building against a newer SDK than what you are running going to
work?  I confess I haven't tried this in a bulk build yet, but I'm
pretty sure it's going to end badly (or worse, in ways that are hard
to debug).

For now the only sensible route seems to be installing the Command
Line Tools as indicated, until Apple either start shipping the 10.10
SDK in XCode 7, or stop tricking 10.10 users into upgrading to an
XCode which doesn't support their system.

If you have 10.9 and update Xcode, that's the situation that you end up: A working build environment, where only pkgsrc doesn't work. I don't think that denying users (and me) a working pkgsrc "just because" is a useful option, as there is a patch available that fixes the situation.

I have tested the patch with the latest pkgsrc release with a bunch of pkgs, and everything works fine.

So, are there any real concerns before committing this?

Updated patch that also fixes p5-Curses is attached below.

 - Hubert

Index: mk/platform/
RCS file: /cvsroot/pkgsrc/mk/platform/,v
retrieving revision 1.76
diff -u -r1.76
--- mk/platform/	14 Dec 2015 14:14:33 -0000	1.76
+++ mk/platform/	5 Jan 2016 13:03:56 -0000
@@ -95,6 +95,10 @@
 .  endif
 OSX_SDK_PATH!=	/usr/bin/xcrun --sdk macosx${OSX_VERS} --show-sdk-path 2>/dev/null || echo /nonexistent
+.  if !empty(OSX_SDK_PATH:M/nonexistent)
+OSX_VERS!=	/usr/bin/xcodebuild -showsdks | grep '.*-sdk macosx' | sed 's,.*macosx,,'
+OSX_SDK_PATH!=	/usr/bin/xcrun --sdk macosx${OSX_VERS} --show-sdk-path 2>/dev/null || echo /nonexistent
+.  endif
 .  if exists(${OSX_SDK_PATH}/usr/include/stdio.h)
Index: devel/p5-Curses/Makefile
RCS file: /cvsroot/pkgsrc/devel/p5-Curses/Makefile,v
retrieving revision 1.52
diff -u -r1.52 Makefile
--- devel/p5-Curses/Makefile	18 Aug 2015 07:31:05 -0000	1.52
+++ devel/p5-Curses/Makefile	5 Jan 2016 12:56:16 -0000
@@ -19,7 +19,7 @@
 SUBST_STAGE.h_form	= post-configure
 SUBST_MESSAGE.h_form	= Hard wiring form.h
 SUBST_FILES.h_form	= c-config.h
-SUBST_SED.h_form	= -e 's,<form.h>,"/usr/include/form.h",g'
+SUBST_SED.h_form	= -e 's,<form.h>,"${OSX_SDK_PATH}/usr/include/form.h",g'


Home | Main Index | Thread Index | Old Index