Compare commits

...

3 Commits

Author SHA1 Message Date
Jochen Sprickerhof
8c623ff8cc
Merge 4dfee47c5d into 83b92ceb35 2024-11-20 21:39:27 +08:00
Michael Šimáček
83b92ceb35
Try to fix reentrant write transient failures in tests (#5447)
* Disable print_destroyed in tests on GraalPy

* Reenable test_iostream on GraalPy
2024-11-18 14:39:59 -08:00
Jochen Sprickerhof
4dfee47c5d
fix: don't strip with BUILD_TYPE None
Debian builds with None by default and takes care of stripping itself.
This allows building debug symbol packages.
2024-09-30 16:26:53 +02:00
4 changed files with 10 additions and 8 deletions

View File

@ -312,8 +312,16 @@ void print_created(T *inst, Values &&...values) {
} }
template <class T, typename... Values> template <class T, typename... Values>
void print_destroyed(T *inst, Values &&...values) { // Prints but doesn't store given values void print_destroyed(T *inst, Values &&...values) { // Prints but doesn't store given values
/*
* On GraalPy, destructors can trigger anywhere and this can cause random
* failures in unrelated tests.
*/
#if !defined(GRAALVM_PYTHON)
print_constr_details(inst, "destroyed", values...); print_constr_details(inst, "destroyed", values...);
track_destroyed(inst); track_destroyed(inst);
#else
py::detail::silence_unused_warnings(inst, values...);
#endif
} }
template <class T, typename... Values> template <class T, typename... Values>
void print_values(T *inst, Values &&...values) { void print_values(T *inst, Values &&...values) {

View File

@ -6,14 +6,8 @@ from io import StringIO
import pytest import pytest
import env # noqa: F401
from pybind11_tests import iostream as m from pybind11_tests import iostream as m
pytestmark = pytest.mark.skipif(
"env.GRAALPY",
reason="Delayed prints from finalizers from other tests can end up in the output",
)
def test_captured(capsys): def test_captured(capsys):
msg = "I've been redirected to Python, I hope!" msg = "I've been redirected to Python, I hope!"

View File

@ -307,7 +307,7 @@ function(pybind11_add_module target_name)
if(DEFINED CMAKE_BUILD_TYPE) # see https://github.com/pybind/pybind11/issues/4454 if(DEFINED CMAKE_BUILD_TYPE) # see https://github.com/pybind/pybind11/issues/4454
# Use case-insensitive comparison to match the result of $<CONFIG:cfgs> # Use case-insensitive comparison to match the result of $<CONFIG:cfgs>
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
if(NOT MSVC AND NOT "${uppercase_CMAKE_BUILD_TYPE}" MATCHES DEBUG|RELWITHDEBINFO) if(NOT MSVC AND NOT "${uppercase_CMAKE_BUILD_TYPE}" MATCHES DEBUG|RELWITHDEBINFO|NONE)
# Strip unnecessary sections of the binary on Linux/macOS # Strip unnecessary sections of the binary on Linux/macOS
pybind11_strip(${target_name}) pybind11_strip(${target_name})
endif() endif()

View File

@ -196,7 +196,7 @@ function(pybind11_add_module target_name)
if(DEFINED CMAKE_BUILD_TYPE) # see https://github.com/pybind/pybind11/issues/4454 if(DEFINED CMAKE_BUILD_TYPE) # see https://github.com/pybind/pybind11/issues/4454
# Use case-insensitive comparison to match the result of $<CONFIG:cfgs> # Use case-insensitive comparison to match the result of $<CONFIG:cfgs>
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
if(NOT MSVC AND NOT "${uppercase_CMAKE_BUILD_TYPE}" MATCHES DEBUG|RELWITHDEBINFO) if(NOT MSVC AND NOT "${uppercase_CMAKE_BUILD_TYPE}" MATCHES DEBUG|RELWITHDEBINFO|NONE)
pybind11_strip(${target_name}) pybind11_strip(${target_name})
endif() endif()
endif() endif()