From 3883cef8cc49851084cf4e4d2df35ecb3ed2431e Mon Sep 17 00:00:00 2001 From: Diego Russo Date: Mon, 4 May 2026 23:40:59 +0100 Subject: [PATCH 1/2] gh-149353: Avoid stale JIT stamp triggering rebuilds --- Makefile.pre.in | 4 +++- .../next/Build/2026-05-04-23-07-45.gh-issue-149353.XfM8aQ.rst | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Build/2026-05-04-23-07-45.gh-issue-149353.XfM8aQ.rst diff --git a/Makefile.pre.in b/Makefile.pre.in index 5789d33e7f4456..b6b7586e344e64 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -3226,7 +3226,9 @@ $(JIT_GENERATED_STAMP): $(JIT_DEPS) @REGEN_JIT_COMMAND@ @touch $@ -$(JIT_BUILD_TARGETS): $(JIT_GENERATED_STAMP) +# The stamp regenerates all JIT outputs as a group. Keep it order-only so its +# newer timestamp does not make each generated artifact look stale. +$(JIT_BUILD_TARGETS): | $(JIT_GENERATED_STAMP) @if test ! -f "$@"; then \ rm -f $(JIT_GENERATED_STAMP); \ $(MAKE) $(JIT_GENERATED_STAMP); \ diff --git a/Misc/NEWS.d/next/Build/2026-05-04-23-07-45.gh-issue-149353.XfM8aQ.rst b/Misc/NEWS.d/next/Build/2026-05-04-23-07-45.gh-issue-149353.XfM8aQ.rst new file mode 100644 index 00000000000000..3a3bad2906f783 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-05-04-23-07-45.gh-issue-149353.XfM8aQ.rst @@ -0,0 +1,2 @@ +Avoid unnecessary JIT-related rebuilds during ``make install`` after +``--enable-optimizations`` builds. From d961a405c8f8d7d936307f422436527587f657db Mon Sep 17 00:00:00 2001 From: Diego Russo Date: Tue, 5 May 2026 15:41:41 +0100 Subject: [PATCH 2/2] Preserve JIT shim object during PGO clean --- Makefile.pre.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in index b6b7586e344e64..e3a8b83f698917 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -3226,9 +3226,7 @@ $(JIT_GENERATED_STAMP): $(JIT_DEPS) @REGEN_JIT_COMMAND@ @touch $@ -# The stamp regenerates all JIT outputs as a group. Keep it order-only so its -# newer timestamp does not make each generated artifact look stale. -$(JIT_BUILD_TARGETS): | $(JIT_GENERATED_STAMP) +$(JIT_BUILD_TARGETS): $(JIT_GENERATED_STAMP) @if test ! -f "$@"; then \ rm -f $(JIT_GENERATED_STAMP); \ $(MAKE) $(JIT_GENERATED_STAMP); \ @@ -3325,7 +3323,9 @@ docclean: # data. The PGO data is only valid if source code remains unchanged. .PHONY: clean-retain-profile clean-retain-profile: pycremoval - find . -name '*.[oa]' -exec rm -f {} ';' + # Keep the generated JIT shim objects with the rest of the JIT generated + # files: they are regenerated as a group and tracked by .jit-stamp. + find . -name '*.[oa]' ! -name 'jit_shim*.o' -exec rm -f {} ';' find . -name '*.s[ol]' -exec rm -f {} ';' find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';' find . -name '*.lto' -exec rm -f {} ';'