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: build failure with pip: CRITICAL: Chair to keyboard interface error #16343

Closed
oscarbenjamin opened this issue Jun 2, 2022 · 3 comments
Closed
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected Meson Items related to the introduction of Meson as the new build system for SciPy

Comments

@oscarbenjamin
Copy link

Describe your issue.

This comes from SymPy CI:
https://github.com/sympy/sympy/runs/6702902348?check_suite_focus=true

This is a followup after (#16308). Now pip installing SciPy from git fails for a different reason giving the error message:

      AttributeError: module 'mesonpy' has no attribute 'prepare_metadata_for_build_wheel'

Somewhat less noticeable in the output before that there is this:

      [801/1573] Generating scipy/stats/_hypotests_pythran with a custom command
      FAILED: scipy/stats/_hypotests_pythran.cpp
      /tmp/pip-build-env-bbkttqdn/overlay/bin/pythran -E ../../scipy/stats/_hypotests_pythran.py -o scipy/stats/_hypotests_pythran.cpp
      CRITICAL: Chair to keyboard interface error
      E: line 8-0 is not a valid range
      [802/1573] Generating 'scipy/stats/_boost/hypergeom_ufunc.cpython-311-x86_64-linux-gnu.so.p/hypergeom_ufunc.cpp'.
      [803/1573] Generating 'scipy/stats/_boost/nbinom_ufunc.cpython-311-x86_64-linux-gnu.so.p/nbinom_ufunc.cpp'.
      ninja: build stopped: subcommand failed.
      + meson setup --native-file=/tmp/pip-req-build-

Reproducing Code Example

# Ubuntu 20.04.4 with Python 3.11b1 running in GA
sudo apt install antlr4 libgfortran5 gfortran libmpfr-dev libmpc-dev libopenblas-dev
pip install --upgrade pip wheel
pip install git+https://github.com/cython/cython@master
pip install git+https://github.com/numpy/numpy@main
pip install git+https://github.com/scipy/scipy@main

Error message

gnu.so.p/biasedurn_stoc3.cpp.o
      [799/1573] Compiling C++ object scipy/stats/_biasedurn.cpython-311-x86_64-linux-gnu.so.p/meson-generated__biasedurn.cpp.o
      [800/1573] Linking target scipy/stats/_biasedurn.cpython-311-x86_64-linux-gnu.so
      [801/1573] Generating scipy/stats/_hypotests_pythran with a custom command
      FAILED: scipy/stats/_hypotests_pythran.cpp
      /tmp/pip-build-env-bbkttqdn/overlay/bin/pythran -E ../../scipy/stats/_hypotests_pythran.py -o scipy/stats/_hypotests_pythran.cpp
      CRITICAL: Chair to keyboard interface error
      E: line 8-0 is not a valid range
      [802/1573] Generating 'scipy/stats/_boost/hypergeom_ufunc.cpython-311-x86_64-linux-gnu.so.p/hypergeom_ufunc.cpp'.
      [803/1573] Generating 'scipy/stats/_boost/nbinom_ufunc.cpython-311-x86_64-linux-gnu.so.p/nbinom_ufunc.cpp'.
      ninja: build stopped: subcommand failed.
      + meson setup --native-file=/tmp/pip-req-build-hxsbja34/.mesonpy-native-file.ini -Ddebug=false -Dstrip=true -Doptimization=2 --prefix=/opt/hostedtoolcache/Python/3.11.0-beta.2/x64 /tmp/pip-req-build-hxsbja34 /tmp/pip-req-build-hxsbja34/.mesonpy-ajn72msr/build
      + meson compile
      Traceback (most recent call last):
        File "/opt/hostedtoolcache/Python/3.11.0-beta.2/x64/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 156, in prepare_metadata_for_build_wheel
          hook = backend.prepare_metadata_for_build_wheel
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'mesonpy' has no attribute 'prepare_metadata_for_build_wheel'
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/opt/hostedtoolcache/Python/3.11.0-beta.2/x64/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
          ^^^^^^
        File "/opt/hostedtoolcache/Python/3.11.0-beta.2/x64/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/hostedtoolcache/Python/3.11.0-beta.2/x64/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 160, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-bbkttqdn/overlay/lib/python3.11/site-packages/mesonpy/__init__.py", line 823, in build_wheel
          return project.wheel(out).name
                 ^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-bbkttqdn/overlay/lib/python3.11/site-packages/mesonpy/__init__.py", line 772, in wheel
          wheel = _WheelBuilder(self).build(self._install_plan, self._copy_files, self._build_dir)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-bbkttqdn/overlay/lib/python3.11/site-packages/mesonpy/__init__.py", line 315, in build
          self._project.build()  # ensure project is built
          ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-bbkttqdn/overlay/lib/python3.11/site-packages/mesonpy/__init__.py", line 467, in build
          self._meson('compile')
          ^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-bbkttqdn/overlay/lib/python3.11/site-packages/mesonpy/__init__.py", line 438, in _meson
          return self._proc('meson', *args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-bbkttqdn/overlay/lib/python3.11/site-packages/mesonpy/__init__.py", line 434, in _proc
          subprocess.check_call(list(args))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/hostedtoolcache/Python/3.11.0-beta.2/x64/lib/python3.11/subprocess.py", line 402, in check_call
          raise CalledProcessError(retcode, cmd)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      subprocess.CalledProcessError: Command '['meson', 'compile']' returned non-zero exit status 1.
      [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.
Error: Process completed with exit code 1.

SciPy/NumPy/Python version information

scipy/numpy from git and python 3.11b1

@oscarbenjamin oscarbenjamin added the defect A clear bug or issue that prevents SciPy from being installed or used as expected label Jun 2, 2022
@tupui tupui added the Meson Items related to the introduction of Meson as the new build system for SciPy label Jun 2, 2022
@ilayn
Copy link
Member

ilayn commented Jun 2, 2022

Regardless of the source, that error message shouldn't be used. Especially within the process that is fragile to planet alignments and time of the day

@rossbar
Copy link
Contributor

rossbar commented Jun 2, 2022

This looks related to a known issue with Python 3.11b2 & pytest. See pytest-dev/pytest#10008.

This should be fixed in the Python 3.11-beta3 which is (should be?) generally available now.

@oscarbenjamin
Copy link
Author

Yes, actually it does seem SciPy builds successfully now with 3.11b3. Tests haven't run because something else failed to build but I'll close this now in any case.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected Meson Items related to the introduction of Meson as the new build system for SciPy
Projects
None yet
Development

No branches or pull requests

4 participants