From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jakob Egger <jakob@eggerapps.at>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: PG vs macOS Mojave
Date: Tue, 16 Oct 2018 15:40:04 -0400
Message-ID: <26791.1539718804@sss.pgh.pa.us> (raw)
In-Reply-To: <486.1539702831@sss.pgh.pa.us>
References: <20840.1537850987@sss.pgh.pa.us>
<DF261D4E-DFB6-4474-9B35-7BBEC93AD959@eggerapps.at>
<29535.1539698523@sss.pgh.pa.us>
<486.1539702831@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
Attachments:get-rid-of-isysroot-again.patch (text/x-diff, 4.1K) downloaddiff --git a/configure b/configureindex b7250d7..5e686b2 100755
*** a/configure
--- b/configure
*************** PL/Perl." "$LINENO" 5
*** 9778,9784 ****
perl_includedir="$perl_archlibexp"
# ... but on some macOS versions, we must look under $PG_SYSROOT instead
if test x"$PG_SYSROOT" != x"" ; then
! if test -d "$PG_SYSROOT$perl_archlibexp" ; then
perl_includedir="$PG_SYSROOT$perl_archlibexp"
fi
fi
--- 9778,9784 ----
perl_includedir="$perl_archlibexp"
# ... but on some macOS versions, we must look under $PG_SYSROOT instead
if test x"$PG_SYSROOT" != x"" ; then
! if test -f "$PG_SYSROOT$perl_archlibexp/CORE/perl.h" ; then
perl_includedir="$PG_SYSROOT$perl_archlibexp"
fi
fi
*************** eval TCL_SHARED_BUILD=\"$TCL_SHARED_BUIL
*** 18114,18119 ****
--- 18114,18124 ----
as_fn_error $? "cannot build PL/Tcl because Tcl is not a shared library
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" != x"" ; then+ TCL_INCLUDE_SPEC="`echo "$TCL_INCLUDE_SPEC" | sed "s|-iwithsysroot */|-I $PG_SYSROOT/|"`"+ fi
# now that we have TCL_INCLUDE_SPEC, we can check for <tcl.h>
ac_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$TCL_INCLUDE_SPEC $CPPFLAGS"
diff --git a/configure.in b/configure.inindex de5f777..d8487aa 100644
*** a/configure.in
--- b/configure.in
*************** PL/Perl.])
*** 1048,1054 ****
perl_includedir="$perl_archlibexp"
# ... but on some macOS versions, we must look under $PG_SYSROOT instead
if test x"$PG_SYSROOT" != x"" ; then
! if test -d "$PG_SYSROOT$perl_archlibexp" ; then
perl_includedir="$PG_SYSROOT$perl_archlibexp"
fi
fi
--- 1048,1054 ----
perl_includedir="$perl_archlibexp"
# ... but on some macOS versions, we must look under $PG_SYSROOT instead
if test x"$PG_SYSROOT" != x"" ; then
! if test -f "$PG_SYSROOT$perl_archlibexp/CORE/perl.h" ; then
perl_includedir="$PG_SYSROOT$perl_archlibexp"
fi
fi
*************** if test "$with_tcl" = yes; then
*** 2211,2216 ****
--- 2211,2221 ----
AC_MSG_ERROR([cannot build PL/Tcl because Tcl is not a shared library
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" != x"" ; then+ TCL_INCLUDE_SPEC="`echo "$TCL_INCLUDE_SPEC" | sed "s|-iwithsysroot */|-I $PG_SYSROOT/|"`"+ fi
# now that we have TCL_INCLUDE_SPEC, we can check for <tcl.h>
ac_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$TCL_INCLUDE_SPEC $CPPFLAGS"
diff --git a/src/template/darwin b/src/template/darwinindex 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 does.
! # Select where system include files should be sought.
if test x"$PG_SYSROOT" = x"" ; then
PG_SYSROOT=`xcodebuild -version -sdk macosx Path 2>/dev/null`
fi
if test x"$PG_SYSROOT" != x"" ; then
! if test -d "$PG_SYSROOT" ; then
! CPPFLAGS="$CPPFLAGS -isysroot $PG_SYSROOT"
! else
PG_SYSROOT=""
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 does.
! # 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" = x"" ; then
PG_SYSROOT=`xcodebuild -version -sdk macosx Path 2>/dev/null`
fi
+ # Old xcodebuild versions may produce garbage, so validate the result.
if test x"$PG_SYSROOT" != x"" ; then
! if test \! -d "$PG_SYSROOT" ; then
PG_SYSROOT=""
fi
fi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, jakob@eggerapps.at, pgsql-hackers@lists.postgresql.org
Subject: Re: PG vs macOS Mojave
In-Reply-To: <26791.1539718804@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox