codex-storage / nim-codex

Decentralized Durability Engine
https://codex.storage
Apache License 2.0
69 stars 25 forks source link

[BUG] Master does not compile on Linux #957

Closed schoedon closed 1 month ago

schoedon commented 1 month ago

Describe the bug Cannot build codex from source.

To Reproduce Steps to reproduce the behavior:

  1. Go to build#linux
  2. Clone repository
  3. Run make udate
  4. Run make
  5. See error: passing argument 1 of ‘br_prng_seeder_system’ from incompatible pointer type [-Wincompatible-pointer-types]

Expected behavior This section should be removed from the BUG template.

Screenshots

[...]
/home/user/.src/codex-storage/nim-codex/vendor/nim-presto/presto/server.nim(41, 28) Warning: Callback could raise only CancelledError, annotate with {.async: (raises: [CancelledError]).}; new is deprecated [Deprecated]
/home/user/.src/codex-storage/nim-codex/codex.nim(31, 13) Warning: imported and not used: 'sequtils' [UnusedImport]
/home/user/.src/codex-storage/nim-codex/vendor/nim-bearssl/bearssl/rand.nim: In function ‘_ZN4rand3newE8typeDescIN12bearssl_rand15HmacDrbgContextEE’:
/home/user/.src/codex-storage/nim-codex/vendor/nim-bearssl/bearssl/rand.nim:35:34: error: passing argument 1 of ‘br_prng_seeder_system’ from incompatible pointer type [-Wincompatible-pointer-types]
   35 |   let seeder = prngSeederSystem(nil)
      |                                 ~^~~                 
      |                                  |
      |                                  char **
In file included from /home/user/.src/codex-storage/nim-codex/nimcache/release/codex/@mvendor@snim-bearssl@sbearssl@srand.nim.c:8:
/home/user/.src/codex-storage/nim-codex/vendor/nim-bearssl/bearssl/abi/../csources/inc/bearssl_rand.h:318:51: note: expected ‘const char **’ but argument is of type ‘char **’
  318 | br_prng_seeder br_prng_seeder_system(const char **name);
      |                                      ~~~~~~~~~~~~~^~~~
Error: execution of an external compiler program 'gcc -c  -w -fmax-errors=3 -pthread -I/home/user/.src/codex-storage/nim-codex/vendor/nim-libbacktrace -I/home/user/.src/codex-storage/nim-codex/vendor/nim-libbacktrace/install/usr/include -I/home/user/.src/codex-storage/nim-codex/vendor/nim-bearssl/bearssl/abi/../csources/src/ -I/home/user/.src/codex-storage/nim-codex/vendor/nim-bearssl/bearssl/abi/../csources/inc/ -I/home/user/.src/codex-storage/nim-codex/vendor/nim-bearssl/bearssl/abi/../csources/tools/ -DBR_USE_UNIX_TIME=1 -DBR_USE_URANDOM=1 -DBR_LE_UNALIGNED=1 -DBR_64=1  -DBR_amd64=1 -DBR_INT128=1 -I/home/user/.src/codex-storage/nim-codex/vendor/nim-zlib/zlib/csources -DHAVE_UNISTD_H -DSQLITE_ENABLE_COLUMN_METADATA -DLEVELDB_PLATFORM_POSIX -I/home/user/.src/codex-storage/nim-codex/vendor/nim-leveldbstatic/vendor -I/home/user/.src/codex-storage/nim-codex/vendor/nim-leveldbstatic/vendor/helpers -I/home/user/.src/codex-storage/nim-codex/vendor/nim-leveldbstatic/vendor/helpers/memenv -I/home/user/.src/codex-storage/nim-codex/vendor/nim-leveldbstatic/vendor/port -I/home/user/.src/codex-storage/nim-codex/vendor/nim-leveldbstatic/vendor/include -I/home/user/.src/codex-storage/nim-codex/vendor/nim-leopard/vendor/leopard -fopenmp -march=native -g3 -Og -O3 -fno-strict-aliasing -fno-ident   -I/home/user/.src/codex-storage/nim-codex/vendor/nimbus-build-system/vendor/Nim/lib -I/home/user/.src/codex-storage/nim-codex -o /home/user/.src/codex-storage/nim-codex/nimcache/release/codex/@mvendor@snim-bearssl@sbearssl@srand.nim.c.o /home/user/.src/codex-storage/nim-codex/nimcache/release/codex/@mvendor@snim-bearssl@sbearssl@srand.nim.c' failed with exit code: 1

stack trace: (most recent call last)
nimscript.nim(429, 18)
build.nims(30, 15)       codexTask
build.nims(23, 7)        buildBinary
nimscript.nim(273, 7)    exec
/home/user/.src/codex-storage/nim-codex/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(273, 7) Error: unhandled exception: FAILED: nim c --out:build/codex -d:chronicles_runtime_filtering -d:chronicles_log_level=TRACE --verbosity:0 --hints:off -d:release ./codex.nim [OSError]
make: *** [Makefile:74: all] Error 1

/home/user/.src/codex-storage/nim-codex/vendor/constantine/constantine/platforms/intrinsics/addcarry_subborrow.nim: In function ‘_ZN18addcarry_subborrow4subBE3varI2CtI5uInt8EE3varI2CtI6uInt64EE2CtI6uInt64E2CtI6uInt64E2CtI5uInt8E’:
/home/user/.src/codex-storage/nim-codex/vendor/constantine/constantine/platforms/intrinsics/addcarry_subborrow.nim:153:38: error: passing argument 4 of ‘_subborrow_u64’ from incompatible pointer type [-Wincompatible-pointer-types]
  153 |     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.2.1/include/x86gprintrin.h:39,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/include/x86intrin.h:27,
                 from /home/user/.src/codex-storage/nim-codex/nimcache/release/codex/@mvendor@sconstantine@sconstantine@smath@sarithmetic@slimbs_montgomery.nim.c:9:
/usr/lib/gcc/x86_64-pc-linux-gnu/14.2.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)
      |                                         ~~~~~~~~~~~~~~~~~~~~^~~
/home/user/.src/codex-storage/nim-codex/vendor/constantine/constantine/platforms/intrinsics/addcarry_subborrow.nim: In function ‘_ZN18addcarry_subborrow4addCE3varI2CtI5uInt8EE3varI2CtI6uInt64EE2CtI6uInt64E2CtI6uInt64E2CtI5uInt8E’:
/home/user/.src/codex-storage/nim-codex/vendor/constantine/constantine/platforms/intrinsics/addcarry_subborrow.nim:131:37: error: passing argument 4 of ‘_addcarry_u64’ from incompatible pointer type [-Wincompatible-pointer-types]
  131 |     cOut = addcarry_u64(cIn, a, b, sum)
      |                                     ^~~
      |                                     |
      |                                     NU64 * {aka long unsigned int *}
/usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/include/adxintrin.h:67:60: note: expected ‘long long unsigned int *’ but argument is of type ‘NU64 *’ {aka ‘long unsigned int *’}
   67 |                unsigned long long __Y, unsigned long long *__P)
      |                                        ~~~~~~~~~~~~~~~~~~~~^~~
/home/user/.src/codex-storage/nim-codex/vendor/constantine/constantine/platforms/intrinsics/addcarry_subborrow.nim: In function ‘_ZN18addcarry_subborrow4subBE3varI2CtI5uInt8EE3varI2CtI6uInt64EE2CtI6uInt64E2CtI6uInt64E2CtI5uInt8E’:
/home/user/.src/codex-storage/nim-codex/vendor/constantine/constantine/platforms/intrinsics/addcarry_subborrow.nim:153:38: error: passing argument 4 of ‘_subborrow_u64’ from incompatible pointer type [-Wincompatible-pointer-types]
  153 |     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.2.1/include/x86gprintrin.h:39,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/include/x86intrin.h:27,
                 from /home/user/.src/codex-storage/nim-codex/nimcache/release/codex/@mvendor@snim-poseidon2@sposeidon2@sio.nim.c:9:
/usr/lib/gcc/x86_64-pc-linux-gnu/14.2.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)
      |                                         ~~~~~~~~~~~~~~~~~~~~^~~
/home/user/.src/codex-storage/nim-codex/vendor/constantine/constantine/platforms/intrinsics/addcarry_subborrow.nim: In function ‘_ZN18addcarry_subborrow4addCE3varI2CtI5uInt8EE3varI2CtI6uInt64EE2CtI6uInt64E2CtI6uInt64E2CtI5uInt8E’:
/home/user/.src/codex-storage/nim-codex/vendor/constantine/constantine/platforms/intrinsics/addcarry_subborrow.nim:131:37: error: passing argument 4 of ‘_addcarry_u64’ from incompatible pointer type [-Wincompatible-pointer-types]
  131 |     cOut = addcarry_u64(cIn, a, b, sum)
      |                                     ^~~
      |                                     |
      |                                     NU64 * {aka long unsigned int *}
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/include/x86gprintrin.h:39,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/include/x86intrin.h:27,
                 from /home/user/.src/codex-storage/nim-codex/nimcache/release/codex/@mvendor@snim-poseidon2@sposeidon2@ssponge.nim.c:9:
/usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/include/adxintrin.h:67:60: note: expected ‘long long unsigned int *’ but argument is of type ‘NU64 *’ {aka ‘long unsigned int *’}
   67 |                unsigned long long __Y, unsigned long long *__P)
      |                                        ~~~~~~~~~~~~~~~~~~~~^~~
/home/user/.src/codex-storage/nim-codex/vendor/constantine/constantine/platforms/intrinsics/addcarry_subborrow.nim: In function ‘_ZN18addcarry_subborrow4subBE3varI2CtI5uInt8EE3varI2CtI6uInt64EE2CtI6uInt64E2CtI6uInt64E2CtI5uInt8E’:
/home/user/.src/codex-storage/nim-codex/vendor/constantine/constantine/platforms/intrinsics/addcarry_subborrow.nim:153:38: error: passing argument 4 of ‘_subborrow_u64’ from incompatible pointer type [-Wincompatible-pointer-types]
  153 |     bOut = subborrow_u64(bIn, a, b, diff)
      |                                      ^~~~
      |                                      |
      |                                      NU64 * {aka long unsigned int *}
/usr/lib/gcc/x86_64-pc-linux-gnu/14.2.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)
      |                                         ~~~~~~~~~~~~~~~~~~~~^~~
/home/user/.src/codex-storage/nim-codex/vendor/constantine/constantine/platforms/intrinsics/addcarry_subborrow.nim: In function ‘_ZN18addcarry_subborrow4addCE3varI2CtI5uInt8EE3varI2CtI6uInt64EE2CtI6uInt64E2CtI6uInt64E2CtI5uInt8E’:
/home/user/.src/codex-storage/nim-codex/vendor/constantine/constantine/platforms/intrinsics/addcarry_subborrow.nim:131:37: error: passing argument 4 of ‘_addcarry_u64’ from incompatible pointer type [-Wincompatible-pointer-types]
  131 |     cOut = addcarry_u64(cIn, a, b, sum)
      |                                     ^~~
      |                                     |
      |                                     NU64 * {aka long unsigned int *}
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/include/x86gprintrin.h:39,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/include/x86intrin.h:27,
                 from /home/user/.src/codex-storage/nim-codex/nimcache/release/codex/@mvendor@snim-poseidon2@sposeidon2@sroundfun.nim.c:9:
/usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/include/adxintrin.h:67:60: note: expected ‘long long unsigned int *’ but argument is of type ‘NU64 *’ {aka ‘long unsigned int *’}
   67 |                unsigned long long __Y, unsigned long long *__P)
      |                                        ~~~~~~~~~~~~~~~~~~~~^~~
/home/user/.src/codex-storage/nim-codex/vendor/constantine/constantine/platforms/intrinsics/addcarry_subborrow.nim: In function ‘_ZN18addcarry_subborrow4subBE3varI2CtI5uInt8EE3varI2CtI6uInt64EE2CtI6uInt64E2CtI6uInt64E2CtI5uInt8E’:
/home/user/.src/codex-storage/nim-codex/vendor/constantine/constantine/platforms/intrinsics/addcarry_subborrow.nim:153:38: error: passing argument 4 of ‘_subborrow_u64’ from incompatible pointer type [-Wincompatible-pointer-types]
  153 |     bOut = subborrow_u64(bIn, a, b, diff)
      |                                      ^~~~
      |                                      |
      |                                      NU64 * {aka long unsigned int *}
/usr/lib/gcc/x86_64-pc-linux-gnu/14.2.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)
      |                                         ~~~~~~~~~~~~~~~~~~~~^~~

Environment:

Additional context Add any other context about the problem here.

veaceslavdoina commented 1 month ago

Can you please check your gcc version (#875)

gcc --version
schoedon commented 1 month ago

Yes

gcc (GCC) 14.2.1 20240910
veaceslavdoina commented 1 month ago

It is a known issue and we have a note about it in the docs as well - Known issues.

So, work is still in progress.

schoedon commented 1 month ago

Got it. Duplicate of #875