-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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
Convert _sysconfigdata
to a JSON file
#127178
Comments
Signed-off-by: Filipe Laíns <[email protected]>
Converting the module to a JSON file seems to be causing some issues on special platforms, such as WASM. Let's install a JSON file together with the module as a starting point, which will enable the introspection use-case, and then explore the possibility of replacing the module with it. |
…irectory Signed-off-by: Filipe Laíns <[email protected]>
It seems this change causes the JIT build bots to fail:
https://github.com/python/cpython/actions/runs/12090193539/job/33716932397?pr=127426 |
How does the prefix change from |
Hum... no. It is setting the prefix. cpython/.github/workflows/jit.yml Line 135 in 38264a0
Let me do some debugging. |
Ah, no. I think you are getting python from a following build, which does not set the prefix, having it default to cpython/.github/workflows/jit.yml Line 144 in 38264a0
This seems to me like a bug in the |
Ah, I got it. The sysconfig data is generated by the interpreter passed to |
I opened GH-127429. |
This patch improves environment and platform compatibility - Data now matches `sysconfig.get_config_vars` after install - `userbase` now correctly reflects the target platform when cross-compiling - `test_sysconfigdata_json` now takes into account the following situations: - Running with a non-default sys.executable path - Running under virtual environments - Running under relocatable installs To simplify the detection of relocatable installs, which needs to look at `_sysconfigdata_(...)`, this module is now saved in `sys.modules`. As part of this change, the code to import the module from a specific directory was refactored to use `PathFinder`, simplifying the implementation. Signed-off-by: Filipe Laíns <[email protected]
This patch improves environment and platform compatibility - Data now matches `sysconfig.get_config_vars` after install - `userbase` now correctly reflects the target platform when cross-compiling - `test_sysconfigdata_json` now takes into account the following situations: - Running with a non-default sys.executable path - Running under virtual environments - Running under relocatable installs To simplify the detection of relocatable installs, which needs to look at `_sysconfigdata_(...)`, this module is now saved in `sys.modules`. As part of this change, the code to import the module from a specific directory was refactored to use `PathFinder`, simplifying the implementation. Signed-off-by: Filipe Laíns <[email protected]
Feature or enhancement
Proposal:
Currently, as part of the
sysconfig
internals, we generate a_sysconfigdata
Python module containing the variables forsysconfig.get_config_vars()
. This data is consists of all Makefile variables, which can be encoded as JSON data.The use of a module instead of a text file is historic, and adds unnecessary complexity. Converting
_sysconfigdata
to a JSON file would simplify thesysconfig
implementation. Additionally, it also makes it easier for tools to introspect the Python installation, as this would remove the necessity to execute Python code to read_sysconfigdata
.Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
_sysconfig_vars_(...).json
#128558The text was updated successfully, but these errors were encountered: