Skip to content
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

BUG: Fix meson build failure due to unchanged inplace auto-generated dispatch config headers #24468

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,6 @@ tools/swig/test/Array.py

# SIMD generated files #
###################################
# config headers of dispatchable sources
*.dispatch.h
# wrapped sources of dispatched targets, e.g. *.dispatch.avx2.c
*.dispatch.*.c
*.dispatch.*.cpp
mattip marked this conversation as resolved.
Show resolved Hide resolved
# _simd module
numpy/core/src/_simd/_simd.dispatch.c
numpy/core/src/_simd/_simd_data.inc
Expand Down
4 changes: 2 additions & 2 deletions numpy/distutils/command/build_clib.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ def build_a_library(self, build_info, lib_name, libraries):
dispatch_hpath = os.path.join("numpy", "distutils", "include")
dispatch_hpath = os.path.join(bsrc_dir, dispatch_hpath)
include_dirs.append(dispatch_hpath)

copt_build_src = None if self.inplace else bsrc_dir
# copt_build_src = None if self.inplace else bsrc_dir
copt_build_src = bsrc_dir
for _srcs, _dst, _ext in (
((c_sources,), copt_c_sources, ('.dispatch.c',)),
((c_sources, cxx_sources), copt_cxx_sources,
Expand Down
13 changes: 12 additions & 1 deletion numpy/distutils/command/build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,18 @@ def build_extension(self, ext):
dispatch_hpath = os.path.join(bsrc_dir, dispatch_hpath)
include_dirs.append(dispatch_hpath)

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