Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-118943: Fix another race condition when generating jit_stencils.h #120690

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

hroncok
Copy link
Contributor

@hroncok hroncok commented Jun 18, 2024

Another process might have already moved jit_stencils.h.new

…ils.h

Another process might have already moved jit_stencils.h.new
…7nn.rst

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
@brandtbucher
Copy link
Member

Thanks for this, it seems like a nice fix for the issue.

More generally though, I'm surprised that two jit_stencils.h files are being written in parallel like this for the same build. That shouldn't be happening, normally.

This seems to be the source of all of the issues you've been finding. Our Makefile is set up to only run one of these jobs per make target... I'm not sure that running several targets (like regen-all and all) in parallel is really intended. Is that what your build does?

@brandtbucher brandtbucher added build The build process and cross-build needs backport to 3.13 bugs and security fixes topic-JIT labels Jun 18, 2024
@hroncok
Copy link
Contributor Author

hroncok commented Jun 18, 2024

We run regen-all first, then all. Are you interested in full logs?

@brandtbucher
Copy link
Member

Ah, I think I see the issue! regen-jit is part of regen-all, but regen-all already builds the JIT for other reasons.

I think we should remove regen-jit from the regen-all target. It's really intended for files that will be checked in and aren't generated as part of the normal build.

@hroncok
Copy link
Contributor Author

hroncok commented Jun 28, 2024

This was not merged in time for 3.13.0b3. How can I move this forward?

@hroncok
Copy link
Contributor Author

hroncok commented Jul 9, 2024

@brandtbucher Could you please merge this? Is this waiting for something else?

@hroncok
Copy link
Contributor Author

hroncok commented Aug 1, 2024

@Yhg1s Hey Thomas. We have carried this patch in Fedora since 3.13.0b2. Is there any chance we could get this merged to at least 3.13.0rc2?

@Eclips4
Copy link
Member

Eclips4 commented Aug 1, 2024

@Yhg1s Hey Thomas. We have carried this patch in Fedora since 3.13.0b2. Is there any chance we could get this merged to at least 3.13.0rc2?

I've pinged Brandt in the private coredev chat on Discord to get his attention.

Copy link
Member

@brandtbucher brandtbucher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for letting this slip! Looks good to me. One thing, though: can you also remove regen-jit from the regen-all target in Makefile.pre.in?

@Yhg1s I think this is reasonable to backport to the next RC. It's just minor fixes for race conditions in the JIT build (thanks @hroncok for your work to make it available on Fedora).

@brandtbucher brandtbucher self-assigned this Aug 1, 2024
@Yhg1s
Copy link
Member

Yhg1s commented Aug 1, 2024

Sure, this is fine to get in 3.13.0rc2.

@hroncok
Copy link
Contributor Author

hroncok commented Aug 2, 2024

One thing, though: can you also remove regen-jit from the regen-all target in Makefile.pre.in?

I'm happy to do that in a separate PR.

@hroncok
Copy link
Contributor Author

hroncok commented Aug 2, 2024

See #122602

@hroncok
Copy link
Contributor Author

hroncok commented Aug 5, 2024

Thanks for the second approval @brandtbucher. Could you please merge this as well?

@brandtbucher brandtbucher merged commit 44659d3 into python:main Aug 5, 2024
62 of 66 checks passed
@miss-islington-app
Copy link

Thanks @hroncok for the PR, and @brandtbucher for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 5, 2024
…0690)

(cherry picked from commit 44659d3)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
@bedevere-app
Copy link

bedevere-app bot commented Aug 5, 2024

GH-122709 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Aug 5, 2024
@hroncok hroncok deleted the jitmakerace branch August 5, 2024 23:20
@hroncok
Copy link
Contributor Author

hroncok commented Aug 5, 2024

Thanks.

brandtbucher pushed a commit to brandtbucher/cpython that referenced this pull request Aug 7, 2024
…0690)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
…0690)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build topic-JIT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants