Title: New sysconfig API: Build information - Compilation · Issue #103482 · python/cpython · GitHub
Open Graph Title: New sysconfig API: Build information - Compilation · Issue #103482 · python/cpython
X Title: New sysconfig API: Build information - Compilation · Issue #103482 · python/cpython
Description: 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 Python version currently: sys.versi...
Open Graph Description: 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 ex...
X Description: 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 ex...
Opengraph URL: https://github.com/python/cpython/issues/103482
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"New sysconfig API: Build information - Compilation","articleBody":"# Feature or enhancement\r\n\r\n`sysconfig` should export **all** the information required to build extensions.\r\n\r\n# Pitch\r\n\r\nThe new API should try to expose the information in a compiler-agnostic way.\r\n\r\n## Information to expose\r\n\r\n- Python version\r\n - currently: `sys.version_info`\r\n- Interpreter version\r\n - currently: `sys.implementation`\r\n- Extension suffixes\r\n - definition: See [PEP 3149](https://peps.python.org/pep-3149/)\r\n - consideration: PEP 3149 only defines the names for POSIX\r\n - Windows and other platforms still seem to follow it mostly (refer to [`packaging.tags`'s implementation](https://github.com/pypa/packaging/blob/5b34465682d40ddd42dd6cba88e158e1674de7b9/src/packaging/tags.py#L135-L168))\r\n - Windows\r\n - design: The API should identify the different extensions types (interpreter, stable abi, none)\r\n - currently: `importlib.machinery.EXTENSION_SUFFIXES`, `sysconfig.get_config_var('EXT_SUFFIX')`, `sysconfig.get_config_var('SHLIB_SUFFIX')`\r\n- Is a shared `libpython` available? What's its name? Location?\r\n - definition: Yes if built with `--enable-shared`\r\n - currently:\r\n - (available?) `bool(sysconfig.get_config_var('LDLIBRARY'))`\r\n - (name?) `sysconfig.get_config_var('LDLIBRARY')`\r\n - (location?) `sysconfig.get_config_var('LIBDIR')`\r\n- Is a static `libpython` available? What's its name? Location?\r\n - definition: Yes unless built with `--without-static-libpython`\r\n - currently:\r\n - (available?) `bool(sysconfig.get_config_var('LIBRARY'))`\r\n - (name?) `sysconfig.get_config_var('LIBRARY')`\r\n - (location?) `sysconfig.get_config_var('LIBDIR')`\r\n- Should extensions link against `libpython`?\r\n - definition: Yes on Android and Cygwin, no everywhere else (see GH-65735)\r\n - currently: `bool(sysconfig.get_config_var('LIBPYTHON'))`\r\n- Is it a debug build?\r\n - definition: Yes if built with `--with-pydebug`\r\n - currently: `bool(sysconfig.get_config_var('Py_DEBUG'))`\r\n- C flags needed when using the C API\r\n - definition:\r\n - `-fwrapv` (until GH-96821)\r\n - Currently, we have unsafe code, and for a lack of a better option we assume it made into C macros, so extensions that use the C API should use `-fwrapv`.\r\n- **what else? please comment...**\r\n\r\n###### \"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.\r\n\r\nThis 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!\r\n\r\n# Previous discussion\r\n\r\nhttps://discuss.python.org/t/building-extensions-modules-in-a-post-distutils-world/23938\r\nhttps://discuss.python.org/t/what-information-is-useful-to-know-statically-about-an-interpreter/25563\r\nhttps://gregoryszorc.com/docs/python-build-standalone/20230116/distributions.html\r\n\r\nNew `sysconfig` API meta-issue: GH-103480","author":{"url":"https://github.com/FFY00","@type":"Person","name":"FFY00"},"datePublished":"2023-04-12T18:48:09Z","url":"https://github.com/python/cpython/issues/103482"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:be08dcda-b7f1-a748-4b0b-07e0c8155a24 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ABB8:1CCECA:167072A:1DD22B8:6B0211E3 |
| html-safe-nonce | dff9338820ec414d1c673c1909eda9eaadd651af46fb89fc95d881536dd2e185 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkI4OjFDQ0VDQToxNjcwNzJBOjFERDIyQjg6NkIwMjExRTMiLCJ2aXNpdG9yX2lkIjoiMzk3OTY3NDUwMDIxNTIxNDU2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 19bd9896269294e91631dae4593f636528177431cc7e97bef0ccece95812baaa |
| hovercard-subject-tag | issue:1665071413 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/103482/issue_layout |
| twitter:image | https://opengraph.githubassets.com/372ca9fbc2bdc74244a938d169444378839ec7ef5a5273ee44a5a15e8ce22015/python/cpython/issues/103482 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/372ca9fbc2bdc74244a938d169444378839ec7ef5a5273ee44a5a15e8ce22015/python/cpython/issues/103482 |
| og:image:alt | 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 ex... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | FFY00 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width