8000 Merge pull request #24468 from seiko2plus/issue_24450 · numpy/numpy@e8e523f · GitHub
[go: up one dir, main page]

Skip to content

Commit e8e523f

Browse files
authored
Merge pull request #24468 from seiko2plus/issue_24450
BUG: Fix meson build failure due to unchanged inplace auto-generated dispatch config headers
2 parents 3c04e81 + 16f7374 commit e8e523f

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,6 @@ tools/swig/test/Array.py
208208

209209
# SIMD generated files #
210210
###################################
211-
# config headers of dispatchable sources
212-
*.dispatch.h
213-
# wrapped sources of dispatched targets, e.g. *.dispatch.avx2.c
214-
*.dispatch.*.c
215-
*.dispatch.*.cpp
216211
# _simd module
217212
numpy/core/src/_simd/_simd.dispatch.c
218213
numpy/core/src/_simd/_simd_data.inc

numpy/distutils/command/build_clib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ def build_a_library(self, build_info, lib_name, libraries):
320320
dispatch_hpath = os.path.join("numpy", "distutils", "include")
321321
dispatch_hpath = os.path.join(bsrc_dir, dispatch_hpath)
322322
include_dirs.append(dispatch_hpath)
323-
324-
copt_build_src = None if self.inplace else bsrc_dir
323+
# copt_build_src = None if self.inplace else bsrc_dir
324+
copt_build_src = bsrc_dir
325325
for _srcs, _dst, _ext in (
326326
((c_sources,), copt_c_sources, ('.dispatch.c',)),
327327
((c_sources, cxx_sources), copt_cxx_sources,

numpy/distutils/command/build_ext.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,18 @@ def build_extension(self, ext):
458458
dispatch_hpath = os.path.join(bsrc_dir, dispatch_hpath)
459459
include_dirs.append(dispatch_hpath)
460460

461-
copt_build_src = None if self.inplace else bsrc_dir
461+
# copt_build_src = None if self.inplace else bsrc_dir
462+
# Always generate the generated config files and
463+
# dispatch-able sources inside the build directory,
464+
# even if the build option `inplace` is enabled.
465+
# This approach prevents conflicts with Meson-generated
466+
# config headers. Since `spin build --clean` will not remove
467+
# these headers, they might overwrite the generated Meson headers,
468+
# causing compatibility issues. Maintaining separate directories
469+
# ensures compatibility between distutils dispatch config headers
470+
# and Meson headers, avoiding build disruptions.
471+
# See gh-24450 for more details.
472+
copt_build_src = bsrc_dir
462473
for _srcs, _dst, _ext in (
463474
((c_sources,), copt_c_sources, ('.dispatch.c',)),
464475
((c_sources, cxx_sources), copt_cxx_sources,

0 commit comments

Comments
 (0)
0