You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Python] Adopt new features and bugfixes from Cython 3.1 #47467
@AlenkaF@pitrou I was going to create a different issue for the Cython cache issue in order to split here from other improvements, but I''ve been trying locally and I've hit an issue that looks like a bug on Cython when extracting the artifacts from the cache. I've been able to solve it locally by modifying how Cython extracts the artifacts from the cache:
Once cached, if the bug mentioned above is locally patched:
real 0m58.111s
user 2m56.534s
sys 0m10.796s
Cache seems to improve just by ~15% as it only caches the generation of the CPP files but the C++ compilation of those is still required. We might have to investigate pairing it with ccache or sccache but scikit-build-core rebuilds in a fresh /tmp/ directory each time that might require some extra configuration.
@raulcd you can try with --config-settings=build-dir=build to reuse the same build directory. With that I got rebuilds of around 10s.
(with conda, I am actually using --config-settings=build-dir=build/$CONDA_DEFAULT_ENV such that if I would have multiple conda envs where I am installing a dev version of pyarrow, it uses separate build dirs)
My fix to solve the issue with Cython cache has been merged upstream at the Cython repository. It'll be released as part of 3.2.5, we will be able to add a check on our CMake to use the cache if version is > than that.
My fix to solve the issue with Cython cache has been merged upstream at the Cython repository. It'll be released as part of 3.2.5, we will be able to add a check on our CMake to use the cache if version is > than that.
Activity
raulcd commentedon Mar 10, 2026
@AlenkaF @pitrou I was going to create a different issue for the Cython cache issue in order to split here from other improvements, but I''ve been trying locally and I've hit an issue that looks like a bug on Cython when extracting the artifacts from the cache. I've been able to solve it locally by modifying how Cython extracts the artifacts from the cache:
This might require us to wait to enable Cython cache until Cython fixes it. See the issue above for more details.
raulcd commentedon Mar 10, 2026
As a note for future work, building with:
The first PyArrow build took:
Once cached, if the bug mentioned above is locally patched:
Cache seems to improve just by ~15% as it only caches the generation of the CPP files but the C++ compilation of those is still required. We might have to investigate pairing it with ccache or sccache but scikit-build-core rebuilds in a fresh
/tmp/directory each time that might require some extra configuration.jorisvandenbossche commentedon Mar 10, 2026
@raulcd you can try with
--config-settings=build-dir=buildto reuse the same build directory. With that I got rebuilds of around 10s.(with conda, I am actually using
--config-settings=build-dir=build/$CONDA_DEFAULT_ENVsuch that if I would have multiple conda envs where I am installing a dev version of pyarrow, it uses separate build dirs)raulcd commentedon Mar 10, 2026
Welp, that's nice! Thanks @jorisvandenbossche . We could add a default
build-dirconfiguration to ourpyproject.toml.Using:
I got on a rebuild:
That's indeed an amazing improvement.
I've validated that changing a pxd file or a PyArrow C++ file only compiles the required, example:
pitrou commentedon Mar 10, 2026
You should be able to use
hash_dir = falsein your ccache configuration.raulcd commentedon Mar 16, 2026
My fix to solve the issue with Cython cache has been merged upstream at the Cython repository. It'll be released as part of 3.2.5, we will be able to add a check on our CMake to use the cache if version is > than that.
pitrou commentedon Jul 8, 2026
FTR, latest Cython release is 3.2.8.
pitrou commentedon Sep 2, 2026
See also #51139