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 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 diff --git a/configure b/configure index 9c7eded8535985..4707828e1818fd 100755 --- a/configure +++ b/configure @@ -7354,6 +7354,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():