gh-141808: Don't remove the JIT stencils when building with PGO#141809
gh-141808: Don't remove the JIT stencils when building with PGO#141809vstinner merged 5 commits intopython:mainfrom
Conversation
|
I opened this as a draft, because keeping the files from being deleted when |
Misc/NEWS.d/next/Build/2025-11-20-23-15-39.gh-issue-141808.NEewZC.rst
Outdated
Show resolved
Hide resolved
…8.NEewZC.rst Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
|
My understanding of So I would suggest making a new target |
|
However, when the stencils are removed in make clean, they are apparently also removed during the pgo task that calls it. I have not yet figured out why and where make clean is called. |
|
Ah: Lines 838 to 841 in bc9e63d So the problem with my approach is that by dropping in the prebuilt stencils before this runs, they are deleted here. That's probably only problematic for my use case :/ |
This allows us not to call make clean from the PGO task.
|
So, I modified the behavior to keep removing the stencils with |
efimov-mikhail
left a comment
There was a problem hiding this comment.
LGTM.
I can confirm that issue with double generation of JIT stencils for PGO build is fixed.
And Makefile.pre.in changes looks clean for me.
I also confirm that the change works as expected. I built Python with the JIT and PGO using commands: Currently, I see the command twice in
With this PR, I only see the command once. |
|
Merged, thanks! The question is now if this change should be backported to 3.13 and 3.14 branches. Other branches are also affected by the issue, no? What do you think? |
|
I would say yes to backport, as this is a build change and more a fix for specific needs than a new feature. Pinging RM @hugovk |
The other branches have the rm without the asterisk: Line 3225 in 04ecff5 So technically, I am not even sure this is needed. I do not need a backport of this for Fedora. |
At least, I can say that |
|
It runs twice but should only actually build the stencils once, due to the digest-match check. |
Yep, looks like a backportable bug fix to me. |
|
Sorry, @hroncok and @vstinner, I could not cleanly backport this to |
…ith PGO (pythonGH-141809) See: https://discuss.python.org/t/building-the-jit-with-pre-built-stencils/91838/12 (cherry picked from commit 8914148) Co-authored-by: Miro Hrončok <miro@hroncok.cz> Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
|
GH-142657 is a backport of this pull request to the 3.14 branch. |
GH-141809) (GH-142657) See: https://discuss.python.org/t/building-the-jit-with-pre-built-stencils/91838/12 (cherry picked from commit 8914148) Co-authored-by: Miro Hrončok <miro@hroncok.cz> Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
|
It seems that we also need backport for 3.13 here. |
|
GH-141809) (GH-142657) (#142955) See: https://discuss.python.org/t/building-the-jit-with-pre-built-stencils/91838/12 (cherry picked from commit 8914148) (cherry picked from commit 73c80f6) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
When discussing whether to backport python/cpython#141809 I discovered that this hack was not needed on this Python version.
See https://discuss.python.org/t/building-the-jit-with-pre-built-stencils/91838/12