ethereum / staking-deposit-cli

Secure key generation for deposits
Creative Commons Zero v1.0 Universal
537 stars 337 forks source link

Compilation error under GCC 14 #414

Open gus4rs opened 2 months ago

gus4rs commented 2 months ago

Linux F40 6.10.6-200.fc40.aarch64 (Fedora 40) gcc (GCC) 14.2.1 20240801 (Red Hat 14.2.1-1)

When doing pip3 install -r requirements.txt, it causes a C compilation error:

Building wheels for collected packages: lru-dict
  Building wheel for lru-dict (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for lru-dict (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      running bdist_wheel
      running build
      running build_ext
      building 'lru' extension
      creating build
      creating build/temp.linux-aarch64-cpython-310
      gcc -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fexceptions -fexceptions -fexceptions -fPIC -I/home/koinpeer/staking-deposit-cli/venv/include -I/usr/include/python3.10 -c lru.c -o build/temp.linux-aarch64-cpython-310/lru.o
      lru.c:629:17: error: initialization of ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} from incompatible pointer type ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} [-Wincompatible-pointer-types]
        629 |     {"popitem", (PyCFunctionWithKeywords)LRU_popitem, METH_VARARGS | METH_KEYWORDS,
            |                 ^
      lru.c:629:17: note: (near initialization for ‘LRU_methods[8].ml_meth’)
      error: command '/usr/lib64/ccache/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 lru-dict
Failed to build lru-dict
yorickdowne commented 2 months ago

@gus4rs Can I ask you to try this against our fork please. I don’t have a Fedora and am interested to know whether it’s working. We’ve updated all dependencies throughout, which may be good enough.

https://github.com/eth-educators/ethstaker-deposit-cli

gus4rs commented 2 months ago

The issue is some compiler warnings are now errors in GCC 14.x. I manage to "solve" the compilation problem by using

CFLAGS=-Wno-incompatible-pointer-types pip3 install -r requirements.txt

gus4rs commented 2 months ago

BTW, your branch works fine

yorickdowne commented 2 months ago

Thanks for testing that!