pandas: TRACKER: Getting Started with Meson/Bug Reports
Background
In pandas-dev/pandas#49115, we are adding support for a new build system meson. This build system addresses some of the flaws of the setuptools-based build system, such as race conditions on parallel builds. It is also much simpler and easier to understand, and we’ll be able to clean up a bunch of build related code once it’s merged.
How to build/test with meson
# Create a new conda environment, or update your existing one
conda env create --file=environment.yml
# conda env update --file environment.yml --prune # For updating your existing environment, make sure "pandas-dev" is activated
pip install oldest-supported-numpy>=0.10 # Needed since pip will not auto pull dependencies in no-build-isolation mode
# This is the build command.
# On your first run, it'll create the build directory(named builddir here).
# Subsequent builds will re-use it.
pip install . -ve --no-build-isolation --config-settings="builddir=builddir"
# If you want to debug, pass -Ddebug=true, e.g.
pip install . -ve --no-build-isolation --config-settings builddir="builddir" --config-settings setup-args="-Dbuildtype=debug"
# Test command (same as with pandas built by setuptools)
# e.g.
# Note: If you built pandas in editable mode, you now don't have to rebuild the C extensions every time you change a C/Cython file. It will now be automatically rebuilt on import.
pytest pandas
Timeline
- Enable meson based builds in the CI( pandas-dev/pandas#49115)
- Move to using a stable version of meson/meson-python once all fixes have been upstreamed, and released.
- Update documentation for setting up and building pandas with meson. - Mostly done. The debugging docs need to be updated
- Remove all setuptools code.
Ideally, meson build support and removal of setuptools should be fully complete by 2.1 (the next minor release).
Known Issues
N/A.
Purpose of this thread
I’ve opened this thread to get some feedback and to track any build issues users might be having with meson.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 17 (17 by maintainers)
After starting again from scratch (removing my local pandas repo and cloning it again as well as creating a new dev environment) I was able to successfully build pandas with meson. The good old “Have you tried turning it off and on again?” did the trick. 😄
You’ll need to remove the
buildfolder I think, and do a clean rebuild.I don’t think meson tracked when the include directory changed, so didn’t mark the affected files as needing a rebuild.
I ran into this today.
This snippet of the error message was added by @rgommers to provide a hint about the problem. The relpath trick seems apropos here, indeed.
(More generally, the long-term idea is to create some dependency interface for numpy, so people can just use that directly and not need to worry about running
numpy.get_include()via manual code snippets.)