From 9117ebf03912e4cc7a035ffd097c66c81655c61f Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Tue, 2 Mar 2021 18:25:20 -0800 Subject: [PATCH 1/2] Use BUILDPYTHON for regen-frozen. The marshaled data for code objects has changed with bpo-42246, commit 877df85. Update the frozen code for __hello__ and the expected code sizes in ctypes test_frozentable. --- Lib/ctypes/test/test_values.py | 6 +++--- Makefile.pre.in | 8 ++++++-- .../next/Build/2021-03-02-18-24-51.bpo-43372.HvwNkL.rst | 6 ++++++ Python/frozen_hello.h | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2021-03-02-18-24-51.bpo-43372.HvwNkL.rst diff --git a/Lib/ctypes/test/test_values.py b/Lib/ctypes/test/test_values.py index 44128298390d98..3c8f75fe1869fe 100644 --- a/Lib/ctypes/test/test_values.py +++ b/Lib/ctypes/test/test_values.py @@ -80,9 +80,9 @@ class struct_frozen(Structure): continue items.append((entry.name.decode("ascii"), entry.size)) - expected = [("__hello__", 125), - ("__phello__", -125), - ("__phello__.spam", 125), + expected = [("__hello__", 129), + ("__phello__", -129), + ("__phello__.spam", 129), ] self.assertEqual(items, expected, "PyImport_FrozenModules example " "in Doc/library/ctypes.rst may be out of date") diff --git a/Makefile.pre.in b/Makefile.pre.in index 0f59700952989e..2f2701157ab043 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -871,9 +871,13 @@ regen-opcode: $(UPDATE_FILE) $(srcdir)/Include/opcode.h $(srcdir)/Include/opcode.h.new .PHONY: regen-frozen -regen-frozen: +regen-frozen: build_all # Regenerate code for frozen module "__hello__". - $(PYTHON_FOR_REGEN) $(srcdir)/Tools/freeze/regen_frozen.py $(srcdir)/Python/frozen_hello.h + $(RUNSHARED) ./$(BUILDPYTHON) \ + $(srcdir)/Tools/freeze/regen_frozen.py \ + $(srcdir)/Python/frozen_hello.h.new + $(UPDATE_FILE) $(srcdir)/Python/frozen_hello.h \ + $(srcdir)/Python/frozen_hello.h.new .PHONY: regen-token regen-token: diff --git a/Misc/NEWS.d/next/Build/2021-03-02-18-24-51.bpo-43372.HvwNkL.rst b/Misc/NEWS.d/next/Build/2021-03-02-18-24-51.bpo-43372.HvwNkL.rst new file mode 100644 index 00000000000000..bb2221bf17cef0 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-03-02-18-24-51.bpo-43372.HvwNkL.rst @@ -0,0 +1,6 @@ +Change the regen-frozen target to use BUILDPYTHON rather than +PYTHON_FOR_REGEN. + +The marshaled data for code objects has changed with bpo-42246, commit +877df85. Update the frozen code for ``__hello__`` and the expected code +sizes in ctypes test_frozentable. diff --git a/Python/frozen_hello.h b/Python/frozen_hello.h index 9c566cc81ebf00..d58b726aa8b6cc 100644 --- a/Python/frozen_hello.h +++ b/Python/frozen_hello.h @@ -9,5 +9,5 @@ static unsigned char M___hello__[] = { 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, + 0,115,6,0,0,0,4,0,12,1,255,128, }; From 2b746720a0cc2bb23c027e3c61fd38cb64294b33 Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Tue, 2 Mar 2021 23:17:38 -0800 Subject: [PATCH 2/2] Reformat NEWS as single paragraph. --- .../next/Build/2021-03-02-18-24-51.bpo-43372.HvwNkL.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Misc/NEWS.d/next/Build/2021-03-02-18-24-51.bpo-43372.HvwNkL.rst b/Misc/NEWS.d/next/Build/2021-03-02-18-24-51.bpo-43372.HvwNkL.rst index bb2221bf17cef0..2175e8ae4ec3d1 100644 --- a/Misc/NEWS.d/next/Build/2021-03-02-18-24-51.bpo-43372.HvwNkL.rst +++ b/Misc/NEWS.d/next/Build/2021-03-02-18-24-51.bpo-43372.HvwNkL.rst @@ -1,6 +1,4 @@ Change the regen-frozen target to use BUILDPYTHON rather than -PYTHON_FOR_REGEN. - -The marshaled data for code objects has changed with bpo-42246, commit -877df85. Update the frozen code for ``__hello__`` and the expected code -sizes in ctypes test_frozentable. +PYTHON_FOR_REGEN. The marshaled data for code objects has changed with +bpo-42246, commit 877df85. Update the frozen code for ``__hello__`` and update +the expected code sizes in ctypes test_frozentable.