-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mimalloc header is not installed #116984
Comments
Slightly unrelated, but I see that mimalloc types are embedded directly in structures such as PyInterpreterState or PyThreadState. Unless mimalloc has a stable ABI, does it risk breaking if an extension module or an application embedding Python uses its own different version of mimalloc? It's also weird that a third-party library is included from CPython headers. Perhaps it would be better to hide this behind opaque pointers. |
I walked through the discussions in #109914 and seems this issue has been already discussed (at least mentioned, but forgotten later? Or not correctly installed after moved to I also see some related about this:
If I'm not mistaken, no symbol is exported (#109914 (comment)), and the reason mimalloc headers are included is that there's extra patches on top of upstream. But the longterm plan is to upstream those (I cannot find the link to this but I believe saw Sam mentioned it somewhere). Hope it helped @pitrou |
Sure, but:
|
|
@colesbury This issue shows that "internal" headers are included by third-party code. Presumably, |
Yes, people sometimes include our internal headers. People also sometimes copy-paste our internal headers. We don't make attempts to avoid language level name conflicts in these cases. |
I certainly don't have a horse in this race, but I find it weird to on the one hand fix this issue by installing the mimalloc headers, and on the other hand to not care about the potential consequences of including said headers in third-party code. |
I'd also prefer to not need to add |
- Install mimalloc header only when enabled - Rename WITH_MIMALLOC to INSTALL_MIMALLOC
Reopening this for the |
…t file Some embedders and extensions include parts of the internal API. The pycore_mimalloc.h file is transitively include by a number of other internal headers. This avoids include errors for code that was already including those headers.
…t file Some embedders and extensions include parts of the internal API. The pycore_mimalloc.h file is transitively include by a number of other internal headers. This avoids include errors for code that was already including those headers.
…#118808) Some embedders and extensions include parts of the internal API. The pycore_mimalloc.h file is transitively include by a number of other internal headers. This avoids include errors for code that was already including those headers.
…t file (pythonGH-118808) Some embedders and extensions include parts of the internal API. The pycore_mimalloc.h file is transitively include by a number of other internal headers. This avoids include errors for code that was already including those headers. (cherry picked from commit 71cc065) Co-authored-by: Sam Gross <[email protected]>
…nt file (GH-118808) (#118866) Some embedders and extensions include parts of the internal API. The pycore_mimalloc.h file is transitively include by a number of other internal headers. This avoids include errors for code that was already including those headers. (cherry picked from commit 71cc065) Co-authored-by: Sam Gross <[email protected]>
…t file (python#118808) Some embedders and extensions include parts of the internal API. The pycore_mimalloc.h file is transitively include by a number of other internal headers. This avoids include errors for code that was already including those headers.
Closing for the PRs from @colesbury have been landed, thanks for make this more friendly! |
Bug report
Bug description:
Mimalloc is introduced in #109914.
This will cause a header not found when building any extension that includes a
pycore_*.h
header as:See following PR for detail.
CPython versions tested on:
3.13, CPython main branch
Operating systems tested on:
Linux, macOS
Linked PRs
The text was updated successfully, but these errors were encountered: