Skip to content

Commit a387687

Browse files
committed
gh-141563: Fix test_cppext on macOS (#144685)
Don't test internal header files including mimalloc on macOS since mimalloc emits compiler warnings: In file included from extension.cpp:21: In file included from Include/internal/pycore_backoff.h:15: In file included from Include/internal/pycore_interp_structs.h:15: In file included from Include/internal/pycore_tstate.h:14: In file included from Include/internal/pycore_mimalloc.h:43: Include/internal/mimalloc/mimalloc.h:464:85: error: defaulted function definitions are a C++11 extension [-Werror,-Wc++11-extensions] mi_stl_allocator() mi_attr_noexcept = default; ^ Include/internal/mimalloc/mimalloc.h:465:85: error: defaulted function definitions are a C++11 extension [-Werror,-Wc++11-extensions] mi_stl_allocator(const mi_stl_allocator&) mi_attr_noexcept = default; Log also CXX and CXXFLAGS env vars in test_cppext. Log also CPPFLAGS in test_cext.
1 parent c407660 commit a387687

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Lib/test/test_cext/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def main():
113113
print(f"Add PCbuild directory: {pcbuild}")
114114

115115
# Display information to help debugging
116-
for env_name in ('CC', 'CFLAGS'):
116+
for env_name in ('CC', 'CFLAGS', 'CPPFLAGS'):
117117
if env_name in os.environ:
118118
print(f"{env_name} env var: {os.environ[env_name]!r}")
119119
else:

Lib/test/test_cppext/extension.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
# include "internal/pycore_frame.h"
1919
// mimalloc emits many compiler warnings when Python is built in debug
2020
// mode (when MI_DEBUG is not zero).
21-
// mimalloc emits compiler warnings when Python is built on Windows.
22-
# if !defined(Py_DEBUG) && !defined(MS_WINDOWS)
21+
// mimalloc emits compiler warnings when Python is built on Windows
22+
// and macOS.
23+
# if !defined(Py_DEBUG) && !defined(MS_WINDOWS) && !defined(__APPLE__)
2324
# include "internal/pycore_backoff.h"
2425
# include "internal/pycore_cell.h"
2526
# endif

Lib/test/test_cppext/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def main():
101101
print(f"Add PCbuild directory: {pcbuild}")
102102

103103
# Display information to help debugging
104-
for env_name in ('CC', 'CFLAGS', 'CPPFLAGS'):
104+
for env_name in ('CC', 'CXX', 'CFLAGS', 'CPPFLAGS', 'CXXFLAGS'):
105105
if env_name in os.environ:
106106
print(f"{env_name} env var: {os.environ[env_name]!r}")
107107
else:

0 commit comments

Comments
 (0)