From eac7aa7cd1370ff92b7834ece9db0dd51302f972 Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Tue, 2 Mar 2021 10:57:16 -0800 Subject: [PATCH 1/5] Re-generate frozen code for __hello__. The marshal format for code objects has changed with bpo-42246, commit 877df851. Update expected code sizes in ctypes test_frozentable. --- Lib/ctypes/test/test_values.py | 6 +++--- .../next/Build/2021-03-02-10-55-29.bpo-43372.2zXMGv.rst | 3 +++ Python/frozen_hello.h | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2021-03-02-10-55-29.bpo-43372.2zXMGv.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/Misc/NEWS.d/next/Build/2021-03-02-10-55-29.bpo-43372.2zXMGv.rst b/Misc/NEWS.d/next/Build/2021-03-02-10-55-29.bpo-43372.2zXMGv.rst new file mode 100644 index 00000000000000..67c6463257f0d8 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-03-02-10-55-29.bpo-43372.2zXMGv.rst @@ -0,0 +1,3 @@ +Re-generate frozen code for `__hello__` using an up-to-date Python. The +marshal format for code objects has changed with bpo-42246, commit 877df851. +Update 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 948cc588e53989987bd19a32199ca680ed0f3873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 2 Mar 2021 20:18:28 +0100 Subject: [PATCH 2/5] Check if generated files are up to date with current Python --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c674c5d606c546..2fbfe34978ad03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,8 +62,9 @@ jobs: run: | # Build Python with the libpython dynamic library ./configure --with-pydebug --enable-shared - make -j4 regen-all - make regen-stdlib-module-names + make -j4 + PYTHON_FOR_REGEN=./python make -j4 regen-all + PYTHON_FOR_REGEN=./python make regen-stdlib-module-names - name: Check for changes run: | changes=$(git status --porcelain) From 1c29a9bbce1df8ad901cb6d28fc48a7296dccca2 Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Tue, 2 Mar 2021 14:46:33 -0800 Subject: [PATCH 3/5] Set LD_LIBRARY_PATH for the regen CI test. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2fbfe34978ad03..e9d854a59efac5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,10 +61,10 @@ jobs: - name: Build CPython run: | # Build Python with the libpython dynamic library - ./configure --with-pydebug --enable-shared + ./configure --with-pydebug --enable-shared PYTHON_FOR_REGEN=./python make -j4 - PYTHON_FOR_REGEN=./python make -j4 regen-all - PYTHON_FOR_REGEN=./python make regen-stdlib-module-names + LD_LIBRARY_PATH=. make -j4 regen-all + LD_LIBRARY_PATH=. make regen-stdlib-module-names - name: Check for changes run: | changes=$(git status --porcelain) From 8c86ec001504737bc30c91a00775a08519f4703f Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Tue, 2 Mar 2021 16:13:34 -0800 Subject: [PATCH 4/5] Fix RST markup in news entry. --- Misc/NEWS.d/next/Build/2021-03-02-10-55-29.bpo-43372.2zXMGv.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Build/2021-03-02-10-55-29.bpo-43372.2zXMGv.rst b/Misc/NEWS.d/next/Build/2021-03-02-10-55-29.bpo-43372.2zXMGv.rst index 67c6463257f0d8..eeb685fc77a33d 100644 --- a/Misc/NEWS.d/next/Build/2021-03-02-10-55-29.bpo-43372.2zXMGv.rst +++ b/Misc/NEWS.d/next/Build/2021-03-02-10-55-29.bpo-43372.2zXMGv.rst @@ -1,3 +1,3 @@ -Re-generate frozen code for `__hello__` using an up-to-date Python. The +Re-generate frozen code for ``__hello__`` using an up-to-date Python. The marshal format for code objects has changed with bpo-42246, commit 877df851. Update expected code sizes in ctypes test_frozentable. From ad42c73d0781fd549e01f97e6ca0b849c6e4e00b Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Tue, 2 Mar 2021 16:46:40 -0800 Subject: [PATCH 5/5] Use ./python for regen-all in Travis CI test. --- .travis.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6a22d20455b422..30cf7ce3851306 100644 --- a/.travis.yml +++ b/.travis.yml @@ -168,10 +168,9 @@ install: # Travis provides only 2 cores, so don't overdo the parallelism and waste memory. before_script: # -Og is much faster than -O0 - - CFLAGS="${CFLAGS} -Og" ./configure --with-pydebug - - eval "$(pyenv init -)" - - pyenv global 3.8 - - PYTHON_FOR_REGEN=python3.8 make -j4 regen-all + - CFLAGS="${CFLAGS} -Og" ./configure --with-pydebug PYTHON_FOR_REGEN=./python + - make -j4 + - make -j4 regen-all - make regen-stdlib-module-names - changes=`git status --porcelain` - | @@ -182,7 +181,6 @@ before_script: echo "$changes" exit 1 fi - - make -j4 - make pythoninfo script: