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

21.2 fails to build from source #201

Open
kpcyrd opened this issue Aug 31, 2021 · 2 comments
Open

21.2 fails to build from source #201

kpcyrd opened this issue Aug 31, 2021 · 2 comments

Comments

@kpcyrd
Copy link
Member

kpcyrd commented Aug 31, 2021

The latest release fails to build for me due to this error:

[...]
  Compiling net/UpperDistributor_admin.c complete
  Compiling tunnel/RouteGen_admin.c complete
  Compiling tunnel/IpTunnel_admin.c complete
  Compiling net/SwitchPinger_admin.c complete
  Compiling util/log/IndirectLog.c complete
  Total build time: 5126ms.

  --- stderr
  /build/cjdns/src/cjdns-cjdns-v21.2/target/release/build/cjdns_sys-de25e409fea4fb5d/out/dependencies/libuv/build/gyp/pylib/gyp/input.py:1184: SyntaxWarning: "is" with a literal. Did you mean "=="?
    if the_dict_key is 'variables' and variable_name in the_dict:
  ../src/unix/linux-core.c: In function ‘uv__io_poll’:
  ../src/unix/linux-core.c:233:5: warning: converting a packed ‘struct uv__epoll_event’ pointer (alignment 1) to a ‘uv__io_t’ {aka ‘struct uv__io_s’} pointer (alignment 8) may result in an unaligned pointer value [-Waddress-of-packed-member]
    233 |     loop->watchers[loop->nwatchers] = (void*) events;
        |     ^~~~
  In file included from ../src/unix/internal.h:36,
                   from ../src/unix/linux-core.c:22:
  ../src/unix/linux-syscalls.h:93:8: note: defined here
     93 | struct uv__epoll_event {
        |        ^~~~~~~~~~~~~~~
  In file included from ../include/uv.h:60,
                   from ../src/unix/linux-core.c:21:
  ../include/uv-unix.h:71:8: note: defined here
     71 | struct uv__io_s {
        |        ^~~~~~~~
  /build/cjdns/src/cjdns-cjdns-v21.2/node_build/builder.js:1039
                      throw err;
                      ^

  Error: gcc -c -x cpp-output -o /build/cjdns/src/cjdns-cjdns-v21.2/target/release/build/cjdns_sys-de25e409fea4fb5d/out/util_platform_Sockaddr_c.o -std=c99 -Wall -Wextra -Werror -Wno-pointer-sign -Wmissing-prototypes -pedantic -D linux=1 -Wno-unused-parameter -fomit-frame-pointer -ffunction-sections -fdata-sections -D Log_DEBUG -g -D NumberCompress_TYPE=v3x5x8 -D Identity_CHECK=1 -D Allocator_USE_CANARIES=1 -D PARANOIA=1 -march=native -DHAS_ETH_INTERFACE=1 -fPIE -fdiagnostics-color=always -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -O2 -D_FORTIFY_SOURCE=2 -fno-stack-protector -fstack-protector-all -Wstack-protector -D CJD_PACKAGE_VERSION="unknown" /build/cjdns/src/cjdns-cjdns-v21.2/target/release/build/cjdns_sys-de25e409fea4fb5d/out/util_platform_Sockaddr_c.i

  util/platform/Sockaddr.c: In function ‘Sockaddr_fromBytes’:
  util/platform/Sockaddr.c:309:8: error: array subscript ‘struct Sockaddr_pvt[0]’ is partly outside array bounds of ‘unsigned char[36]’ [-Werror=array-bounds]
    309 |     out->pub.addrLen = addrLen + Sockaddr_OVERHEAD;
        |        ^~
  util/platform/Sockaddr.c:307:32: note: referencing an object of size between 24 and 36 allocated by ‘Allocator__calloc’
    307 |     struct Sockaddr_pvt* out = Allocator_calloc(alloc, addrLen + Sockaddr_OVERHEAD, 1);
        |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     
  cc1: all warnings being treated as errors

      at error (/build/cjdns/src/cjdns-cjdns-v21.2/node_build/builder.js:107:15)
      at /build/cjdns/src/cjdns-cjdns-v21.2/node_build/builder.js:188:29
      at /build/cjdns/src/cjdns-cjdns-v21.2/node_build/builder.js:153:17
      at ChildProcess.<anonymous> (/build/cjdns/src/cjdns-cjdns-v21.2/node_modules/saferphore/index.js:22:34)
      at ChildProcess.emit (node:events:394:28)
      at maybeClose (node:internal/child_process:1064:16)
      at Socket.<anonymous> (node:internal/child_process:450:11)
      at Socket.emit (node:events:394:28)
      at Pipe.<anonymous> (node:net:672:12)
  Error: Failed to build cjdns
warning: build failed, waiting for other jobs to finish...
error: build failed
==> ERROR: A failure occurred in build().
@skaldesh
Copy link

I have the exact same error, did you find a solution @kpcyrd ?

@skaldesh
Copy link

I fixed the compile error by replacing line 309 in util/platform/Sockaddr.c with

struct Sockaddr* pub = &out->pub;
pub->addrLen = addrLen + Sockaddr_OVERHEAD;

Could then successfully complete build

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