Skip to content

chore: rename generic slots variable - #5793

Merged
henryiii merged 2 commits into
pybind:masterfrom
henryiii:henryiii/fix/slots
Aug 21, 2025
Merged

chore: rename generic slots variable#5793
henryiii merged 2 commits into
pybind:masterfrom
henryiii:henryiii/fix/slots

Conversation

@henryiii

@henryiiihenryiii commented Aug 12, 2025

Copy link
Copy Markdown
Collaborator

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/

Comment threadinclude/pybind11/detail/common.h Outdated
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
style: pre-commit fixes
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii

Copy link
Copy Markdown
CollaboratorAuthor

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

rwgk commented Aug 14, 2025

Copy link
Copy Markdown
Collaborator

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

rwgk commented Aug 14, 2025

Copy link
Copy Markdown
Collaborator

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

#5776 (comment)

@Osyotr

Copy link
Copy Markdown

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

@rwgk

rwgk commented Aug 16, 2025

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
CollaboratorAuthor

You tagged the wrong henryiii, FYI :)

@henryiiihenryiii changed the title fix: better compatibilty with Qtchore: rename generic slots variableAug 20, 2025
@henryiii
henryiii merged commit adb5603 into pybind:masterAug 21, 2025
213 of 220 checks passed
@henryiii
henryiii deleted the henryiii/fix/slots branch August 21, 2025 15:06
@github-actionsgithub-actionsBot added the needs changelog Possibly needs a changelog entry label Aug 21, 2025
@henryiiihenryiii removed the needs changelog Possibly needs a changelog entry label Aug 22, 2025
Sign up for freeto 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

@henryiii@rwgk@Osyotr