conda-forge / matplotlib-feedstock

A conda-smithy repository for matplotlib.
BSD 3-Clause "New" or "Revised" License
22 stars 58 forks source link

Add freethreading support #409

Open isuruf opened 1 month ago

isuruf commented 1 month ago

Checklist

matplotlib has wheels in latest release

isuruf commented 1 month ago

@conda-forge-admin rerender

conda-forge-admin commented 1 month ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

tacaswell commented 1 month ago

To be clear, this is adding the build options for freethreading, not claiming mpl is freethreading safe?

dopplershift commented 1 month ago

What does "freethreading safe" mean?

ngoldbaum commented 4 weeks ago

To be clear, this is adding the build options for freethreading, not claiming mpl is freethreading safe?

This is building binaries that support the new CPython ABI under the free-threaded build. This is related but orthogonal to supporting free-threading.

You need to explicitly declare that matplotlib's extension modules don't use the GIL to mark matplotlib as thread-safe.

What does "freethreading safe" mean?

Good question! The working definition we've been going with is that you should have similar thread safety guarantees under the GIL-enabled and GIL-disabled build. So any assumptions made in low-level code about the GIL providing locking and making it OK to do things like use C global statics to store module state are no longer OK and all that stuff should be fixed.

However there are lots of other thread safety issues in Python codebases that are unrelated to the GIL, I don't think the presence of any of those issues means a module is "unsafe" under freethreading.

tacaswell commented 3 weeks ago

with mpl 3.10.0 we are going to mark our selves as "thread safe", unless this is blocking something maybe wait for that to land on main before re-running this?

tacaswell commented 3 weeks ago

or try this on the rc branch.

isuruf commented 3 weeks ago

kiwisolver is the last hurdle