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

bpo-45020: Freeze os, site, and codecs. #28398

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrently ericsnowcurrently commented Sep 16, 2021

After this, the only modules left that are imported during startup are "encodings.*". We'll tackle that after we make the build output (stdout) less noisy.

https://bugs.python.org/issue45020

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you leave the encodings package for another time? I find the noise caused by the generation of the 120+ files there very distracting: even though they are not in the repo, the Make output still adds 360+ lines each time a dependency of _freeze_module changes, which is pretty much any C or .h file in the project.

It would be nice if we could freeze submodules of a package (and maybe even its __init__.py file) without freezing the entire package. Perhaps we can think of ways to tweak import.c so that importing "foo.bar" first looks for a frozen foo.bar before looking in foo.__path_rozen_?

PS. The default is still "off" right? I only get frozen modules with -X frozen_modules.

@ericsnowcurrently
Copy link
Member Author

ericsnowcurrently commented Sep 17, 2021

Can you leave the encodings package for another time?

Fine with me. I'm going to run the buildbots on the PR first though.

I find the noise caused by the generation of the 120+ files there very distracting: even though they are not in the repo, the Make output still adds 360+ lines each time a dependency of _freeze_module changes, which is pretty much any C or .h file in the project.

This seems like something we could fix.

It would be nice if we could freeze submodules of a package (and maybe even its __init__.py file) without freezing the entire package. Perhaps we can think of ways to tweak import.c so that importing "foo.bar" first looks for a frozen foo.bar before looking in foo.__path_rozen_?

I have a different branch that does the right thing for __path__. I just haven't bothered with it yet.

PS. The default is still "off" right? I only get frozen modules with -X frozen_modules.

Right.

@ericsnowcurrently ericsnowcurrently added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 17, 2021
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @ericsnowcurrently for commit 74e292182cfcc8b3413745ddbc543d7a2413b418 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 17, 2021
@ericsnowcurrently
Copy link
Member Author

ericsnowcurrently commented Sep 17, 2021

FYI, I'm working on fixing the "altered the execution environment" (test_socket) failures I'm seeing on the refleak buildbots.

[UPDATE] Ah, looks like it wasn't me: https://bugs.python.org/issue45187#msg402074

@ericsnowcurrently ericsnowcurrently force-pushed the frozen-startup-modules-remainder branch from d7f2b64 to 80777a9 Compare September 17, 2021 18:56
@ericsnowcurrently ericsnowcurrently changed the title bpo-45020: Freeze the remaining stdlib modules imported during startup. bpo-45020: Freeze os, site, and codecs. Sep 17, 2021
@ericsnowcurrently ericsnowcurrently merged commit 0905916 into python:main Sep 17, 2021
@ericsnowcurrently ericsnowcurrently deleted the frozen-startup-modules-remainder branch September 17, 2021 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants