Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gCVDB-00071c-C6 for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Oct 2018 19:41:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gCVD9-0004vY-Hn for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Oct 2018 19:40:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gCVD9-0004vR-Ap for pgsql-hackers@lists.postgresql.org; Tue, 16 Oct 2018 19:40:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gCVD2-0001FP-39 for pgsql-hackers@lists.postgresql.org; Tue, 16 Oct 2018 19:40:58 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w9GJe4xb026792; Tue, 16 Oct 2018 15:40:05 -0400 From: Tom Lane To: Jakob Egger cc: pgsql-hackers@lists.postgresql.org Subject: Re: PG vs macOS Mojave In-reply-to: <486.1539702831@sss.pgh.pa.us> References: <20840.1537850987@sss.pgh.pa.us> <29535.1539698523@sss.pgh.pa.us> <486.1539702831@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 16 Oct 2018 11:13:51 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <26759.1539718768.0@sss.pgh.pa.us> Date: Tue, 16 Oct 2018 15:40:04 -0400 Message-ID: <26791.1539718804@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26759.1539718768.1@sss.pgh.pa.us> I wrote: > If we go this route, then the configure-time sysroot path will get > embedded into $perl_includedir and $TCL_INCLUDE_SPEC, but noplace > else. I don't know how far that would improve your concern about > extensions, but it should help a little. > I'm still a bit dubious about the safety of building extensions > with different SDKs than the server, but if it worked for you > before then there's no reason for us to break it further than > we have to. Concretely, I'm planning to push the attached as soon as I finish back-patching it. regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="get-rid-of-isysroot-again.patch"; charset="us-ascii" Content-ID: <26759.1539718768.2@sss.pgh.pa.us> Content-Description: get-rid-of-isysroot-again.patch Content-Transfer-Encoding: quoted-printable diff --git a/configure b/configure index b7250d7..5e686b2 100755 *** a/configure --- b/configure *************** PL/Perl." "$LINENO" 5 *** 9778,9784 **** perl_includedir=3D"$perl_archlibexp" # ... but on some macOS versions, we must look under $PG_SYSROOT inste= ad if test x"$PG_SYSROOT" !=3D x"" ; then ! if test -d "$PG_SYSROOT$perl_archlibexp" ; then perl_includedir=3D"$PG_SYSROOT$perl_archlibexp" fi fi --- 9778,9784 ---- perl_includedir=3D"$perl_archlibexp" # ... but on some macOS versions, we must look under $PG_SYSROOT inste= ad if test x"$PG_SYSROOT" !=3D x"" ; then ! if test -f "$PG_SYSROOT$perl_archlibexp/CORE/perl.h" ; then perl_includedir=3D"$PG_SYSROOT$perl_archlibexp" fi fi *************** eval TCL_SHARED_BUILD=3D\"$TCL_SHARED_BUIL *** 18114,18119 **** --- 18114,18124 ---- as_fn_error $? "cannot build PL/Tcl because Tcl is not a shared li= brary Use --without-tcl to disable building PL/Tcl." "$LINENO" 5 fi + # Some macOS versions report an include spec that uses -iwithsysroot= . + # We don't really want to use -isysroot, so translate that if we can= . + if test x"$PG_SYSROOT" !=3D x"" ; then + TCL_INCLUDE_SPEC=3D"`echo "$TCL_INCLUDE_SPEC" | sed "s|-iwithsys= root */|-I $PG_SYSROOT/|"`" + fi # now that we have TCL_INCLUDE_SPEC, we can check for ac_save_CPPFLAGS=3D$CPPFLAGS CPPFLAGS=3D"$TCL_INCLUDE_SPEC $CPPFLAGS" diff --git a/configure.in b/configure.in index de5f777..d8487aa 100644 *** a/configure.in --- b/configure.in *************** PL/Perl.]) *** 1048,1054 **** perl_includedir=3D"$perl_archlibexp" # ... but on some macOS versions, we must look under $PG_SYSROOT inste= ad if test x"$PG_SYSROOT" !=3D x"" ; then ! if test -d "$PG_SYSROOT$perl_archlibexp" ; then perl_includedir=3D"$PG_SYSROOT$perl_archlibexp" fi fi --- 1048,1054 ---- perl_includedir=3D"$perl_archlibexp" # ... but on some macOS versions, we must look under $PG_SYSROOT inste= ad if test x"$PG_SYSROOT" !=3D x"" ; then ! if test -f "$PG_SYSROOT$perl_archlibexp/CORE/perl.h" ; then perl_includedir=3D"$PG_SYSROOT$perl_archlibexp" fi fi *************** if test "$with_tcl" =3D yes; then *** 2211,2216 **** --- 2211,2221 ---- AC_MSG_ERROR([cannot build PL/Tcl because Tcl is not a shared libr= ary Use --without-tcl to disable building PL/Tcl.]) fi + # Some macOS versions report an include spec that uses -iwithsysroot= . + # We don't really want to use -isysroot, so translate that if we can= . + if test x"$PG_SYSROOT" !=3D x"" ; then + TCL_INCLUDE_SPEC=3D"`echo "$TCL_INCLUDE_SPEC" | sed "s|-iwithsys= root */|-I $PG_SYSROOT/|"`" + fi # now that we have TCL_INCLUDE_SPEC, we can check for ac_save_CPPFLAGS=3D$CPPFLAGS CPPFLAGS=3D"$TCL_INCLUDE_SPEC $CPPFLAGS" diff --git a/src/template/darwin b/src/template/darwin index cff258b..7022733 100644 *** a/src/template/darwin --- b/src/template/darwin *************** *** 3,16 **** # Note: Darwin is the original code name for macOS, also known as OS X. # We still use "darwin" as the port name, partly because config.guess do= es. = ! # Select where system include files should be sought. if test x"$PG_SYSROOT" =3D x"" ; then PG_SYSROOT=3D`xcodebuild -version -sdk macosx Path 2>/dev/null` fi if test x"$PG_SYSROOT" !=3D x"" ; then ! if test -d "$PG_SYSROOT" ; then ! CPPFLAGS=3D"$CPPFLAGS -isysroot $PG_SYSROOT" ! else PG_SYSROOT=3D"" fi fi --- 3,17 ---- # Note: Darwin is the original code name for macOS, also known as OS X. # We still use "darwin" as the port name, partly because config.guess do= es. = ! # Select where some include files should be sought. ! # We may eventually be forced to use "-isysroot" with this value, ! # but for now, it only affects Perl and Tcl include files. if test x"$PG_SYSROOT" =3D x"" ; then PG_SYSROOT=3D`xcodebuild -version -sdk macosx Path 2>/dev/null` fi + # Old xcodebuild versions may produce garbage, so validate the result. if test x"$PG_SYSROOT" !=3D x"" ; then ! if test \! -d "$PG_SYSROOT" ; then PG_SYSROOT=3D"" fi fi ------- =_aaaaaaaaaa0--