Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-36231: no "proper" header files on macOS 10.14 Mojave #12825

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Lib/test/libregrtest/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 4 additions & 4 deletions aclocal.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
# generated automatically by aclocal 1.15 -*- Autoconf -*-
dimpase marked this conversation as resolved.
Show resolved Hide resolved

# 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,
Expand All @@ -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 <[email protected]>.
dnl Copyright © 2012-2015 Dan Nicholson <[email protected]>
Expand Down Expand Up @@ -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
Expand Down
19 changes: 18 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
Expand Down Expand Up @@ -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}'
Expand Down Expand Up @@ -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=* \
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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]
dimpase marked this conversation as resolved.
Show resolved Hide resolved
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions pyconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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():
Expand Down