Skip to content
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

-X frozen_modules=on|off should be configurable with environment variable #98697

Closed
virtuald opened this issue Oct 26, 2022 · 2 comments
Closed
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@virtuald
Copy link
Contributor

Feature or enhancement

-X frozen_modules=on|off should be configurable with environment variable

Pitch

The crossenv project provides the ability to generate virtualenvs that are customized to allow very simple cross-compilation, by mixing pieces of a host-native python and the right configuration variables from a cross-compiled python. Python 3.11 broke it in a few ways, but in particular the way that it injects its hooks is by overriding the contents of site.py, which is now included in a frozen module by default. To allow the patching to continue working, we have to add the -X option to the python command line each time it starts. This is doable, but it would be much simpler if we could just set an environment variable to disable the frozen modules.

Many other -X options are configurable through an environment variable, it seems like this one should too. Maybe PYUSEFROZENMODULES=0|1?

Note: yes, crossenv does a lot of dirty tricks to do its work, but I've tried several cross-compilation approaches and it's the easiest I've used by far.

Previous discussion

No prior discussion, seems like a small enough feature that is an easy yes/no?

@virtuald virtuald added the type-feature A feature request or enhancement label Oct 26, 2022
@kumaraditya303
Copy link
Contributor

It's too late to add this to 3.11 as this is new feature and 3.11 is final now.

cc @gvanrossum @ericsnowcurrently

@kumaraditya303 kumaraditya303 added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Oct 26, 2022
@gvanrossum
Copy link
Member

If you submit a PR that references this issue we could add this to 3.12; alas, for 3.11 it's too late, as Kumar says. I don't have the bandwidth to do anything myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants