Skip to content

GH-134291: Support older macOS deployment targets for JIT builds #137211

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

Merged
merged 2 commits into from
Jul 30, 2025

Conversation

brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented Jul 29, 2025

This rolls back GH-126196 and adds stricter checks for newer APIs in JIT CI. We don't really need the superpowers of the newer API (rapid flip-flopping permissions on JIT pages) since our JIT doesn't use self-modifying code.

This allows downstream distributors (like uv, CC @zanieb) to ship the JIT for more users.

@brandtbucher
Copy link
Member Author

Performance is neutral. If you squint, startup is slightly faster and JIT-heavy benchmarks are slightly slower, but it's mostly in the noise for this machine.

Copy link
Contributor

@diegorusso diegorusso left a comment

Choose a reason for hiding this comment

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

Instead of removing the support altogether, wouldn't it be nicer to call it only on supported macOS version?

@zanieb
Copy link
Contributor

zanieb commented Jul 29, 2025

We chatted about that at PyCon but it sounded like it didn't really seem like the right trade-off because there's not a strong justification for having it in the first place.

@brandtbucher
Copy link
Member Author

Yeah, if we left it in we'd need to test it, etc. It's intended to be a lightweight workaround for JITs with self-modifying code on newer Macs that don't support WX pages, which doesn't apply to us. I think it's cleaner to just pull it out for now.

Copy link
Member

@savannahostrowski savannahostrowski left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me - I'm very +1 on wider distribution of JIT builds :)

@zanieb
Copy link
Contributor

zanieb commented Jul 30, 2025

This supersedes #134292

Copy link
Contributor

@diegorusso diegorusso left a comment

Choose a reason for hiding this comment

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

OK, if this causes issue, let's merge it. As Brandt said our JIT doesn't really modify the code while executing.

@brandtbucher brandtbucher merged commit d591b5e into python:main Jul 30, 2025
68 checks passed
@brandtbucher
Copy link
Member Author

@hugovk, @zanieb, @ned-deily: thoughts on backporting this change? I know we're in RC, but this would allow macOS distributors like uv to ship the JIT (like it does for other platforms) without carrying this patch. The new code is reverting things to the way they worked in 3.13 and part of 3.14 (and Linux) anyways, so I'm personally confident that backporting won't lead to issues.

@ned-deily
Copy link
Member

thoughts on backporting this change?

I need to test the change first, which I'll do in the next day. But, assuming no problems, it should definitely be backported for 3.14. We've been handwaving about older release support while waiting for this to be fixed.

@hugovk
Copy link
Member

hugovk commented Jul 31, 2025

Fine by me when Ned gives the nod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) OS-mac topic-JIT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants