canonical / dqlite

Embeddable, replicated and fault-tolerant SQL engine.
https://dqlite.io
Other
3.88k stars 216 forks source link

error: implicit declaration of function 'raft_heap_get' #436

Closed ganto closed 1 year ago

ganto commented 1 year ago

When trying to build the dqlite-1.12.0 tests on Fedora 35 I get the following error:

[...]
Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.4X98Y9
+ umask 022
+ cd /builddir/build/BUILD
+ cd dqlite-1.12.0
+ /usr/bin/make -O -j6 V=1 VERBOSE=1 check
/usr/bin/make  unit-test integration-test libtest.la
make[1]: Entering directory '/builddir/build/BUILD/dqlite-1.12.0'
[...]
make[1]: Leaving directory '/builddir/build/BUILD/dqlite-1.12.0'
test/lib/raft_heap.c: In function 'test_raft_heap_setup':
test/lib/raft_heap.c:73:28: error: implicit declaration of function 'raft_heap_get'; did you mean 'raft_heap_set'? [-Werror=implicit-function-declaration]
   73 |         faulty.orig_heap = raft_heap_get();
      |                            ^~~~~~~~~~~~~
      |                            raft_heap_set
test/lib/raft_heap.c:73:28: error: nested extern declaration of 'raft_heap_get' [-Werror=nested-externs]
test/lib/raft_heap.c:73:26: error: assignment to 'const struct raft_heap *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
   73 |         faulty.orig_heap = raft_heap_get();
      |                          ^
test/lib/raft_heap.c: In function 'test_raft_heap_tear_down':
test/lib/raft_heap.c:86:34: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   86 |         struct raft_heap *heap = (struct raft_heap *)raft_heap_get();
      |                                  ^
test/lib/raft_heap.c: At top level:
cc1: note: unrecognized command-line option '-Wno-unknown-warning-option' may have been intended to silence earlier diagnostics
cc1: all warnings being treated as errors
make[1]: *** [Makefile:1352: test/lib/libtest_la-raft_heap.lo] Error 1

Is this due to an "old" GCC version?

cole-miller commented 1 year ago

Which version of raft are you using? raft_heap_get is only exposed in the latest release, v0.16.0.

ganto commented 1 year ago

Ok, thanks. I haven't seen this version dependency being mentioned anywhere. Will try again with the latest raft.

cole-miller commented 1 year ago

Yes, I think our documentation on the corresponding dqlite release was lacking -- sorry about that. It's been updated to mention the dependency on raft v0.16.0.