FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-43372: Use _freeze_importlib for regen-frozen. by nascheme · Pull Request #24759 · python/cpython · GitHub

/ cpython Public

bpo-43372: Use _freeze_importlib for regen-frozen. - #24759

Merged
nascheme merged 1 commit into
python:masterfrom
nascheme:freeze_importlib_regen_frozen
Mar 6, 2021
Merged

bpo-43372: Use _freeze_importlib for regen-frozen.#24759
nascheme merged 1 commit into
python:masterfrom
nascheme:freeze_importlib_regen_frozen

Conversation

nascheme commented Mar 5, 2021
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

This approach ensures the code matches the interpreter version.
Previously, PYTHON_FOR_REGEN was used to generate the code, which might
be wrong. The marshal format for code objects has changed with
bpo-42246, commit 877df85. Update the code and the expected code sizes
in ctypes test_frozentable.

https://bugs.python.org/issue43372

This approach ensures the code matches the interpreter version.
Previously, PYTHON_FOR_REGEN was used to generate the code, which might
be wrong. The marshal format for code objects has changed with
bpo-42246, commit 877df85. Update the code and the expected code sizes
in ctypes test_frozentable.
Comment thread Python/frozen_hello.h
0,0,122,14,60,102,114,111,122,101,110,32,104,101,108,108,
111,62,218,8,60,109,111,100,117,108,101,62,1,0,0,0,
115,6,0,0,0,4,0,12,1,255,128,
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I don't understand why the file is suddenly so different when in the previous pull requests, only one line was updated.

nascheme Mar 5, 2021
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think it's because the co_filename has changed. _freeze_importlib sets it to "<frozen hello>". Previously it was set to "none".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Oh, and _freeze_importlib line wraps the byte array a bit differently.

Comment thread Python/frozen_hello.h
218,8,60,109,111,100,117,108,101,62,1,0,0,
0,115,2,0,0,0,4,1,
/* Auto-generated by Programs/_freeze_importlib.c */
const unsigned char _Py_M__hello[] = {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Not sure making this non-static is good. The _freeze_importlib could grow a command line option to make it static or non-static.

nascheme merged commit 87ec26b into python:master Mar 6, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL