-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-43372: Use _freeze_importlib for regen-frozen. #24759
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Use ``_freeze_importlib`` to generate code for the ``__hello__`` module. | ||
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 877df851. | ||
Update the code and the expected code sizes in ctypes test_frozentable. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
/* Generated with Tools/freeze/regen_frozen.py */ | ||
static unsigned char M___hello__[] = { | ||
227,0,0,0,0,0,0,0,0,0,0,0,0, | ||
0,0,0,0,2,0,0,0,64,0,0,0,115, | ||
16,0,0,0,100,0,90,0,101,1,100,1,131, | ||
1,1,0,100,2,83,0,41,3,84,122,12,72, | ||
101,108,108,111,32,119,111,114,108,100,33,78,41, | ||
2,90,11,105,110,105,116,105,97,108,105,122,101, | ||
100,218,5,112,114,105,110,116,169,0,114,2,0, | ||
0,0,114,2,0,0,0,218,4,110,111,110,101, | ||
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[] = { | ||
99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
0,2,0,0,0,64,0,0,0,115,16,0,0,0,100,0, | ||
90,0,101,1,100,1,131,1,1,0,100,2,83,0,41,3, | ||
84,122,12,72,101,108,108,111,32,119,111,114,108,100,33,78, | ||
41,2,90,11,105,110,105,116,105,97,108,105,122,101,100,218, | ||
5,112,114,105,110,116,169,0,114,1,0,0,0,114,1,0, | ||
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, | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand why the file is suddenly so different when in the previous pull requests, only one line was updated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's because the co_filename has changed. _freeze_importlib sets it to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, and _freeze_importlib line wraps the byte array a bit differently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure making this non-static is good. The _freeze_importlib could grow a command line option to make it static or non-static.