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

bitarray fails to install on PyPy3.9 #188

Closed
pjkundert opened this issue Feb 17, 2023 · 9 comments
Closed

bitarray fails to install on PyPy3.9 #188

pjkundert opened this issue Feb 17, 2023 · 9 comments

Comments

@pjkundert
Copy link

On MacOS, the following build error occurs on PyPy3.9:

  Running setup.py install for bitarray ... error
  error: subprocess-exited-with-error

  × Running setup.py install for bitarray did not run successfully.
  │ exit code: 1
  ╰─> [38 lines of output]
      running install
      /usr/local/pypy3.9-v7.3.11-macos_x86_64/lib/pypy3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-x86_64-pypy39
      creating build/lib.macosx-10.9-x86_64-pypy39/bitarray
      copying bitarray/util.py -> build/lib.macosx-10.9-x86_64-pypy39/bitarray
      copying bitarray/__init__.py -> build/lib.macosx-10.9-x86_64-pypy39/bitarray
      copying bitarray/test_bitarray.py -> build/lib.macosx-10.9-x86_64-pypy39/bitarray
      copying bitarray/test_util.py -> build/lib.macosx-10.9-x86_64-pypy39/bitarray
      copying bitarray/bitarray.h -> build/lib.macosx-10.9-x86_64-pypy39/bitarray
      copying bitarray/pythoncapi_compat.h -> build/lib.macosx-10.9-x86_64-pypy39/bitarray
      copying bitarray/test_data.pickle -> build/lib.macosx-10.9-x86_64-pypy39/bitarray
      copying bitarray/py.typed -> build/lib.macosx-10.9-x86_64-pypy39/bitarray
      copying bitarray/__init__.pyi -> build/lib.macosx-10.9-x86_64-pypy39/bitarray
      copying bitarray/util.pyi -> build/lib.macosx-10.9-x86_64-pypy39/bitarray
      running build_ext
      building 'bitarray._bitarray' extension
      creating build/temp.macosx-10.9-x86_64-pypy39
      creating build/temp.macosx-10.9-x86_64-pypy39/bitarray
      gcc -pthread -arch x86_64 -DNDEBUG -O2 -fPIC -I/usr/local/pypy3.9-v7.3.11-macos_x86_64/include/pypy3.9 -c bitarray/_bitarray.c -o build/temp.macosx-10.9-x86_64-pypy39/bitarray/_bitarray.o
      In file included from bitarray/_bitarray.c:13:
      bitarray/pythoncapi_compat.h:152:41: error: implicit declaration of function 'PyFrame_GetCode' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
          return (PyCodeObject *)_Py_StealRef(PyFrame_GetCode(frame));
                                              ^
      bitarray/pythoncapi_compat.h:152:28: warning: cast to 'PyObject *' (aka 'struct _object *') from smaller integer type 'int' [-Wint-to-pointer-cast]
          return (PyCodeObject *)_Py_StealRef(PyFrame_GetCode(frame));
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      bitarray/pythoncapi_compat.h:73:41: note: expanded from macro '_Py_StealRef'
      #define _Py_StealRef(obj) __Py_StealRef(_PyObject_CAST(obj))
                                              ^~~~~~~~~~~~~~~~~~~
      /usr/local/pypy3.9-v7.3.11-macos_x86_64/include/pypy3.9/object.h:30:29: note: expanded from macro '_PyObject_CAST'
      #define _PyObject_CAST(op) ((PyObject*)(op))
                                  ^~~~~~~~~~~~~~~
      1 warning and 1 error generated.
      error: command '/usr/bin/gcc' failed with exit code 1
@ilanschnell
Copy link
Owner

Thank you for reporting this problem. From the output, I see that the error occurs in the Python C API compatibility header pythoncapi_compat.h. This file is maintained by the Python community, and I haven't updated it in over a year. I can update this file, but as I don't actively support PyPy (no testing against different PyPy versions), I wouldn't be able to tell if this fixes the problem. Once I update the file, would you be able to test master before I tag a new release?

@ilanschnell
Copy link
Owner

I have update pythoncapi_compat.h and added skipping for failing PyPy tests in commit 59f5875 . I got tests working for pp37-* and pp38-*, after running into the same compilation error on PyPy 3.9. Even though bitarray does not actively support PyPy, it would be nice to fix this problem (in either the upstream Python C API compatibility header, or in PyPy itself). Therefore I'm leaving this issue open.

@Bartvelp
Copy link

Not sure If I am running into the exact same error, but this is mine on aarch64 using pypy3.9:

(base) ubuntu@server:~/$ pypy -m pip install bitarray==2.7.3
Collecting bitarray==2.7.3
  Using cached bitarray-2.7.3.tar.gz (123 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: bitarray
  Building wheel for bitarray (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-3.9
      creating build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/test_util.py -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/util.py -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/__init__.py -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/test_bitarray.py -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/bitarray.h -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/pythoncapi_compat.h -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/test_data.pickle -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/py.typed -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/util.pyi -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/__init__.pyi -> build/lib.linux-aarch64-3.9/bitarray
      running build_ext
      building 'bitarray._bitarray' extension
      creating build/temp.linux-aarch64-3.9
      creating build/temp.linux-aarch64-3.9/bitarray
      gcc -pthread -DNDEBUG -O2 -fPIC -I/home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/include/pypy3.9 -c bitarray/_bitarray.c -o build/temp.linux-aarch64-3.9/bitarray/_bitarray.o
      In file included from /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/include/pypy3.9/Python.h:123,
                       from bitarray/_bitarray.c:12:
      /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/include/pypy3.9/pypy_decl.h:648:29: error: static declaration of ‘PyPyObject_CallNoArgs’ follows non-static declaration
        648 | #define PyObject_CallNoArgs PyPyObject_CallNoArgs
            |                             ^~~~~~~~~~~~~~~~~~~~~
      bitarray/pythoncapi_compat.h:395:1: note: in expansion of macro ‘PyObject_CallNoArgs’
        395 | PyObject_CallNoArgs(PyObject *func)
            | ^~~~~~~~~~~~~~~~~~~
      /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/include/pypy3.9/pypy_decl.h:648:29: note: previous declaration of ‘PyPyObject_CallNoArgs’ with type ‘struct _object *(struct _object *)’
        648 | #define PyObject_CallNoArgs PyPyObject_CallNoArgs
            |                             ^~~~~~~~~~~~~~~~~~~~~
      /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/include/pypy3.9/pypy_decl.h:649:30: note: in expansion of macro ‘PyObject_CallNoArgs’
        649 | PyAPI_FUNC(struct _object *) PyObject_CallNoArgs(struct _object *arg0);
            |                              ^~~~~~~~~~~~~~~~~~~
      /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/include/pypy3.9/pypy_decl.h:652:29: error: static declaration of ‘PyPyObject_CallOneArg’ follows non-static declaration
        652 | #define PyObject_CallOneArg PyPyObject_CallOneArg
            |                             ^~~~~~~~~~~~~~~~~~~~~
      bitarray/pythoncapi_compat.h:406:1: note: in expansion of macro ‘PyObject_CallOneArg’
        406 | PyObject_CallOneArg(PyObject *func, PyObject *arg)
            | ^~~~~~~~~~~~~~~~~~~
      /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/include/pypy3.9/pypy_decl.h:652:29: note: previous declaration of ‘PyPyObject_CallOneArg’ with type ‘struct _object *(struct _object *, struct _object *)’
        652 | #define PyObject_CallOneArg PyPyObject_CallOneArg
            |                             ^~~~~~~~~~~~~~~~~~~~~
      /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/include/pypy3.9/pypy_decl.h:653:30: note: in expansion of macro ‘PyObject_CallOneArg’
        653 | PyAPI_FUNC(struct _object *) PyObject_CallOneArg(struct _object *arg0, struct _object *arg1);
            |                              ^~~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for bitarray
  Running setup.py clean for bitarray
Failed to build bitarray
Installing collected packages: bitarray
  Attempting uninstall: bitarray
    Found existing installation: bitarray 2.7.2
    Uninstalling bitarray-2.7.2:
      Successfully uninstalled bitarray-2.7.2
  Running setup.py install for bitarray ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for bitarray did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-3.9
      creating build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/test_util.py -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/util.py -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/__init__.py -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/test_bitarray.py -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/bitarray.h -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/pythoncapi_compat.h -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/test_data.pickle -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/py.typed -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/util.pyi -> build/lib.linux-aarch64-3.9/bitarray
      copying bitarray/__init__.pyi -> build/lib.linux-aarch64-3.9/bitarray
      running build_ext
      building 'bitarray._bitarray' extension
      creating build/temp.linux-aarch64-3.9
      creating build/temp.linux-aarch64-3.9/bitarray
      gcc -pthread -DNDEBUG -O2 -fPIC -I/home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/include/pypy3.9 -c bitarray/_bitarray.c -o build/temp.linux-aarch64-3.9/bitarray/_bitarray.o
      In file included from /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/include/pypy3.9/Python.h:123,
                       from bitarray/_bitarray.c:12:
      /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/include/pypy3.9/pypy_decl.h:648:29: error: static declaration of ‘PyPyObject_CallNoArgs’ follows non-static declaration
        648 | #define PyObject_CallNoArgs PyPyObject_CallNoArgs
            |                             ^~~~~~~~~~~~~~~~~~~~~
      bitarray/pythoncapi_compat.h:395:1: note: in expansion of macro ‘PyObject_CallNoArgs’
        395 | PyObject_CallNoArgs(PyObject *func)
            | ^~~~~~~~~~~~~~~~~~~
      /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/include/pypy3.9/pypy_decl.h:648:29: note: previous declaration of ‘PyPyObject_CallNoArgs’ with type ‘struct _object *(struct _object *)’
        648 | #define PyObject_CallNoArgs PyPyObject_CallNoArgs
            |                             ^~~~~~~~~~~~~~~~~~~~~
      /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/include/pypy3.9/pypy_decl.h:649:30: note: in expansion of macro ‘PyObject_CallNoArgs’
        649 | PyAPI_FUNC(struct _object *) PyObject_CallNoArgs(struct _object *arg0);
            |                              ^~~~~~~~~~~~~~~~~~~
      /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/include/pypy3.9/pypy_decl.h:652:29: error: static declaration of ‘PyPyObject_CallOneArg’ follows non-static declaration
        652 | #define PyObject_CallOneArg PyPyObject_CallOneArg
            |                             ^~~~~~~~~~~~~~~~~~~~~
      bitarray/pythoncapi_compat.h:406:1: note: in expansion of macro ‘PyObject_CallOneArg’
        406 | PyObject_CallOneArg(PyObject *func, PyObject *arg)
            | ^~~~~~~~~~~~~~~~~~~
      /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/include/pypy3.9/pypy_decl.h:652:29: note: previous declaration of ‘PyPyObject_CallOneArg’ with type ‘struct _object *(struct _object *, struct _object *)’
        652 | #define PyObject_CallOneArg PyPyObject_CallOneArg
            |                             ^~~~~~~~~~~~~~~~~~~~~
      /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/include/pypy3.9/pypy_decl.h:653:30: note: in expansion of macro ‘PyObject_CallOneArg’
        653 | PyAPI_FUNC(struct _object *) PyObject_CallOneArg(struct _object *arg0, struct _object *arg1);
            |                              ^~~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Rolling back uninstall of bitarray
  Moving to /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/lib/pypy3.9/site-packages/bitarray-2.7.2.dist-info/
   from /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/lib/pypy3.9/site-packages/~itarray-2.7.2.dist-info
  Moving to /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/lib/pypy3.9/site-packages/bitarray/
   from /home/ubuntu/Downloads/pypy3.9-v7.3.11-aarch64/lib/pypy3.9/site-packages/~itarray
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> bitarray

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
(base) ubuntu@server:~/$

Version 2.7.2 works fine though.

(base) ubuntu@server:~/$ pypy -m pip install bitarray==2.7.2
Collecting bitarray==2.7.2
  Using cached bitarray-2.7.2-pp39-pypy39_pp73-linux_aarch64.whl
Installing collected packages: bitarray
Successfully installed bitarray-2.7.2

@oberstet
Copy link

@ilanschnell did you push this to master on this repo? It seems so .. but it still fails me using pip install "bitarray@ git+https://github.com/ilanschnell/bitarray.git@master#bitarray" using latest PyPy:

oberstet@intel-nuci7:~$ ./pypy3.9-v7.3.11-linux64/bin/python3 -m venv ~/pypy39_4
oberstet@intel-nuci7:~$ source ./pypy39_4/bin/activate
(pypy39_4) oberstet@intel-nuci7:~$ pip install "bitarray@ git+https://github.com/ilanschnell/bitarray.git@master#bitarray"
Collecting bitarray@ git+https://github.com/ilanschnell/bitarray.git@master#bitarray
  Cloning https://github.com/ilanschnell/bitarray.git (to revision master) to /tmp/pip-install-ssuu8n7i/bitarray_2a84fa4d456047c59994bbcf0468f00e
  Running command git clone --filter=blob:none --quiet https://github.com/ilanschnell/bitarray.git /tmp/pip-install-ssuu8n7i/bitarray_2a84fa4d456047c59994bbcf0468f00e
  Resolved https://github.com/ilanschnell/bitarray.git to commit 550c5031f72750b6565fccbe20dce33e57a24ee1
  Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for bitarray, since package 'wheel' is not installed.
Installing collected packages: bitarray
  Running setup.py install for bitarray ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for bitarray did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.9
      creating build/lib.linux-x86_64-3.9/bitarray
      copying bitarray/__init__.py -> build/lib.linux-x86_64-3.9/bitarray
      copying bitarray/test_util.py -> build/lib.linux-x86_64-3.9/bitarray
      copying bitarray/util.py -> build/lib.linux-x86_64-3.9/bitarray
      copying bitarray/test_bitarray.py -> build/lib.linux-x86_64-3.9/bitarray
      copying bitarray/bitarray.h -> build/lib.linux-x86_64-3.9/bitarray
      copying bitarray/pythoncapi_compat.h -> build/lib.linux-x86_64-3.9/bitarray
      copying bitarray/test_data.pickle -> build/lib.linux-x86_64-3.9/bitarray
      copying bitarray/py.typed -> build/lib.linux-x86_64-3.9/bitarray
      copying bitarray/__init__.pyi -> build/lib.linux-x86_64-3.9/bitarray
      copying bitarray/util.pyi -> build/lib.linux-x86_64-3.9/bitarray
      running build_ext
      building 'bitarray._bitarray' extension
      creating build/temp.linux-x86_64-3.9
      creating build/temp.linux-x86_64-3.9/bitarray
      gcc -pthread -DNDEBUG -O2 -fPIC -I/home/oberstet/pypy39_4/include -I/home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9 -c bitarray/_bitarray.c -o build/temp.linux-x86_64-3.9/bitarray/_bitarray.o
      In file included from /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/Python.h:123,
                       from bitarray/_bitarray.c:12:
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:648:29: error: static declaration of ‘PyPyObject_CallNoArgs’ follows non-static declaration
        648 | #define PyObject_CallNoArgs PyPyObject_CallNoArgs
            |                             ^~~~~~~~~~~~~~~~~~~~~
      bitarray/pythoncapi_compat.h:395:1: note: in expansion of macro ‘PyObject_CallNoArgs’
        395 | PyObject_CallNoArgs(PyObject *func)
            | ^~~~~~~~~~~~~~~~~~~
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:648:29: note: previous declaration of ‘PyPyObject_CallNoArgs’ with type ‘struct _object *(struct _object *)’
        648 | #define PyObject_CallNoArgs PyPyObject_CallNoArgs
            |                             ^~~~~~~~~~~~~~~~~~~~~
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:649:30: note: in expansion of macro ‘PyObject_CallNoArgs’
        649 | PyAPI_FUNC(struct _object *) PyObject_CallNoArgs(struct _object *arg0);
            |                              ^~~~~~~~~~~~~~~~~~~
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:652:29: error: static declaration of ‘PyPyObject_CallOneArg’ follows non-static declaration
        652 | #define PyObject_CallOneArg PyPyObject_CallOneArg
            |                             ^~~~~~~~~~~~~~~~~~~~~
      bitarray/pythoncapi_compat.h:406:1: note: in expansion of macro ‘PyObject_CallOneArg’
        406 | PyObject_CallOneArg(PyObject *func, PyObject *arg)
            | ^~~~~~~~~~~~~~~~~~~
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:652:29: note: previous declaration of ‘PyPyObject_CallOneArg’ with type ‘struct _object *(struct _object *, struct _object *)’
        652 | #define PyObject_CallOneArg PyPyObject_CallOneArg
            |                             ^~~~~~~~~~~~~~~~~~~~~
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:653:30: note: in expansion of macro ‘PyObject_CallOneArg’
        653 | PyAPI_FUNC(struct _object *) PyObject_CallOneArg(struct _object *arg0, struct _object *arg1);
            |                              ^~~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> bitarray

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
WARNING: You are using pip version 22.0.4; however, version 23.1.2 is available.
You should consider upgrading via the '/home/oberstet/pypy39_4/bin/python3 -m pip install --upgrade pip' command.
(pypy39_4) oberstet@intel-nuci7:~$ which python
/home/oberstet/pypy39_4/bin/python
(pypy39_4) oberstet@intel-nuci7:~$ python -V
Python 3.9.16 (feeb267ead3e6771d3f2f49b83e1894839f64fb7, Dec 29 2022, 14:23:21)
[PyPy 7.3.11 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)]
(pypy39_4) oberstet@intel-nuci7:~$ 

To rule out issues coming from me using pip with pep-0508, I tried with a cloned repo and

(pypy39_4) oberstet@intel-nuci7:~/scm/3rdparty$ git clone git@github.com:ilanschnell/bitarray.git
Klone nach 'bitarray' …
remote: Enumerating objects: 12901, done.
remote: Counting objects: 100% (190/190), done.
remote: Compressing objects: 100% (75/75), done.
remote: Total 12901 (delta 119), reused 180 (delta 111), pack-reused 12711
Empfange Objekte: 100% (12901/12901), 2.69 MiB | 957.00 KiB/s, fertig.
Löse Unterschiede auf: 100% (9271/9271), fertig.
(pypy39_4) oberstet@intel-nuci7:~/scm/3rdparty$ cd bitarray/
(pypy39_4) oberstet@intel-nuci7:~/scm/3rdparty/bitarray$ pip install -e .
Obtaining file:///home/oberstet/scm/3rdparty/bitarray
  Preparing metadata (setup.py) ... done
Installing collected packages: bitarray
  Running setup.py develop for bitarray
    error: subprocess-exited-with-error
    
    × python setup.py develop did not run successfully.
    │ exit code: 1
    ╰─> [43 lines of output]
        running develop
        running egg_info
        creating bitarray.egg-info
        writing bitarray.egg-info/PKG-INFO
        writing dependency_links to bitarray.egg-info/dependency_links.txt
        writing top-level names to bitarray.egg-info/top_level.txt
        writing manifest file 'bitarray.egg-info/SOURCES.txt'
        reading manifest file 'bitarray.egg-info/SOURCES.txt'
        adding license file 'LICENSE'
        writing manifest file 'bitarray.egg-info/SOURCES.txt'
        running build_ext
        building 'bitarray._bitarray' extension
        creating build
        creating build/temp.linux-x86_64-3.9
        creating build/temp.linux-x86_64-3.9/bitarray
        gcc -pthread -DNDEBUG -O2 -fPIC -I/home/oberstet/pypy39_4/include -I/home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9 -c bitarray/_bitarray.c -o build/temp.linux-x86_64-3.9/bitarray/_bitarray.o
        In file included from /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/Python.h:123,
                         from bitarray/_bitarray.c:12:
        /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:648:29: error: static declaration of ‘PyPyObject_CallNoArgs’ follows non-static declaration
          648 | #define PyObject_CallNoArgs PyPyObject_CallNoArgs
              |                             ^~~~~~~~~~~~~~~~~~~~~
        bitarray/pythoncapi_compat.h:395:1: note: in expansion of macro ‘PyObject_CallNoArgs’
          395 | PyObject_CallNoArgs(PyObject *func)
              | ^~~~~~~~~~~~~~~~~~~
        /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:648:29: note: previous declaration of ‘PyPyObject_CallNoArgs’ with type ‘struct _object *(struct _object *)’
          648 | #define PyObject_CallNoArgs PyPyObject_CallNoArgs
              |                             ^~~~~~~~~~~~~~~~~~~~~
        /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:649:30: note: in expansion of macro ‘PyObject_CallNoArgs’
          649 | PyAPI_FUNC(struct _object *) PyObject_CallNoArgs(struct _object *arg0);
              |                              ^~~~~~~~~~~~~~~~~~~
        /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:652:29: error: static declaration of ‘PyPyObject_CallOneArg’ follows non-static declaration
          652 | #define PyObject_CallOneArg PyPyObject_CallOneArg
              |                             ^~~~~~~~~~~~~~~~~~~~~
        bitarray/pythoncapi_compat.h:406:1: note: in expansion of macro ‘PyObject_CallOneArg’
          406 | PyObject_CallOneArg(PyObject *func, PyObject *arg)
              | ^~~~~~~~~~~~~~~~~~~
        /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:652:29: note: previous declaration of ‘PyPyObject_CallOneArg’ with type ‘struct _object *(struct _object *, struct _object *)’
          652 | #define PyObject_CallOneArg PyPyObject_CallOneArg
              |                             ^~~~~~~~~~~~~~~~~~~~~
        /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:653:30: note: in expansion of macro ‘PyObject_CallOneArg’
          653 | PyAPI_FUNC(struct _object *) PyObject_CallOneArg(struct _object *arg0, struct _object *arg1);
              |                              ^~~~~~~~~~~~~~~~~~~
        error: command '/usr/bin/gcc' failed with exit code 1
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [43 lines of output]
    running develop
    running egg_info
    creating bitarray.egg-info
    writing bitarray.egg-info/PKG-INFO
    writing dependency_links to bitarray.egg-info/dependency_links.txt
    writing top-level names to bitarray.egg-info/top_level.txt
    writing manifest file 'bitarray.egg-info/SOURCES.txt'
    reading manifest file 'bitarray.egg-info/SOURCES.txt'
    adding license file 'LICENSE'
    writing manifest file 'bitarray.egg-info/SOURCES.txt'
    running build_ext
    building 'bitarray._bitarray' extension
    creating build
    creating build/temp.linux-x86_64-3.9
    creating build/temp.linux-x86_64-3.9/bitarray
    gcc -pthread -DNDEBUG -O2 -fPIC -I/home/oberstet/pypy39_4/include -I/home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9 -c bitarray/_bitarray.c -o build/temp.linux-x86_64-3.9/bitarray/_bitarray.o
    In file included from /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/Python.h:123,
                     from bitarray/_bitarray.c:12:
    /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:648:29: error: static declaration of ‘PyPyObject_CallNoArgs’ follows non-static declaration
      648 | #define PyObject_CallNoArgs PyPyObject_CallNoArgs
          |                             ^~~~~~~~~~~~~~~~~~~~~
    bitarray/pythoncapi_compat.h:395:1: note: in expansion of macro ‘PyObject_CallNoArgs’
      395 | PyObject_CallNoArgs(PyObject *func)
          | ^~~~~~~~~~~~~~~~~~~
    /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:648:29: note: previous declaration of ‘PyPyObject_CallNoArgs’ with type ‘struct _object *(struct _object *)’
      648 | #define PyObject_CallNoArgs PyPyObject_CallNoArgs
          |                             ^~~~~~~~~~~~~~~~~~~~~
    /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:649:30: note: in expansion of macro ‘PyObject_CallNoArgs’
      649 | PyAPI_FUNC(struct _object *) PyObject_CallNoArgs(struct _object *arg0);
          |                              ^~~~~~~~~~~~~~~~~~~
    /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:652:29: error: static declaration of ‘PyPyObject_CallOneArg’ follows non-static declaration
      652 | #define PyObject_CallOneArg PyPyObject_CallOneArg
          |                             ^~~~~~~~~~~~~~~~~~~~~
    bitarray/pythoncapi_compat.h:406:1: note: in expansion of macro ‘PyObject_CallOneArg’
      406 | PyObject_CallOneArg(PyObject *func, PyObject *arg)
          | ^~~~~~~~~~~~~~~~~~~
    /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:652:29: note: previous declaration of ‘PyPyObject_CallOneArg’ with type ‘struct _object *(struct _object *, struct _object *)’
      652 | #define PyObject_CallOneArg PyPyObject_CallOneArg
          |                             ^~~~~~~~~~~~~~~~~~~~~
    /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:653:30: note: in expansion of macro ‘PyObject_CallOneArg’
      653 | PyAPI_FUNC(struct _object *) PyObject_CallOneArg(struct _object *arg0, struct _object *arg1);
          |                              ^~~~~~~~~~~~~~~~~~~
    error: command '/usr/bin/gcc' failed with exit code 1
    [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: You are using pip version 22.0.4; however, version 23.1.2 is available.
You should consider upgrading via the '/home/oberstet/pypy39_4/bin/python3 -m pip install --upgrade pip' command.
(pypy39_4) oberstet@intel-nuci7:~/scm/3rdparty/bitarray$ 

@dpmabo
Copy link

dpmabo commented May 16, 2023

any update of this issue?

logicsys added a commit to logicsys/bitarray that referenced this issue May 30, 2023
@logicsys
Copy link
Contributor

looks like the issue oberstet was referring to (involving PyObject_CallNoArgs & PyPyObject_CallOneArg) , is distinct from the original issue raised by pjkundert (PyFrame_GetCode) .

I have made a pull request (#198) that seems to fix the issue for pypy3.9-v7.3.11 , it now installs for me, and the bitarray tests run without error.

ilanschnell added a commit that referenced this issue May 31, 2023
fix for pypy3.9-v7.3.11, see #188
@oberstet
Copy link

oberstet commented Jun 1, 2023

ok, gave it a try in my dependency crossbario/autobahn-python#1617, but on pypy

(pypy39_1) oberstet@intel-nuci7:~/scm/crossbario/autobahn-python$ python -V
Python 3.9.16 (feeb267ead3e6771d3f2f49b83e1894839f64fb7, Dec 29 2022, 14:23:21)
[PyPy 7.3.11 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)]

I'm running into

  Running setup.py install for bitarray ... error

  Running command git clone --filter=blob:none --quiet https://github.com/crossbario/txaio /tmp/pip-req-build-mwia60pa
  Running command git clone --filter=blob:none --quiet https://github.com/ethereum/web3.py.git /tmp/pip-req-build-jxvvqble
  Running command git submodule update --init --recursive -q
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-pypy39
      creating build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/__init__.py -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/test_util.py -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/util.py -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/test_bitarray.py -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/bitarray.h -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/pythoncapi_compat.h -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/test_data.pickle -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/py.typed -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/__init__.pyi -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/util.pyi -> build/lib.linux-x86_64-pypy39/bitarray
      running build_ext
      building 'bitarray._bitarray' extension
      creating build/temp.linux-x86_64-pypy39
      creating build/temp.linux-x86_64-pypy39/bitarray
      gcc -pthread -DNDEBUG -O2 -fPIC -I/home/oberstet/scm/crossbario/autobahn-python/.tox/pypy39-tw2210/include -I/home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9 -c bitarray/_bitarray.c -o build/temp.linux-x86_64-pypy39/bitarray/_bitarray.o
      In file included from /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/Python.h:123,
                       from bitarray/_bitarray.c:12:
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:648:29: error: static declaration of ‘PyPyObject_CallNoArgs’ follows non-static declaration
        648 | #define PyObject_CallNoArgs PyPyObject_CallNoArgs
            |                             ^~~~~~~~~~~~~~~~~~~~~
      bitarray/pythoncapi_compat.h:395:1: note: in expansion of macro ‘PyObject_CallNoArgs’
        395 | PyObject_CallNoArgs(PyObject *func)
            | ^~~~~~~~~~~~~~~~~~~
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:648:29: note: previous declaration of ‘PyPyObject_CallNoArgs’ with type ‘struct _object *(struct _object *)’
        648 | #define PyObject_CallNoArgs PyPyObject_CallNoArgs
            |                             ^~~~~~~~~~~~~~~~~~~~~
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:649:30: note: in expansion of macro ‘PyObject_CallNoArgs’
        649 | PyAPI_FUNC(struct _object *) PyObject_CallNoArgs(struct _object *arg0);
            |                              ^~~~~~~~~~~~~~~~~~~
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:652:29: error: static declaration of ‘PyPyObject_CallOneArg’ follows non-static declaration
        652 | #define PyObject_CallOneArg PyPyObject_CallOneArg
            |                             ^~~~~~~~~~~~~~~~~~~~~
      bitarray/pythoncapi_compat.h:406:1: note: in expansion of macro ‘PyObject_CallOneArg’
        406 | PyObject_CallOneArg(PyObject *func, PyObject *arg)
            | ^~~~~~~~~~~~~~~~~~~
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:652:29: note: previous declaration of ‘PyPyObject_CallOneArg’ with type ‘struct _object *(struct _object *, struct _object *)’
        652 | #define PyObject_CallOneArg PyPyObject_CallOneArg
            |                             ^~~~~~~~~~~~~~~~~~~~~
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:653:30: note: in expansion of macro ‘PyObject_CallOneArg’
        653 | PyAPI_FUNC(struct _object *) PyObject_CallOneArg(struct _object *arg0, struct _object *arg1);
            |                              ^~~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for bitarray
  error: subprocess-exited-with-error
  
  × Running setup.py install for bitarray did not run successfully.
  │ exit code: 1
  ╰─> [50 lines of output]
      running install
      /home/oberstet/scm/crossbario/autobahn-python/.tox/pypy39-tw2210/lib/pypy3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-pypy39
      creating build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/__init__.py -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/test_util.py -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/util.py -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/test_bitarray.py -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/bitarray.h -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/pythoncapi_compat.h -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/test_data.pickle -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/py.typed -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/__init__.pyi -> build/lib.linux-x86_64-pypy39/bitarray
      copying bitarray/util.pyi -> build/lib.linux-x86_64-pypy39/bitarray
      running build_ext
      building 'bitarray._bitarray' extension
      creating build/temp.linux-x86_64-pypy39
      creating build/temp.linux-x86_64-pypy39/bitarray
      gcc -pthread -DNDEBUG -O2 -fPIC -I/home/oberstet/scm/crossbario/autobahn-python/.tox/pypy39-tw2210/include -I/home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9 -c bitarray/_bitarray.c -o build/temp.linux-x86_64-pypy39/bitarray/_bitarray.o
      In file included from /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/Python.h:123,
                       from bitarray/_bitarray.c:12:
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:648:29: error: static declaration of ‘PyPyObject_CallNoArgs’ follows non-static declaration
        648 | #define PyObject_CallNoArgs PyPyObject_CallNoArgs
            |                             ^~~~~~~~~~~~~~~~~~~~~
      bitarray/pythoncapi_compat.h:395:1: note: in expansion of macro ‘PyObject_CallNoArgs’
        395 | PyObject_CallNoArgs(PyObject *func)
            | ^~~~~~~~~~~~~~~~~~~
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:648:29: note: previous declaration of ‘PyPyObject_CallNoArgs’ with type ‘struct _object *(struct _object *)’
        648 | #define PyObject_CallNoArgs PyPyObject_CallNoArgs
            |                             ^~~~~~~~~~~~~~~~~~~~~
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:649:30: note: in expansion of macro ‘PyObject_CallNoArgs’
        649 | PyAPI_FUNC(struct _object *) PyObject_CallNoArgs(struct _object *arg0);
            |                              ^~~~~~~~~~~~~~~~~~~
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:652:29: error: static declaration of ‘PyPyObject_CallOneArg’ follows non-static declaration
        652 | #define PyObject_CallOneArg PyPyObject_CallOneArg
            |                             ^~~~~~~~~~~~~~~~~~~~~
      bitarray/pythoncapi_compat.h:406:1: note: in expansion of macro ‘PyObject_CallOneArg’
        406 | PyObject_CallOneArg(PyObject *func, PyObject *arg)
            | ^~~~~~~~~~~~~~~~~~~
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:652:29: note: previous declaration of ‘PyPyObject_CallOneArg’ with type ‘struct _object *(struct _object *, struct _object *)’
        652 | #define PyObject_CallOneArg PyPyObject_CallOneArg
            |                             ^~~~~~~~~~~~~~~~~~~~~
      /home/oberstet/pypy3.9-v7.3.11-linux64/include/pypy3.9/pypy_decl.h:653:30: note: in expansion of macro ‘PyObject_CallOneArg’
        653 | PyAPI_FUNC(struct _object *) PyObject_CallOneArg(struct _object *arg0, struct _object *arg1);
            |                              ^~~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> bitarray

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

@logicsys
Copy link
Contributor

logicsys commented Jun 6, 2023

I think we can close this issue now, oberstets problem was fixed by using the latest bitarray at github master rather than the latest available pypi package.

We've also got this merged into pythoncapi-compat upstream with python/pythoncapi-compat#59

@ilanschnell
Copy link
Owner

I just switched to using (the slightly different) upstream pythoncapi_compat.h: 1ced34a
This is part of the 2.7.5 release which I just tagged, which will have PyPy wheels available on PyPi shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants