Title: Do we statically compile in extension modules? · python/prebuilt-cpython · Discussion #7 · GitHub
Open Graph Title: Do we statically compile in extension modules? · python/prebuilt-cpython · Discussion #7
X Title: Do we statically compile in extension modules? · python/prebuilt-cpython · Discussion #7
Description: Do we statically compile in extension modules?
Open Graph Description: I'm assuming not, but there might be reasons to that I'm not thinking of?
X Description: I'm assuming not, but there might be reasons to that I'm not thinking of?
Opengraph URL: https://github.com/python/prebuilt-cpython/discussions/7
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Do we statically compile in extension modules?","text":"\u003cp dir=\"auto\"\u003eI'm assuming not, but there might be reasons to that I'm not thinking of?\u003c/p\u003e","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"\u003cp dir=\"auto\"\u003eThe broader Python ecosystem expects modules to not be statically linked in. We had to spin out \u003ccode class=\"notranslate\"\u003e_tkinter\u003c/code\u003e into a separate module to make matplotlib and PIL work, because they have code that uses \u003ccode class=\"notranslate\"\u003e_tkinter.__file__\u003c/code\u003e as a way to get at the underlying Tcl/Tk library. In other words, the \u003ccode class=\"notranslate\"\u003edlsym\u003c/code\u003e API (on all POSIX platforms, not just Linux!), and things on top of it like \u003ccode class=\"notranslate\"\u003ectypes\u003c/code\u003e, is oriented around getting handles out of filenames, and while the argument that you should avoid \u003ccode class=\"notranslate\"\u003e__file__\u003c/code\u003e is \u003cem\u003eusually\u003c/em\u003e correct, there is no alternative for it for dynamic libraries.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eWe also ran into a problem recently where CPython 3.14's source code assumed that the \u003ccode class=\"notranslate\"\u003e_asyncio\u003c/code\u003e module was a separate file and so the fancy new asyncio remote debugging stuff didn't work. It turns out that CPython 3.15 now statically links that module, and I solved this by cherry-picking that patch (\u003ca class=\"issue-link js-issue-link\" data-error-text=\"Failed to load title\" data-id=\"3431476579\" data-permission-text=\"Title is private\" data-url=\"https://github.com/astral-sh/python-build-standalone/issues/804\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"/astral-sh/python-build-standalone/pull/804/hovercard\" href=\"https://github.com/astral-sh/python-build-standalone/pull/804\"\u003eastral-sh/python-build-standalone#804\u003c/a\u003e). I think that's another argument that it's worth not diverging from upstream CPython's default build config.\u003c/p\u003e","upvoteCount":0,"url":"https://github.com/python/prebuilt-cpython/discussions/7#discussioncomment-14730815"}}}
| 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 | /:user_id/:repository/discussions/:number(.:format) |
| route-controller | discussions |
| route-action | show |
| fetch-nonce | v2:61a1b28a-2608-2caa-f22b-61c9d6e8faef |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | 8698:D1D28:1E61F02:2829A2C:6B023480 |
| html-safe-nonce | 7b0924a336fa9f76847988b22fb4480ddba81f6eed4b77b31dd2b9b439d9f46d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Njk4OkQxRDI4OjFFNjFGMDI6MjgyOUEyQzo2QjAyMzQ4MCIsInZpc2l0b3JfaWQiOiIzMzAzMDc1NTExNjYzNzM1OTM2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 30afc102149d45416ab60ab17ed389ad7e71d8d4545018fe76804c259fb9ca72 |
| hovercard-subject-tag | discussion:9039270 |
| github-keyboard-shortcuts | repository,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/python/prebuilt-cpython/discussions/7 |
| twitter:image | https://opengraph.githubassets.com/c6f765e335d77be414d254f78d40ccc045103b10fd1e400c815689ddf64beb79/python/prebuilt-cpython/discussions/7 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c6f765e335d77be414d254f78d40ccc045103b10fd1e400c815689ddf64beb79/python/prebuilt-cpython/discussions/7 |
| og:image:alt | I'm assuming not, but there might be reasons to that I'm not thinking of? |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/prebuilt-cpython git https://github.com/python/prebuilt-cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 1075604713 |
| octolytics-dimension-repository_nwo | python/prebuilt-cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1075604713 |
| octolytics-dimension-repository_network_root_nwo | python/prebuilt-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 |
Links:
Viewport: width=device-width