From a593b7cca91e3029dfc58c3ac53c56d3963bfb01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 2 Aug 2024 12:56:53 +0200 Subject: [PATCH 1/6] gh-118943: Remove 'regen-jit' from the 'regen-all' make target --- .github/workflows/build.yml | 2 +- Makefile.pre.in | 4 ++-- .../next/Build/2024-08-02-12-59-15.gh-issue-118943.vZQtET.rst | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2024-08-02-12-59-15.gh-issue-118943.vZQtET.rst diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4f3995a020e31b..3ab2c4088fb644 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,7 +85,7 @@ jobs: - name: Build CPython run: | make -j4 regen-all - make regen-stdlib-module-names regen-sbom + make regen-stdlib-module-names regen-sbom regen-jit - name: Check for changes run: | git add -u diff --git a/Makefile.pre.in b/Makefile.pre.in index 5608e593ac9aca..791354f5b043e0 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1665,10 +1665,10 @@ regen-unicodedata: regen-all: regen-cases regen-typeslots \ regen-token regen-ast regen-keyword regen-sre regen-frozen \ regen-pegen-metaparser regen-pegen regen-test-frozenmain \ - regen-test-levenshtein regen-global-objects regen-jit + regen-test-levenshtein regen-global-objects @echo @echo "Note: make regen-stdlib-module-names, make regen-limited-abi, " - @echo "make regen-configure, make regen-sbom, and make regen-unicodedata should be run manually" + @echo "make regen-configure, make regen-sbom, regen-jit, and make regen-unicodedata should be run manually" ############################################################################ # Special rules for object files diff --git a/Misc/NEWS.d/next/Build/2024-08-02-12-59-15.gh-issue-118943.vZQtET.rst b/Misc/NEWS.d/next/Build/2024-08-02-12-59-15.gh-issue-118943.vZQtET.rst new file mode 100644 index 00000000000000..f8b6442f9b6609 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2024-08-02-12-59-15.gh-issue-118943.vZQtET.rst @@ -0,0 +1,2 @@ +The ``regen-jit`` make target is no longer part of ``regen-all`` to avoid various +race conditions when running ``regen-all``. From 73cfd83b2172ca713f44172b18dadc28f2f3fcb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sat, 3 Aug 2024 09:57:05 +0200 Subject: [PATCH 2/6] fixup Consistency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Éric --- Makefile.pre.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.pre.in b/Makefile.pre.in index 791354f5b043e0..d891052d01b4d9 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1668,7 +1668,7 @@ regen-all: regen-cases regen-typeslots \ regen-test-levenshtein regen-global-objects @echo @echo "Note: make regen-stdlib-module-names, make regen-limited-abi, " - @echo "make regen-configure, make regen-sbom, regen-jit, and make regen-unicodedata should be run manually" + @echo "make regen-configure, make regen-sbom, make regen-jit, and make regen-unicodedata should be run manually" ############################################################################ # Special rules for object files From 9b18b688c8f2e254e1b9482a95f47a71d427051e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sat, 3 Aug 2024 09:58:18 +0200 Subject: [PATCH 3/6] fixup Call make regen-jit from the JIT workflow --- .github/workflows/build.yml | 2 +- .github/workflows/jit.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ab2c4088fb644..4f3995a020e31b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,7 +85,7 @@ jobs: - name: Build CPython run: | make -j4 regen-all - make regen-stdlib-module-names regen-sbom regen-jit + make regen-stdlib-module-names regen-sbom - name: Check for changes run: | git add -u diff --git a/.github/workflows/jit.yml b/.github/workflows/jit.yml index 5e3ac9e9e0fada..6cc26cd876adfb 100644 --- a/.github/workflows/jit.yml +++ b/.github/workflows/jit.yml @@ -35,6 +35,7 @@ jobs: - name: Build tier two interpreter run: | ./configure --enable-experimental-jit=interpreter --with-pydebug + make regen-jit make all --jobs 4 - name: Test tier two interpreter run: | From e21a156ddf0ad6adcc046e1c4ec2358f149e27ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sat, 3 Aug 2024 10:30:55 +0200 Subject: [PATCH 4/6] Check for changes in regen-jit --- .github/workflows/jit.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/jit.yml b/.github/workflows/jit.yml index 6cc26cd876adfb..82905ecf17eeda 100644 --- a/.github/workflows/jit.yml +++ b/.github/workflows/jit.yml @@ -32,10 +32,27 @@ jobs: timeout-minutes: 90 steps: - uses: actions/checkout@v4 - - name: Build tier two interpreter + - name: Configure tier two interpreter run: | ./configure --enable-experimental-jit=interpreter --with-pydebug + - name: Regen JIT + run: | make regen-jit + - name: Check for changes + run: | + git add -u + changes=$(git status --porcelain) + # Check for changes in regenerated files + if test -n "$changes"; then + echo "Generated files not up to date." + echo "Perhaps you forgot to run make regen-jit. ;)" + echo "$changes" + echo "" + git diff --staged || true + exit 1 + fi + - name: Build tier two interpreter + run: | make all --jobs 4 - name: Test tier two interpreter run: | From c41b712f87f44b742fd76d72c407ad1382cb6b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 6 Aug 2024 01:25:19 +0200 Subject: [PATCH 5/6] Revert the CI changes and user-facing echo --- .github/workflows/jit.yml | 20 +------------------- Makefile.pre.in | 2 +- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/.github/workflows/jit.yml b/.github/workflows/jit.yml index 82905ecf17eeda..5e3ac9e9e0fada 100644 --- a/.github/workflows/jit.yml +++ b/.github/workflows/jit.yml @@ -32,27 +32,9 @@ jobs: timeout-minutes: 90 steps: - uses: actions/checkout@v4 - - name: Configure tier two interpreter - run: | - ./configure --enable-experimental-jit=interpreter --with-pydebug - - name: Regen JIT - run: | - make regen-jit - - name: Check for changes - run: | - git add -u - changes=$(git status --porcelain) - # Check for changes in regenerated files - if test -n "$changes"; then - echo "Generated files not up to date." - echo "Perhaps you forgot to run make regen-jit. ;)" - echo "$changes" - echo "" - git diff --staged || true - exit 1 - fi - name: Build tier two interpreter run: | + ./configure --enable-experimental-jit=interpreter --with-pydebug make all --jobs 4 - name: Test tier two interpreter run: | diff --git a/Makefile.pre.in b/Makefile.pre.in index d891052d01b4d9..38692bcd4d6ab3 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1668,7 +1668,7 @@ regen-all: regen-cases regen-typeslots \ regen-test-levenshtein regen-global-objects @echo @echo "Note: make regen-stdlib-module-names, make regen-limited-abi, " - @echo "make regen-configure, make regen-sbom, make regen-jit, and make regen-unicodedata should be run manually" + @echo "make regen-configure, make regen-sbom, and make regen-unicodedata should be run manually" ############################################################################ # Special rules for object files From 3b491475937a2f703f975f415e79f10d012aec3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 6 Aug 2024 01:26:03 +0200 Subject: [PATCH 6/6] Update Misc/NEWS.d/next/Build/2024-08-02-12-59-15.gh-issue-118943.vZQtET.rst Co-authored-by: Brandt Bucher --- .../next/Build/2024-08-02-12-59-15.gh-issue-118943.vZQtET.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Misc/NEWS.d/next/Build/2024-08-02-12-59-15.gh-issue-118943.vZQtET.rst b/Misc/NEWS.d/next/Build/2024-08-02-12-59-15.gh-issue-118943.vZQtET.rst index f8b6442f9b6609..42cda69e01cd4c 100644 --- a/Misc/NEWS.d/next/Build/2024-08-02-12-59-15.gh-issue-118943.vZQtET.rst +++ b/Misc/NEWS.d/next/Build/2024-08-02-12-59-15.gh-issue-118943.vZQtET.rst @@ -1,2 +1 @@ -The ``regen-jit`` make target is no longer part of ``regen-all`` to avoid various -race conditions when running ``regen-all``. +Fix an issue where the experimental JIT could be built several times by the ``make regen-all`` target, leading to possible race conditions on heavily parallelized builds.