sysconfig variable impermanence in virtual environment when cross-compiling
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 35.9k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
Bug report
Bug description:
The solution to issue GH-126789 (found in GH-127729 / 70154855cf69) introduced a side effect when sysconfig variables are fetched in a virtual environment with the _PYTHON_PROJECT_BASE environment variable present (on posix platforms). Specifically, every invocation of sysconfig.get_config_vars() and sysconfig.get_config_var() causes the variable cache to be reset and rebuilt from scratch. This can be confirmed by running Python as follows:
virtualenv -p /usr/bin/python3.14 env # 3.14 or higher
_PYTHON_PROJECT_BASE=/any/path env/bin/python
And then executing:
import sysconfig
sysconfig.get_config_vars()['LIBDIR'] = '/some/new/path'
assert sysconfig.get_config_var('LIBDIR') != '/some/new/path'
Rebuilding the variable cache every time is fairly inefficient and prevents the possibility of tweaking the values (a sometimes necessary evil).
CPython versions tested on:
3.14
Operating systems tested on:
Linux
Linked PRs
- gh-150164
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Iniziate con sysconfig.get_config_vars() e sysconfig.get_config_var() utilizzando la riproduzione dell’ambiente virtuale fornita e l’impostazione _PYTHON_PROJECT_BASE. Tracciate il motivo per cui la cache viene ricostruita a ogni chiamata, aggiungete una copertura di regressione e verificate che i valori modificati persistano nelle ricerche successive.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- build-system
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100