-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
New sysconfig API: Build information - Compilation #103482
Comments
It seems maturin needs the pointer width (see https://github.com/PyO3/maturin/blob/5d5b96a9974eac26b8cdf601cd2faf64f4999de9/src/python_interpreter/sysconfig-linux.json#L10). |
Explicitly capturing the platform (not just the pointer width) that the runtime is targeting would be great. This is probably an arbitrary string used by the build toolset, rather than something universal. Because Windows OS can emulate earlier architectures, and ARM64 and AMD64 have the same pointer width, the only way to know right now that you've got (in particular) an ARM64 build is to look at Capturing the target platform at compile time would be much better. |
I would see such feature as very useful to be able to use host's python interpreter in crosstool scenario. I would be very useful to have a switch/configuration-file, which can be used to setup python-interpreter settings ( platform.* sys.platform and co) so it matches the cross-target. Actually I ran into this issue while looking into emscripten/pyodide, which suffers exactly by this right now |
For extension suffixes, there should be a way to expose the limited API name as well. xref this discussion on meson build, which resorts to using
|
Yes. All the entries in |
Feature or enhancement
sysconfig
should export all the information required to build extensions.Pitch
The new API should try to expose the information in a compiler-agnostic way.
Information to expose
sys.version_info
sys.implementation
packaging.tags
's implementation)importlib.machinery.EXTENSION_SUFFIXES
,sysconfig.get_config_var('EXT_SUFFIX')
,sysconfig.get_config_var('SHLIB_SUFFIX')
libpython
available? What's its name? Location?--enable-shared
bool(sysconfig.get_config_var('LDLIBRARY'))
sysconfig.get_config_var('LDLIBRARY')
sysconfig.get_config_var('LIBDIR')
libpython
available? What's its name? Location?--without-static-libpython
bool(sysconfig.get_config_var('LIBRARY'))
sysconfig.get_config_var('LIBRARY')
sysconfig.get_config_var('LIBDIR')
libpython
?bool(sysconfig.get_config_var('LIBPYTHON'))
--with-pydebug
bool(sysconfig.get_config_var('Py_DEBUG'))
-fwrapv
(until Enable-fstrict-overflow
#96821)-fwrapv
."definition" sections list the answer, if a question, or the value(s) of the item. "currently" sections list the current way of fetching the information.
This is list is a work in progress. Currently, we need to gather all the information that is required to build extensions. If you see anything that's missing, please comment!
Previous discussion
https://discuss.python.org/t/building-extensions-modules-in-a-post-distutils-world/23938
https://discuss.python.org/t/what-information-is-useful-to-know-statically-about-an-interpreter/25563
https://gregoryszorc.com/docs/python-build-standalone/20230116/distributions.html
New
sysconfig
API meta-issue: GH-103480The text was updated successfully, but these errors were encountered: