Skip to content

Bump meson #57895

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

Closed
wants to merge 17 commits into from
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- run: |
/opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev
. ~/virtualenvs/pandas-dev/bin/activate
python -m pip install --no-cache-dir -U pip wheel setuptools meson-python==0.13.1 meson[ninja]==1.2.1
python -m pip install --no-cache-dir -U pip wheel setuptools meson-python==0.15.0 meson[ninja]==1.4.0
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 hypothesis>=6.46.1
python -m pip install --no-cache-dir --no-build-isolation -e . --config-settings=setup-args="--werror"
python -m pip list --no-cache-dir
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ jobs:
run: |
/opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev
. ~/virtualenvs/pandas-dev/bin/activate
python -m pip install --no-cache-dir -U pip wheel setuptools meson[ninja]==1.2.1 meson-python==0.13.1
python -m pip install --no-cache-dir -U pip wheel setuptools meson[ninja]==1.4.0 meson-python==0.15.0
python -m pip install numpy --config-settings=setup-args="-Dallow-noblas=true"
python -m pip install --no-cache-dir versioneer[toml] cython python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 hypothesis>=6.46.1
python -m pip install --no-cache-dir --no-build-isolation -e . --config-settings=setup-args="--werror"
Expand Down Expand Up @@ -279,7 +279,7 @@ jobs:
run: |
/opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev
. ~/virtualenvs/pandas-dev/bin/activate
python -m pip install --no-cache-dir -U pip wheel setuptools meson-python==0.13.1 meson[ninja]==1.2.1
python -m pip install --no-cache-dir -U pip wheel setuptools meson-python==0.15.0 meson[ninja]==1.4.0
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 hypothesis>=6.46.1
python -m pip install --no-cache-dir --no-build-isolation -e . --config-settings=setup-args="--werror"
python -m pip list --no-cache-dir
Expand Down Expand Up @@ -351,7 +351,7 @@ jobs:
- name: Build Environment
run: |
python --version
python -m pip install --upgrade pip setuptools wheel meson[ninja]==1.2.1 meson-python==0.13.1
python -m pip install --upgrade pip setuptools wheel meson[ninja]==1.4.0 meson-python==0.15.0
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
python -m pip install versioneer[toml]
python -m pip install python-dateutil pytz tzdata cython hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-cov
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-310.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ dependencies:
# build dependencies
- versioneer[toml]
- cython>=0.29.33
- meson[ninja]=1.2.1
- meson-python=0.13.1
- meson[ninja]=1.4.0
- meson-python=0.15.0

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-311-downstream_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ dependencies:
# build dependencies
- versioneer[toml]
- cython>=0.29.33
- meson[ninja]=1.2.1
- meson-python=0.13.1
- meson[ninja]=1.4.0
- meson-python=0.15.0

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-311-numpydev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ dependencies:

# build dependencies
- versioneer[toml]
- meson[ninja]=1.2.1
- meson-python=0.13.1
- meson[ninja]=1.4.0
- meson-python=0.15.0
- cython>=0.29.33

# test dependencies
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-311-pyarrownightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ dependencies:

# build dependencies
- versioneer[toml]
- meson[ninja]=1.2.1
- meson[ninja]=1.4.0
- cython>=0.29.33
- meson-python=0.13.1
- meson-python=0.15.0

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-311-sanitizers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ dependencies:
# build dependencies
- versioneer[toml]
- cython>=0.29.33
- meson[ninja]=1.2.1
- meson-python=0.13.1
- meson[ninja]=1.4.0
- meson-python=0.15.0

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-311.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ dependencies:
# build dependencies
- versioneer[toml]
- cython>=0.29.33
- meson[ninja]=1.2.1
- meson-python=0.13.1
- meson[ninja]=1.4.0
- meson-python=0.15.0

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-312.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ dependencies:
# build dependencies
- versioneer[toml]
- cython>=0.29.33
- meson[ninja]=1.2.1
- meson-python=0.13.1
- meson[ninja]=1.4.0
- meson-python=0.15.0

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-39-minimum_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ dependencies:
# build dependencies
- versioneer[toml]
- cython>=0.29.33
- meson[ninja]=1.2.1
- meson-python=0.13.1
- meson[ninja]=1.4.0
- meson-python=0.15.0

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ dependencies:
# build dependencies
- versioneer[toml]
- cython>=0.29.33
- meson[ninja]=1.2.1
- meson-python=0.13.1
- meson[ninja]=1.4.0
- meson-python=0.15.0

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-pypy-39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dependencies:
# build dependencies
- versioneer[toml]
- cython>=0.29.33
- meson[ninja]=1.2.1
- meson-python=0.13.1
- meson[ninja]=1.4.0
- meson-python=0.15.0

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/circle-310-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ dependencies:
# build dependencies
- versioneer[toml]
- cython>=0.29.33
- meson[ninja]=1.2.1
- meson-python=0.13.1
- meson[ninja]=1.4.0
- meson-python=0.15.0

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ dependencies:
# build dependencies
- versioneer[toml]
- cython~=3.0.5
- meson[ninja]=1.2.1
- meson-python=0.13.1
- meson[ninja]=1.4.0
- meson-python=0.15.0

# test dependencies
- pytest>=7.3.2
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(
'c', 'cpp', 'cython',
version: run_command(['generate_version.py', '--print'], check: true).stdout().strip(),
license: 'BSD-3',
meson_version: '>=1.2.1',
meson_version: '>=1.4.0',
default_options: [
'buildtype=release',
'c_std=c11',
Expand Down
10 changes: 5 additions & 5 deletions pandas/_libs/byteswap.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ from libc.string cimport memcpy

def read_float_with_byteswap(bytes data, Py_ssize_t offset, bint byteswap):
cdef uint32_t value
assert offset + sizeof(value) < len(data)
assert offset + sizeof(value) < <size_t>len(data)
cdef const void *ptr = <unsigned char*>(data) + offset
memcpy(&value, ptr, sizeof(value))
if byteswap:
Expand All @@ -28,7 +28,7 @@ def read_float_with_byteswap(bytes data, Py_ssize_t offset, bint byteswap):

def read_double_with_byteswap(bytes data, Py_ssize_t offset, bint byteswap):
cdef uint64_t value
assert offset + sizeof(value) < len(data)
assert offset + sizeof(value) < <size_t>len(data)
cdef const void *ptr = <unsigned char*>(data) + offset
memcpy(&value, ptr, sizeof(value))
if byteswap:
Expand All @@ -41,7 +41,7 @@ def read_double_with_byteswap(bytes data, Py_ssize_t offset, bint byteswap):

def read_uint16_with_byteswap(bytes data, Py_ssize_t offset, bint byteswap):
cdef uint16_t res
assert offset + sizeof(res) < len(data)
assert offset + sizeof(res) < <size_t>len(data)
memcpy(&res, <const unsigned char*>(data) + offset, sizeof(res))
if byteswap:
res = _byteswap2(res)
Expand All @@ -50,7 +50,7 @@ def read_uint16_with_byteswap(bytes data, Py_ssize_t offset, bint byteswap):

def read_uint32_with_byteswap(bytes data, Py_ssize_t offset, bint byteswap):
cdef uint32_t res
assert offset + sizeof(res) < len(data)
assert offset + sizeof(res) < <size_t>len(data)
memcpy(&res, <const unsigned char*>(data) + offset, sizeof(res))
if byteswap:
res = _byteswap4(res)
Expand All @@ -59,7 +59,7 @@ def read_uint32_with_byteswap(bytes data, Py_ssize_t offset, bint byteswap):

def read_uint64_with_byteswap(bytes data, Py_ssize_t offset, bint byteswap):
cdef uint64_t res
assert offset + sizeof(res) < len(data)
Copy link
Member Author

Choose a reason for hiding this comment

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

warning about comparison of operands with different signs (size_t is unsigned, Py_ssize_t is signed)

assert offset + sizeof(res) < <size_t>len(data)
memcpy(&res, <const unsigned char*>(data) + offset, sizeof(res))
if byteswap:
res = _byteswap8(res)
Expand Down
4 changes: 1 addition & 3 deletions pandas/_libs/include/pandas/vendored/klib/khash_python.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ static void *traced_calloc(size_t num, size_t size) {
}

static void *traced_realloc(void *old_ptr, size_t size) {
PyTraceMalloc_Untrack(KHASH_TRACE_DOMAIN, (uintptr_t)old_ptr);
void *ptr = realloc(old_ptr, size);
if (ptr != NULL) {
if (old_ptr != ptr) {
Copy link
Member Author

Choose a reason for hiding this comment

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

gcc was complaing about a use-after-free with old_ptr here

PyTraceMalloc_Untrack(KHASH_TRACE_DOMAIN, (uintptr_t)old_ptr);
}
PyTraceMalloc_Track(KHASH_TRACE_DOMAIN, (uintptr_t)ptr, size);
}
return ptr;
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ foreach ext_name, ext_dict : libs_sources
ext_dict.get('sources'),
cython_args: cython_args,
include_directories: [inc_np, inc_pd],
dependencies: ext_dict.get('deps', ''),
dependencies: ext_dict.get('deps', []) + [np_dep],
subdir: 'pandas/_libs',
install: true
)
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ foreach ext_name, ext_dict : tslibs_sources
ext_dict.get('sources'),
cython_args: cython_args,
include_directories: [inc_np, inc_pd],
dependencies: ext_dict.get('deps', ''),
dependencies: ext_dict.get('deps', []) + [np_dep],
subdir: 'pandas/_libs/tslibs',
install: true
)
Expand Down
2 changes: 2 additions & 0 deletions pandas/_libs/window/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ py.extension_module(
['aggregations.pyx'],
cython_args: ['-X always_allow_keywords=true'],
include_directories: [inc_np, inc_pd],
dependencies: [np_dep],
subdir: 'pandas/_libs/window',
override_options : ['cython_language=cpp'],
install: true
Expand All @@ -13,6 +14,7 @@ py.extension_module(
['indexers.pyx'],
cython_args: ['-X always_allow_keywords=true'],
include_directories: [inc_np, inc_pd],
dependencies: [np_dep],
subdir: 'pandas/_libs/window',
install: true
)
Expand Down
26 changes: 17 additions & 9 deletions pandas/meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
incdir_numpy = run_command(py,
[
'-c',
'''
# NumPy 2.0 can be detected with meson >= 0.14.0
np_dep = dependency('numpy', required : false)

if np_dep.found()
inc_np = []
else
incdir_numpy = run_command(py,
[
'-c',
'''
import os
import numpy as np
try:
Expand All @@ -12,12 +18,14 @@ try:
except Exception:
incdir = np.get_include()
print(incdir)
'''
],
check: true
).stdout().strip()
'''
],
check: true
).stdout().strip()

inc_np = include_directories(incdir_numpy)
endif

inc_np = include_directories(incdir_numpy)
inc_pd = include_directories('_libs/include')

fs.copyfile('__init__.py')
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Minimum requirements for the build system to execute.
# See https://github.com/scipy/scipy/pull/12940 for the AIX issue.
requires = [
"meson-python==0.13.1",
"meson==1.2.1",
"meson-python==0.15.0",
"meson==1.4.0",
"wheel",
"Cython~=3.0.5", # Note: sync with setup.py, environment.yml and asv.conf.json
# Any NumPy version should be fine for compiling. Users are unlikely
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
pip
versioneer[toml]
cython~=3.0.5
meson[ninja]==1.2.1
meson-python==0.13.1
meson[ninja]==1.4.0
meson-python==0.15.0
pytest>=7.3.2
pytest-cov
pytest-xdist>=2.2.0
Expand Down
Loading