ERROR: Module "features" does not exist

Hello, We have a custom and unusual build environment that is making things a bit difficult to transition from the old Setuptools based build process to Meson. I'm currently blocked at the CPU feature set detection: ``` [tasks] Build command: call vcvarsall amd64 && cd /d "[...]\numpy" && pip install -e . --no-build-isolation ********************************************************************** ** Visual Studio 2022 Developer Command Prompt v17.9.6 ** Copyright (c) 2022 Microsoft Corporation ********************************************************************** [vcvarsall.bat] Environment initialized for: 'x64' Defaulting to user installation because normal site-packages is not writeable Obtaining file:///[...]/numpy Checking if build backend supports build_editable: started Checking if build backend supports build_editable: finished with status 'done' Preparing editable metadata (pyproject.toml): started Preparing editable metadata (pyproject.toml): finished with status 'error' error: subprocess-exited-with-error × Preparing editable metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [24 lines of output] + [...]\meson\Scripts\meson.exe setup [...]\numpy [...]\numpy\build\cp311 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=[...]\numpy\build\cp311\meson-python-native-file.ini The Meson build system Version: 1.4.0 Source dir: [...]\numpy Build dir: [...]\numpy\build\cp311 Build type: native build Project name: NumPy Project version: 1.26.5 C compiler for the host machine: cl (msvc 19.39.33523 "Microsoft (R) C/C++ Optimizing Compiler Version 19.39.33523 for x64") C linker for the host machine: link link 14.39.33523.0 C++ compiler for the host machine: cl (msvc 19.39.33523 "Microsoft (R) C/C++ Optimizing Compiler Version 19.39.33523 for x64") C++ linker for the host machine: link link 14.39.33523.0 Cython compiler for the host machine: [...]\python-3.11\cython\bin\cython.bat (cython 3.0.9) Host machine cpu family: x86_64 Host machine cpu: x86_64 Program python found: YES (C:\Program Files\Python311\python.exe) Run-time dependency python found: YES 3.11 Has header "Python.h" with dependency python: YES Compiler for C supports arguments -fno-strict-aliasing: NO Message: [...]\numpy ..\..\meson_cpu\x86\meson.build:3:15: ERROR: Module "features" does not exist A full log can be found at [...]\numpy\build\cp311\meson-logs\meson-log.txt [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details. 14:27:24 ERROR BuildError: The custom build system failed. ``` So the build fails whilst trying to import the "features" module here: https://github.com/numpy/numpy/blob/main/meson_cpu/x86/meson.build#L2C1-L3C1 Where is that module meant to be located? Cheers, Thomas

On Thu, May 16, 2024 at 2:18 PM Thomas Mansencal <thomas.mansencal@gmail.com> wrote:
Hello,
We have a custom and unusual build environment that is making things a bit difficult to transition from the old Setuptools based build process to Meson. I'm currently blocked at the CPU feature set detection:
``` [tasks] Build command: call vcvarsall amd64 && cd /d "[...]\numpy" && pip install -e . --no-build-isolation ********************************************************************** ** Visual Studio 2022 Developer Command Prompt v17.9.6 ** Copyright (c) 2022 Microsoft Corporation ********************************************************************** [vcvarsall.bat] Environment initialized for: 'x64' Defaulting to user installation because normal site-packages is not writeable Obtaining file:///[...]/numpy Checking if build backend supports build_editable: started Checking if build backend supports build_editable: finished with status 'done' Preparing editable metadata (pyproject.toml): started Preparing editable metadata (pyproject.toml): finished with status 'error' error: subprocess-exited-with-error
× Preparing editable metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [24 lines of output] + [...]\meson\Scripts\meson.exe setup [...]\numpy [...]\numpy\build\cp311 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=[...]\numpy\build\cp311\meson-python-native-file.ini The Meson build system Version: 1.4.0 Source dir: [...]\numpy Build dir: [...]\numpy\build\cp311 Build type: native build Project name: NumPy Project version: 1.26.5 C compiler for the host machine: cl (msvc 19.39.33523 "Microsoft (R) C/C++ Optimizing Compiler Version 19.39.33523 for x64") C linker for the host machine: link link 14.39.33523.0 C++ compiler for the host machine: cl (msvc 19.39.33523 "Microsoft (R) C/C++ Optimizing Compiler Version 19.39.33523 for x64") C++ linker for the host machine: link link 14.39.33523.0 Cython compiler for the host machine: [...]\python-3.11\cython\bin\cython.bat (cython 3.0.9) Host machine cpu family: x86_64 Host machine cpu: x86_64 Program python found: YES (C:\Program Files\Python311\python.exe) Run-time dependency python found: YES 3.11 Has header "Python.h" with dependency python: YES Compiler for C supports arguments -fno-strict-aliasing: NO Message: [...]\numpy
..\..\meson_cpu\x86\meson.build:3:15: ERROR: Module "features" does not exist
A full log can be found at [...]\numpy\build\cp311\meson-logs\meson-log.txt [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
× Encountered error while generating package metadata. ╰─> See above for output.
note: This is an issue with the package mentioned above, not pip. hint: See above for details. 14:27:24 ERROR BuildError: The custom build system failed. ```
So the build fails whilst trying to import the "features" module here: https://github.com/numpy/numpy/blob/main/meson_cpu/x86/meson.build#L2C1-L3C1
Where is that module meant to be located?
That's part of our vendored-meson. You are invoking plain `meson` somehow (as can be seen from the `Version: 1.4.0` logging output), which doesn't have that. Invoke `python ./vendored-meson/meson/meson.py` instead. Cheers, Ralf
Cheers,
Thomas _______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-leave@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: ralf.gommers@googlemail.com
participants (2)
-
Ralf Gommers
-
Thomas Mansencal