From 41617bd6cd957995ec9e1f89558fbdce5f78bc79 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Thu, 11 Apr 2019 16:47:10 +0200 Subject: [PATCH 1/7] issue36231 --- aclocal.m4 | 8 ++++---- configure | 5 +++++ configure.ac | 1 + pyconfig.h.in | 3 +++ setup.py | 3 ++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 85f00dd5fac7f2..51672d633d337e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -13,7 +13,7 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29.1) +dnl serial 11 (pkg-config-0.29) dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson @@ -55,7 +55,7 @@ dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29.1]) +[m4_define([PKG_MACROS_VERSION], [0.29]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ diff --git a/configure b/configure index d0ef8a601b287b..7630b048d5820a 100755 --- a/configure +++ b/configure @@ -7345,6 +7345,11 @@ $as_echo "$ac_cv_enable_implicit_function_declaration_error" >&6; } Darwin*) # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd # used to be here, but non-Apple gcc doesn't accept them. + +cat >>confdefs.h <<_ACEOF +#define Py_MACOS_SYSROOT `xcrun --show-sdk-path` +_ACEOF + if test "${CC}" = gcc then { $as_echo "$as_me:${as_lineno-$LINENO}: checking which compiler should be used" >&5 diff --git a/configure.ac b/configure.ac index 73ee71c6d24997..ac4e880e65260a 100644 --- a/configure.ac +++ b/configure.ac @@ -1781,6 +1781,7 @@ yes) Darwin*) # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd # used to be here, but non-Apple gcc doesn't accept them. + AC_DEFINE_UNQUOTED([Py_MACOS_SYSROOT], [`xcrun --show-sdk-path`], [Get the root dir of XCode]) if test "${CC}" = gcc then AC_MSG_CHECKING(which compiler should be used) diff --git a/pyconfig.h.in b/pyconfig.h.in index d41d57932766be..381d5c014c957b 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -1374,6 +1374,9 @@ externally defined: 0 */ #undef Py_HASH_ALGORITHM +/* Get the root dir of XCode */ +#undef Py_MACOS_SYSROOT + /* assume C89 semantics that RETSIGTYPE is always void */ #undef RETSIGTYPE diff --git a/setup.py b/setup.py index 30caed5b51c1ea..c8e8a3582aabab 100644 --- a/setup.py +++ b/setup.py @@ -134,7 +134,7 @@ def macosx_sdk_root(): cflags = sysconfig.get_config_var('CFLAGS') m = re.search(r'-isysroot\s+(\S+)', cflags) if m is None: - sysroot = '/' + sysroot = sysconfig.get_config_var('Py_MACOS_SYSROOT') else: sysroot = m.group(1) return sysroot @@ -669,6 +669,7 @@ def init_inc_lib_dirs(self): # NOTE: using shlex.split would technically be more correct, but # also gives a bootstrap problem. Let's hope nobody uses # directories with whitespace in the name to store libraries. + inc_dirs += ['/usr/include'] cflags, ldflags = sysconfig.get_config_vars( 'CFLAGS', 'LDFLAGS') for item in cflags.split(): From c6911f2925f0ee868dda223a4c4f3849dda95a30 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sun, 14 Apr 2019 11:33:02 +0200 Subject: [PATCH 2/7] use the new interface to inc_dirs --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c8e8a3582aabab..954752653d34e2 100644 --- a/setup.py +++ b/setup.py @@ -669,7 +669,7 @@ def init_inc_lib_dirs(self): # NOTE: using shlex.split would technically be more correct, but # also gives a bootstrap problem. Let's hope nobody uses # directories with whitespace in the name to store libraries. - inc_dirs += ['/usr/include'] + self.inc_dirs.append('/usr/include') cflags, ldflags = sysconfig.get_config_vars( 'CFLAGS', 'LDFLAGS') for item in cflags.split(): From 94dbb8b210300236d05e1c3337d75441ebeff2c2 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Thu, 11 Apr 2019 16:47:10 +0200 Subject: [PATCH 3/7] bpo-36231: no "proper" header files on macOS 10.14 Mojave --- aclocal.m4 | 8 ++++---- configure | 19 ++++++++++++++++++- configure.ac | 1 + pyconfig.h.in | 3 +++ setup.py | 3 ++- 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 85f00dd5fac7f2..51672d633d337e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -13,7 +13,7 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29.1) +dnl serial 11 (pkg-config-0.29) dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson @@ -55,7 +55,7 @@ dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29.1]) +[m4_define([PKG_MACROS_VERSION], [0.29]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ diff --git a/configure b/configure index 9c7eded8535985..262580be0c6266 100755 --- a/configure +++ b/configure @@ -783,6 +783,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -894,6 +895,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1146,6 +1148,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1283,7 +1294,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1436,6 +1447,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -7354,6 +7366,11 @@ $as_echo "$ac_cv_enable_implicit_function_declaration_error" >&6; } Darwin*) # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd # used to be here, but non-Apple gcc doesn't accept them. + +cat >>confdefs.h <<_ACEOF +#define Py_MACOS_SYSROOT `xcrun --show-sdk-path` +_ACEOF + if test "${CC}" = gcc then { $as_echo "$as_me:${as_lineno-$LINENO}: checking which compiler should be used" >&5 diff --git a/configure.ac b/configure.ac index 6450519444c8d3..1720944534688c 100644 --- a/configure.ac +++ b/configure.ac @@ -1802,6 +1802,7 @@ yes) Darwin*) # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd # used to be here, but non-Apple gcc doesn't accept them. + AC_DEFINE_UNQUOTED([Py_MACOS_SYSROOT], [`xcrun --show-sdk-path`], [Get the root dir of XCode]) if test "${CC}" = gcc then AC_MSG_CHECKING(which compiler should be used) diff --git a/pyconfig.h.in b/pyconfig.h.in index d41d57932766be..381d5c014c957b 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -1374,6 +1374,9 @@ externally defined: 0 */ #undef Py_HASH_ALGORITHM +/* Get the root dir of XCode */ +#undef Py_MACOS_SYSROOT + /* assume C89 semantics that RETSIGTYPE is always void */ #undef RETSIGTYPE diff --git a/setup.py b/setup.py index 30caed5b51c1ea..954752653d34e2 100644 --- a/setup.py +++ b/setup.py @@ -134,7 +134,7 @@ def macosx_sdk_root(): cflags = sysconfig.get_config_var('CFLAGS') m = re.search(r'-isysroot\s+(\S+)', cflags) if m is None: - sysroot = '/' + sysroot = sysconfig.get_config_var('Py_MACOS_SYSROOT') else: sysroot = m.group(1) return sysroot @@ -669,6 +669,7 @@ def init_inc_lib_dirs(self): # NOTE: using shlex.split would technically be more correct, but # also gives a bootstrap problem. Let's hope nobody uses # directories with whitespace in the name to store libraries. + self.inc_dirs.append('/usr/include') cflags, ldflags = sysconfig.get_config_vars( 'CFLAGS', 'LDFLAGS') for item in cflags.split(): From 4ed1d8afcfff7e4a817504865964c13cec028d27 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sun, 14 Apr 2019 11:59:32 +0200 Subject: [PATCH 4/7] workaround for bpo-36432, to let tests run --- Lib/test/libregrtest/setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/test/libregrtest/setup.py b/Lib/test/libregrtest/setup.py index 9a6585af9d0dd6..ebaac26bc75ef1 100644 --- a/Lib/test/libregrtest/setup.py +++ b/Lib/test/libregrtest/setup.py @@ -72,7 +72,10 @@ def setup_tests(ns): else: soft, hard = resource.getrlimit(resource.RLIMIT_STACK) newsoft = min(hard, max(soft, 1024*2048)) - resource.setrlimit(resource.RLIMIT_STACK, (newsoft, hard)) + try: + resource.setrlimit(resource.RLIMIT_STACK, (newsoft, hard)) + except ValueError: + pass if ns.huntrleaks: unittest.BaseTestSuite._cleanup = False From 16c0144a3b6e55a49fd068e9d073611389e06200 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" Date: Sun, 14 Apr 2019 10:22:57 +0000 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Misc/NEWS.d/next/macOS/2019-04-14-10-22-55.bpo-36231._BPeg4.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/macOS/2019-04-14-10-22-55.bpo-36231._BPeg4.rst diff --git a/Misc/NEWS.d/next/macOS/2019-04-14-10-22-55.bpo-36231._BPeg4.rst b/Misc/NEWS.d/next/macOS/2019-04-14-10-22-55.bpo-36231._BPeg4.rst new file mode 100644 index 00000000000000..5fed01e4424952 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2019-04-14-10-22-55.bpo-36231._BPeg4.rst @@ -0,0 +1 @@ +On macOS 10.14, Xcode comes without /usr/include. We allow MacOS build to use headers from Xcode, without an /usr/include present. \ No newline at end of file From c056cd508104386d1b51fb4f794617ee97285304 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Mon, 22 Apr 2019 04:47:22 -0400 Subject: [PATCH 6/7] using newer autotools to stay closer to master --- aclocal.m4 | 20 ++++++++++---------- configure | 14 +------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 51672d633d337e..3eb742b986e473 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -12,9 +12,9 @@ # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29) -dnl +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 12 (pkg-config-0.29.2) + dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl @@ -55,7 +55,7 @@ dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29]) +[m4_define([PKG_MACROS_VERSION], [0.29.2]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ @@ -156,7 +156,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no -AC_MSG_CHECKING([for $1]) +AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) @@ -166,11 +166,11 @@ and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else + else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs @@ -187,7 +187,7 @@ installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full diff --git a/configure b/configure index 262580be0c6266..4707828e1818fd 100755 --- a/configure +++ b/configure @@ -783,7 +783,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -895,7 +894,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1148,15 +1146,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1294,7 +1283,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1447,7 +1436,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] From 6a1b1652248fd1340d8fabb1fee86e0e3557a0a5 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Mon, 22 Apr 2019 05:23:24 -0400 Subject: [PATCH 7/7] keep the original aclocal.m4 --- aclocal.m4 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 3eb742b986e473..85f00dd5fac7f2 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -12,9 +12,9 @@ # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 12 (pkg-config-0.29.2) - +dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +dnl serial 11 (pkg-config-0.29.1) +dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl @@ -55,7 +55,7 @@ dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29.2]) +[m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ @@ -156,7 +156,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no -AC_MSG_CHECKING([for $2]) +AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) @@ -166,11 +166,11 @@ and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else + else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs @@ -187,7 +187,7 @@ installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full