Closed
Labels
3.11only security fixesonly security fixesbuildThe build process and cross-buildThe build process and cross-buildinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
Description
| BPO | 46915 |
|---|---|
| Nosy | @vstinner, @tiran, @pablogsal |
| PRs |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = 'https://github.com/vstinner'
closed_at = None
created_at = <Date 2022-03-03.21:15:25.727>
labels = ['interpreter-core', 'build', '3.11']
title = 'Build with Py_LIMITED_API fails unknown type name \xe2\x80\x98PyModuleDef_Slot\xe2\x80\x99'
updated_at = <Date 2022-03-12.00:35:14.453>
user = 'https://github.com/tiran'bugs.python.org fields:
activity = <Date 2022-03-12.00:35:14.453>
actor = 'vstinner'
assignee = 'vstinner'
closed = False
closed_date = None
closer = None
components = ['Build', 'Interpreter Core']
creation = <Date 2022-03-03.21:15:25.727>
creator = 'christian.heimes'
dependencies = []
files = []
hgrepos = []
issue_num = 46915
keywords = ['3.11regression']
message_count = 7.0
messages = ['414473', '414474', '414475', '414476', '414480', '414488', '414956']
nosy_count = 3.0
nosy_names = ['vstinner', 'christian.heimes', 'pablogsal']
pr_nums = ['31667']
priority = 'normal'
resolution = None
stage = 'resolved'
status = 'open'
superseder = None
type = 'compile error'
url = 'https://bugs.python.org/issue46915'
versions = ['Python 3.11']Metadata
Metadata
Assignees
Labels
3.11only security fixesonly security fixesbuildThe build process and cross-buildThe build process and cross-buildinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
Activity
tiran commentedon Mar 3, 2022
Extension modules with bare "#define Py_LIMITED_API" without version fail to build with error:
moduleobject.h:82:3: error: unknown type name ‘PyModuleDef_Slot’
The issue was introduced in PR #75709 and bpo-45459. The type PyModuleDef_Slot is only defined when Py_LIMITED_API is set to Python 3.5.0 or higher.
tiran commentedon Mar 3, 2022
The problem was first reported to PyCA cryptography project in bug pyca/cryptography#6929
tiran commentedon Mar 3, 2022
With fix:
Without fix:
gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/python311/include/python3.11 -c build/temp.linux-x86_64-3.11/_openssl.c -o build/temp.linux-x86_64-3.11/build/temp.linux-x86_64-3.11/_openssl.o -Wconversion -Wno-error=sign-conversion
In file included from /tmp/python311/include/python3.11/Python.h:66,
from build/temp.linux-x86_64-3.11/_openssl.c:57:
/tmp/python311/include/python3.11/moduleobject.h:82:3: error: unknown type name ‘PyModuleDef_Slot’
82 | PyModuleDef_Slot *m_slots;
| ^~~~~~~~~~~~~~~~
2 remaining items
tiran commentedon Mar 3, 2022
Please add a blurb entry.
vstinner commentedon Mar 12, 2022
This change is now part of Python 3.11 alpha6 released a few days ago. Python 3.11a6 news entries were merged into the Misc/NEWS.d/3.11.0a6.rst file.
I consider that the changelog is for changes which impacts users when they update. The regression was introduced after 3.11 alpha5 but fixed before Python 3.11 alpha6. Only projects using contiguous integration were impacted. Only the cryptography project was impacted in practice.
This issue was closed as with the comment:
"Going to close this as it's an upstream python bug that's now been fixed."
kumaraditya303 commentedon May 9, 2022
Since only alpha6 was impacted and is now fixed, I am closing the issue.