python / python/cpython

Freeze the `_sysconfigdata_*` module

Open
#131,779 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build OS-wasi topic-installation topic-sysconfig type-feature
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Feature or enhancement

Proposal:

After generating _sysconfigdata_*, we could freeze it, like we do to the rest of the standard library.

This should remove the necessity for workarounds such as having to manually set PYTHONPATH to the _sysconfigdata_* directory when running WASM artifacts:

https://github.com/python/cpython/blob/151d1bfd1bb7ca9a36bb0f2bd6df53d64a1ba2f2/Tools/wasm/wasi.py#L226-L227

It should also make it easier to build a fully self-contained statically-linked relocatable interpreter.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Tools/wasm/wasi.py at the referenced workaround around lines 226-227, then trace how the generated sysconfigdata* module is handled during the CPython build. Determine how freezing it should integrate with the existing standard-library freezing process; done means WASM artifacts no longer require manually setting PYTHONPATH to that module's directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, wasm
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.