Skip to content

Conversation

henryiii
Copy link
Collaborator

@henryiii henryiii commented Aug 12, 2025

Description

Fix #5788. Make it a bit easier to interface with Qt code. Qt's terrible macro names strike again.

Suggested changelog entry:

  • Rename internal variables to avoid the word slots (reads better)

📚 Documentation preview 📚: https://pybind11--5793.org.readthedocs.build/

@henryiii henryiii force-pushed the henryiii/fix/slots branch from fdb6195 to 1e2acd5 Compare August 12, 2025 21:30
Signed-off-by: Henry Schreiner <[email protected]>

style: pre-commit fixes
@henryiii henryiii force-pushed the henryiii/fix/slots branch from e61877b to ec27916 Compare August 13, 2025 04:22
@henryiii
Copy link
Collaborator Author

Getting this on 3.13t pretty often:

FAILED ../../tests/test_gil_scoped.py::test_run_in_process_one_thread[test_callback_std_func] - RuntimeError: DEADLOCK, most likely, exactly what this test is meant to detect.
FAILED ../../tests/test_gil_scoped.py::test_run_in_process_one_thread[test_cross_module_gil_inner_pybind11_released] - RuntimeError: DEADLOCK, most likely, exactly what this test is meant to detect.
FAILED ../../tests/test_gil_scoped.py::test_run_in_process_multiple_threads_sequential[test_multi_acquire_release_cross_module] - RuntimeError: DEADLOCK, most likely, exactly what this test is meant to detect.
FAILED ../../tests/test_gil_scoped.py::test_run_in_process_direct[test_cross_module_gil_inner_custom_released] - RuntimeError: DEADLOCK, most likely, exactly what this test is meant to detect.
FAILED ../../tests/test_gil_scoped.py::test_run_in_process_direct[test_cross_module_gil_inner_custom_acquired] - RuntimeError: DEADLOCK, most likely, exactly what this test is meant to detect.

@rwgk
Copy link
Collaborator

rwgk commented Aug 14, 2025

Getting this on 3.13t pretty often:

FAILED ../../tests/test_gil_scoped.py::test_run_in_process_one_thread[test_callback_std_func] - RuntimeError: DEADLOCK, most likely, exactly what this test is meant to detect.
FAILED ../../tests/test_gil_scoped.py::test_run_in_process_one_thread[test_cross_module_gil_inner_pybind11_released] - RuntimeError: DEADLOCK, most likely, exactly what this test is meant to detect.
FAILED ../../tests/test_gil_scoped.py::test_run_in_process_multiple_threads_sequential[test_multi_acquire_release_cross_module] - RuntimeError: DEADLOCK, most likely, exactly what this test is meant to detect.
FAILED ../../tests/test_gil_scoped.py::test_run_in_process_direct[test_cross_module_gil_inner_custom_released] - RuntimeError: DEADLOCK, most likely, exactly what this test is meant to detect.
FAILED ../../tests/test_gil_scoped.py::test_run_in_process_direct[test_cross_module_gil_inner_custom_acquired] - RuntimeError: DEADLOCK, most likely, exactly what this test is meant to detect.

Yeah ... it used to be rare until about a month ago, but suddenly this particular test

CI / 🐍 (macos-13, 3.13t, -DCMAKE_CXX_STANDARD=11)

started failing very often. I don't know why, but I believe almost certainly this is unrelated to changes in pybind11.

Maybe there was a Python 3.13 patch release? Or the macOS runners had some change?

If nobody has time to drill down (I don't), maybe we should just disable those tests under macOS with free-threading?

@rwgk
Copy link
Collaborator

rwgk commented Aug 14, 2025

It wasn't quite a month ago, this was the first time I noticed, July 28, 2025:

#5776 (comment)

@Osyotr
Copy link

Osyotr commented Aug 15, 2025

@rwgk
Copy link
Collaborator

rwgk commented Aug 16, 2025

This is probably not enough to fix the original problem. https://github.com/python/cpython/blob/0607fdd56c7c5e7f0949f9a6ef95609e9437b1eb/Include/object.h#L509

That's in the cpython sources. There is nothing we can do about that, but I'd vote for merging @Henriii's changes, they make the naming better in general.

@henryiii
Copy link
Collaborator Author

You tagged the wrong henryiii, FYI :)

@henryiii henryiii changed the title fix: better compatibilty with Qt chore: rename generic slots variable Aug 20, 2025
@henryiii henryiii merged commit adb5603 into pybind:master Aug 21, 2025
213 of 220 checks passed
@henryiii henryiii deleted the henryiii/fix/slots branch August 21, 2025 15:06
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Aug 21, 2025
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: latent slots macro conflicts with Qt project

3 participants