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

build error: incompatible pointer type #6320

Closed
julienmartinlevrai opened this issue May 26, 2024 · 7 comments
Closed

build error: incompatible pointer type #6320

julienmartinlevrai opened this issue May 26, 2024 · 7 comments

Comments

@julienmartinlevrai
Copy link

Description
When building from source, the command make -j4 nimbus_beacon_node fails with a compilation error in dependency nim-stint:

error: passing argument 4 of ‘_subborrow_u64’ from incompatible pointer type

To Reproduce
Just follow the normal steps to build from source:

$ git clone https://github.com/status-im/nimbus-eth2
$ cd nimbus-eth2/
$ make -j4 nimbus_beacon_node

Tested with v24.5.1, v24.5.0 and v24.4.0, all yield the same results.
Using up-to-date Arch Linux on a 2021 Intel NUC.

Results

$ make -j4 nimbus_beacon_node
Git submodules not found. Running 'git -c lfs.fetchexclude=/public-keys/all.txt,/custom_config_data/genesis.ssz submodule update --init --recursive'.
[omitting the rest of this git operation]

Building: install/usr/lib/libbacktrace.a
Building: Nim compiler
Building: install/usr/lib/libbacktracenim.a
Building: build/generate_makefile
Build completed successfully: build/generate_makefile
Building: build/nimbus_beacon_node
/root/bin/test/nimbus-eth2/vendor/nim-libp2p/libp2p/transports/tcptransport.nim(50, 57) template/generic instantiation of `async` from here
/root/bin/test/nimbus-eth2/vendor/nim-libp2p/libp2p/transports/tcptransport.nim(103, 10) template/generic instantiation of `setResult` from here
/root/bin/test/nimbus-eth2/vendor/nim-libp2p/libp2p/transports/tcptransport.nim(65, 20) template/generic instantiation of `async` from here
/root/bin/test/nimbus-eth2/vendor/nim-libp2p/libp2p/transports/tcptransport.nim(89, 25) template/generic instantiation of `error` from here
/root/bin/test/nimbus-eth2/vendor/nim-chronos/chronos/internal/raisesfutures.nim(241, 12) Warning: No exceptions possible with this operation, `error` always returns nil [User]
/root/bin/test/nimbus-eth2/vendor/nim-libp2p/libp2p/transports/tcptransport.nim(163, 36) template/generic instantiation of `async` from here
/root/bin/test/nimbus-eth2/vendor/nim-libp2p/libp2p/transports/tcptransport.nim(169, 17) template/generic instantiation of `checkFutures` from here
/root/bin/test/nimbus-eth2/vendor/nim-libp2p/libp2p/errors.nim(30, 24) template/generic instantiation of `readError` from here
/root/bin/test/nimbus-eth2/vendor/nim-chronos/chronos/internal/raisesfutures.nim(247, 12) Warning: No exceptions possible with this operation, `readError` always raises [User]
/root/bin/test/nimbus-eth2/beacon_chain/nimbus_beacon_node.nim(1935, 3) Warning: use exitprocs.addExitProc; addQuitProc is deprecated [Deprecated]
/root/bin/test/nimbus-eth2/beacon_chain/nimbus_beacon_node.nim(2152, 7) Warning: Please use MetricsHttpServerRef API; startMetricsHttpServer is deprecated [Deprecated]
/root/bin/test/nimbus-eth2/vendor/nim-stint/stint/private/primitives/addcarry_subborrow.nim: In function ‘_ZN18addcarry_subborrow4subBE3varI5uInt8E3varI6uInt64E6uInt646uInt645uInt8’:
/root/bin/test/nimbus-eth2/vendor/nim-stint/stint/private/primitives/addcarry_subborrow.nim:171:38: error: passing argument 4 of ‘_subborrow_u64’ from incompatible pointer type [-Wincompatible-pointer-types]
  171 |       bOut = subborrow_u64(bIn, a, b, diff)
      |                                      ^~~~
      |                                      |
      |                                      NU64 * {aka long unsigned int *}
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include/x86gprintrin.h:39,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include/x86intrin.h:27,
                 from /root/bin/test/nimbus-eth2/nimcache/release/nimbus_beacon_node/@m..@svendor@snimbus-build-system@svendor@sNim@slib@ssystem.nim.c:19:
/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include/adxintrin.h:59:61: note: expected ‘long long unsigned int *’ but argument is of type ‘NU64 *’ {aka ‘long unsigned int *’}
   59 |                 unsigned long long __Y, unsigned long long *__P)
      |                                         ~~~~~~~~~~~~~~~~~~~~^~~
make[1]: *** [nimcache/release/nimbus_beacon_node/nimbus_beacon_node.makefile:998: /root/bin/test/nimbus-eth2/nimcache/release/nimbus_beacon_node/@m..@svendor@snimbus-build-system@svendor@sNim@slib@ssystem.nim.c.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:447: nimbus_beacon_node] Error 2

Full, unmodified output: https://pastebin.com/SsqbBnn5

Additional context
v24.4.0 compiled well on my machine a few weeks ago when it was released. When I tried to compile v24.5.1 a few days ago, this compilation error happened, and after trying multiple things, I realized it was now happening on v24.4.0 as well. This might suggest the issue is on my side. However, this is a dedicated hardware for running a full node and not much else.

@tersec
Copy link
Contributor

tersec commented May 26, 2024

Yes, it's a gcc 14 incompatibility. status-im/nim-stint#153 resolves the nim-stint issue in isolation, but it's not the only part of this. We're working on resolving this.

@tersec
Copy link
Contributor

tersec commented Jun 21, 2024

The remaining issue here is the KZG library. The fix for that did not make it into the upcoming release (v24.6), so overall this still won't work, but the problem won't be nim-stint anymore.

Keeping issue open because it'll still be an incompatible pointer type error though.

@julienmartinlevrai
Copy link
Author

Indeed, the error persists on v24.6.0.

@tersec
Copy link
Contributor

tersec commented Jun 30, 2024

Basically two remaining steps:

It's plausible but not guaranteed that these will happen in time for v24.7.0. In theory everything necessary now exists, it's integrating and having enough time to test it.

@tersec
Copy link
Contributor

tersec commented Jul 3, 2024

#6403 fixes this, but refraining from closing this issue until we test it some more.

@tersec tersec closed this as completed Jul 4, 2024
@julienmartinlevrai
Copy link
Author

Unfortunately, the issue seems to persist on my side:

/root/bin/nimbus-eth2/vendor/nim-kzg4844/kzg4844/csources/bindings/nim/kzg.nim: In function ‘_ZN3kzg12verifyProofsE3refIN3kzg22KzgCtxcolonObjectType_EE9openArrayI5arrayI12range01310715uInt8EE9openArrayI5arrayI8range0475uInt8EE9openArrayI5arrayI8range0475uInt8EE’:
/root/bin/nimbus-eth2/vendor/nim-kzg4844/kzg4844/csources/bindings/nim/kzg.nim:201:46: error: passing argument 2 of ‘verify_blob_kzg_proof_batch’ from incompatible pointer type [-Wincompatible-pointer-types]
  201 |   let res = verify_blob_kzg_proof_batch(
      |                                              ^              
      |                                              |
      |                                              NU8 * {aka unsigned char *}

Full output: https://pastebin.com/RvstWPke

Please let me know if I should open a new issue or if you need anything else from me.

@tersec
Copy link
Contributor

tersec commented Jul 25, 2024

v24.6.0 doesn't support this, but v24.7.0 (imminent) will. The fix was applied, not released.

If you want to try this, check out the testing branch, run make update, and try again.

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

2 participants