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

Building on MacOs fails #87

Closed
nzedler opened this issue Aug 19, 2024 · 3 comments
Closed

Building on MacOs fails #87

nzedler opened this issue Aug 19, 2024 · 3 comments

Comments

@nzedler
Copy link

nzedler commented Aug 19, 2024

Following the build instruction on Building from source on MacOS fails. The missing npm install command was executed.

I'm running the supported Node version v20.16.0 on a Apple Macbook Pro M1 with 16GB RAM on macOS Sonoma 14.5.

This is the trace log:

❯ npm run build


> @openziti/[email protected] build
> npm run build:init && npm run build:configure && npm run build:make


> @openziti/[email protected] build:init
> git submodule update --init --recursive

Submodule 'deps/ziti-sdk-c' (https://github.com/openziti/ziti-sdk-c) registered for path 'deps/ziti-sdk-c'
Cloning into '/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c'...
Submodule path 'deps/ziti-sdk-c': checked out 'd336721a77f5ab4b50b031d592d581856524c6f3'

> @openziti/[email protected] build:configure
> run-script-os


> @openziti/[email protected] build:configure:linux:darwin
> ./configure

info TOOL Using Ninja generator, because ninja is available.
info CMD CONFIGURE
info RUN [
info RUN   'cmake',
info RUN   '/Users/nzedler/ziti-sdk-nodejs',
info RUN   '--no-warn-unused-cli',
info RUN   '-G',
info RUN   'Ninja',
info RUN   '-DCMAKE_JS_VERSION=7.2.1',
info RUN   '-DCMAKE_BUILD_TYPE=Release',
info RUN   '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/nzedler/ziti-sdk-nodejs/build/Release',
info RUN   '-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>',
info RUN   '-DCMAKE_JS_INC=/Users/nzedler/.cmake-js/node-arm64/v20.16.0/include/node',
info RUN   '-DCMAKE_JS_SRC=',
info RUN   '-DNODE_RUNTIME=node',
info RUN   '-DNODE_RUNTIMEVERSION=20.16.0',
info RUN   '-DNODE_ARCH=arm64',
info RUN   '-DCMAKE_OSX_ARCHITECTURES=arm64',
info RUN   '-DCMAKE_JS_LIB=',
info RUN   '-DCMAKE_CXX_FLAGS=-D_DARWIN_USE_64_BIT_INODE=1 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DBUILDING_NODE_EXTENSION',
info RUN   '-DCMAKE_SHARED_LINKER_FLAGS=-undefined dynamic_lookup',
info RUN   '--preset=base'
info RUN ]
Not searching for unused variables given on the command line.
Preset CMake variables:

  CMAKE_CXX_EXTENSIONS="OFF"
  CMAKE_CXX_STANDARD="11"
  CMAKE_CXX_STANDARD_REQUIRED="ON"
  CMAKE_C_EXTENSIONS="ON"
  CMAKE_C_STANDARD="99"
  CMAKE_C_STANDARD_REQUIRED="ON"
  CMAKE_TOOLCHAIN_FILE="/Users/nzedler/vcpkg/scripts/buildsystems/vcpkg.cmake"

-- Found Git: /usr/bin/git (found version "2.39.3 (Apple Git-146)")
branch: main/d88eb31
-- Running vcpkg install
Detecting compiler hash for triplet arm64-osx...
Compiler found: /Library/Developer/CommandLineTools/usr/bin/c++
The following packages will be built and installed:
    json-c:arm64-osx@2022-06-26#3 -- /Users/nzedler/vcpkg/buildtrees/versioning_/versions/json-c/787ad6eeafc631bea9f68c3ad2047a031575bb0f
    libsodium:[email protected]#9 -- /Users/nzedler/vcpkg/buildtrees/versioning_/versions/libsodium/6c75abf2ec95a8c9b498d2e18e9f854d75941048
    libuv:[email protected]#1 -- /Users/nzedler/vcpkg/buildtrees/versioning_/versions/libuv/2267bb7c14ae2201b02e2d708631e4a228355543
    llhttp:[email protected] -- /Users/nzedler/vcpkg/buildtrees/versioning_/versions/llhttp/3422384dc0ec7e58827c138826bb666efe850eaa
    openssl:[email protected]#1 -- /Users/nzedler/vcpkg/buildtrees/versioning_/versions/openssl/5ee74387a1dd212dc9754c614809ff86bd0638fa
  * protobuf:[email protected] -- /Users/nzedler/vcpkg/buildtrees/versioning_/versions/protobuf/3b145508ba614fe26989b23f6317f15bf6467be4
    protobuf-c:[email protected]#1 -- /Users/nzedler/vcpkg/buildtrees/versioning_/versions/protobuf-c/32d120b5b3a9225b973b135f632ee82be3e7860b
  * vcpkg-cmake:arm64-osx@2023-05-04 -- /Users/nzedler/vcpkg/buildtrees/versioning_/versions/vcpkg-cmake/88a7058fc7fa73a9c4c99cfcae9d79e2abf87a5a
  * vcpkg-cmake-config:arm64-osx@2022-02-06#1 -- /Users/nzedler/vcpkg/buildtrees/versioning_/versions/vcpkg-cmake-config/8d54cc4f487d51b655abec5f9c9c3f86ca83311f
  * vcpkg-cmake-get-vars:arm64-osx@2023-03-02 -- /Users/nzedler/vcpkg/buildtrees/versioning_/versions/vcpkg-cmake-get-vars/2e624c2cf12a97a7a802e31ff1d28b9fa6ba9bde
    zlib:[email protected] -- /Users/nzedler/vcpkg/buildtrees/versioning_/versions/zlib/5ac18c6e6e3e2bf5a9e3d0bc8a845f198e4c4e05
Additional packages (*) will be modified to complete this operation.
Restored 11 package(s) from /Users/nzedler/.cache/vcpkg/archives in 1.2 s. Use --debug to see more details.
Installing 1/11 vcpkg-cmake-config:arm64-osx@2022-02-06#1...
Elapsed time to handle vcpkg-cmake-config:arm64-osx: 2.31 ms
vcpkg-cmake-config:arm64-osx package ABI: 702baeebff2729b728ff05f6179013373716d9b61ce5717f0558bcc378f73bc4
Installing 2/11 vcpkg-cmake:arm64-osx@2023-05-04...
Elapsed time to handle vcpkg-cmake:arm64-osx: 2.03 ms
vcpkg-cmake:arm64-osx package ABI: e1ea09369709bbb272ef1e7bb59908b19241e3da28358a11740d1f5f95160aee
Installing 3/11 json-c:arm64-osx@2022-06-26#3...
Elapsed time to handle json-c:arm64-osx: 6.34 ms
json-c:arm64-osx package ABI: b2740ca03db1a82b4796a5ddeb6d65608770c6d345f8766b84ee611c002dbeb5
Installing 4/11 libsodium:[email protected]#9...
Elapsed time to handle libsodium:arm64-osx: 17.5 ms
libsodium:arm64-osx package ABI: 1c36c32d0bc77a5b7fb35adb3bbb3e02a0435f82dfad41d35ce505a1369e7ebd
Installing 5/11 libuv:[email protected]#1...
Elapsed time to handle libuv:arm64-osx: 6.46 ms
libuv:arm64-osx package ABI: f2b4722cd1caad312b9e9d0fd204295c95264cbe51190a7778ef0e48d6e807f3
Installing 6/11 llhttp:[email protected]...
Elapsed time to handle llhttp:arm64-osx: 3.26 ms
llhttp:arm64-osx package ABI: 608b84e87566390ceff83c363f47507f2aeb035794f974cac5816c11ea39e7aa
Installing 7/11 vcpkg-cmake-get-vars:arm64-osx@2023-03-02...
Elapsed time to handle vcpkg-cmake-get-vars:arm64-osx: 2.12 ms
vcpkg-cmake-get-vars:arm64-osx package ABI: bc734c783d1f71504a715386b117aed9c34306aace7a362e8245a7d5904452aa
Installing 8/11 openssl:[email protected]#1...
Elapsed time to handle openssl:arm64-osx: 33.2 ms
openssl:arm64-osx package ABI: 3e4917cf8b18ecc578798521fab2654ba4de0693b70d000bd96d78236750aae2
Installing 9/11 protobuf:[email protected]...
Elapsed time to handle protobuf:arm64-osx: 32.8 ms
protobuf:arm64-osx package ABI: f802122d68f1010768ae98dc1867fd75bcb7bf7773f102888209da147baa6b02
Installing 10/11 protobuf-c:[email protected]#1...
Elapsed time to handle protobuf-c:arm64-osx: 3.91 ms
protobuf-c:arm64-osx package ABI: c205ff7fbdd6486be6c9f3388deb2a96bc88fe16302234c8ea665c10de3153c4
Installing 11/11 zlib:[email protected]...
Elapsed time to handle zlib:arm64-osx: 3.57 ms
zlib:arm64-osx package ABI: 45506668794a255cbe8dfe754f02a4e8b57794820bfccf4477a8aca3adf755a1
Total install time: 114 ms
json-c provides CMake targets:

  # this is heuristically generated, and may not be correct
  find_package(json-c CONFIG REQUIRED)
  target_link_libraries(main PRIVATE json-c::json-c)

json-c provides pkg-config modules:

  # A JSON implementation in C
  json-c

libsodium provides CMake targets:

  # this is heuristically generated, and may not be correct
  find_package(unofficial-sodium CONFIG REQUIRED)
  target_link_libraries(main PRIVATE unofficial-sodium::sodium unofficial-sodium::sodium_config_public)

libsodium provides pkg-config modules:

  # A modern and easy-to-use crypto library
  libsodium

libuv provides CMake targets:

    find_package(libuv CONFIG REQUIRED)
    target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:libuv::uv_a>,libuv::uv_a,libuv::uv>)

llhttp provides CMake targets:

  # this is heuristically generated, and may not be correct
  find_package(llhttp CONFIG REQUIRED)
  target_link_libraries(main PRIVATE llhttp::llhttp_static)

llhttp provides pkg-config modules:

  # Node.js llhttp Library
  libllhttp

The package openssl is compatible with built-in CMake targets:

    find_package(OpenSSL REQUIRED)
    target_link_libraries(main PRIVATE OpenSSL::SSL OpenSSL::Crypto)

protobuf-c provides pkg-config modules:

  # Protocol Buffers implementation in C
  libprotobuf-c

The package zlib is compatible with built-in CMake targets:

    find_package(ZLIB REQUIRED)
    target_link_libraries(main PRIVATE ZLIB::ZLIB)

-- Running vcpkg install - done
-- The C compiler identification is AppleClang 15.0.0.15000309
-- The CXX compiler identification is AppleClang 15.0.0.15000309
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
project version: 0.36.9
git info:
   branch : HEAD
     hash : d336721
	  date : 2024-08-19T16:10:45Z

using Ninja
cross-compiling FALSE
Project: [email protected]
-- Found ZLIB: optimized;/Users/nzedler/ziti-sdk-nodejs/build/vcpkg_installed/arm64-osx/lib/libz.a;debug;/Users/nzedler/ziti-sdk-nodejs/build/vcpkg_installed/arm64-osx/debug/lib/libz.a (found version "1.3.0")
-- Found OpenSSL: /Users/nzedler/ziti-sdk-nodejs/build/vcpkg_installed/arm64-osx/lib/libcrypto.a (found version "3.1.4")
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.30.2/share/cmake/Modules/FetchContent.cmake:1953 (message):
  Calling FetchContent_Populate(subcommand) is deprecated, call
  FetchContent_MakeAvailable(subcommand) instead.  Policy CMP0169 can be set
  to OLD to allow FetchContent_Populate(subcommand) to be called directly for
  now, but the ability to call it with declared details will be removed
  completely in a future version.
Call Stack (most recent call first):
  deps/ziti-sdk-c/deps/CMakeLists.txt:23 (FetchContent_Populate)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
sodium is /Users/nzedler/ziti-sdk-nodejs/build/vcpkg_installed/arm64-osx/debug/lib/libsodium.a
-- Checking for module 'libprotobuf-c'
--   Found libprotobuf-c, version 1.4.1
-- Configuring done (7.1s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/nzedler/ziti-sdk-nodejs/build

> @openziti/[email protected] build:make
> cmake-js build

info TOOL Using Ninja generator, because ninja is available.
info CMD BUILD
info RUN [
info RUN   'cmake',
info RUN   '--build',
info RUN   '/Users/nzedler/ziti-sdk-nodejs/build',
info RUN   '--config',
info RUN   'Release'
info RUN ]
[21/67] Building C object deps/ziti-sd...ry/CMakeFiles/ziti.dir/ziti_enroll.c.o
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/ziti_enroll.c:107:23: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        ecfg->raw_jwt = opts->jwt_content;
                      ^ ~~~~~~~~~~~~~~~~~
1 warning generated.
[24/67] Building C object deps/ziti-sd...ibrary/CMakeFiles/ziti.dir/message.c.o
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/message.c:101:30: warning: assigning to 'uint8_t *' (aka 'unsigned char *') from 'const uint8_t *' (aka 'const unsigned char *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        headers[count].value = p;
                             ^ ~
1 warning generated.
[29/67] Building C object deps/ziti-sd...rary/CMakeFiles/ziti.dir/ziti_ctrl.c.o
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/ziti_ctrl.c:512:25: warning: initializing 'string' (aka 'char *') with an expression of type 'const char *const' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
                .code = ERROR_CODE_UNAUTHORIZED,
                        ^~~~~~~~~~~~~~~~~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/ziti_ctrl.c:513:28: warning: initializing 'string' (aka 'char *') with an expression of type 'const char *const' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
                .message = ERROR_MSG_NO_API_SESSION_TOKEN,
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/ziti_ctrl.c:677:41: warning: initializing 'string' (aka 'char *') with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
            ziti_identity id = {.name = name};
                                        ^~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/ziti_ctrl.c:808:32: warning: assigning to 'string' (aka 'char *') from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    extend_req.client_cert_csr = csr;
                               ^ ~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/ziti_ctrl.c:827:28: warning: assigning to 'string' (aka 'char *') from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    verify_req.client_cert = client_cert;
                           ^ ~~~~~~~~~~~
5 warnings generated.
[30/67] Building C object deps/ziti-sd...ibrary/CMakeFiles/ziti.dir/channel.c.o
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/channel.c:189:36: warning: passing 'const char *' to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        model_list_append(&ch_ids, model_map_it_key(it));
                                   ^~~~~~~~~~~~~~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../includes/ziti/model_collections.h:93:55: note: passing argument to parameter 'el' here
ZITI_FUNC void model_list_append(model_list *l, void *el);
                                                      ^
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/channel.c:666:18: warning: initializing 'uint8_t *' (aka 'unsigned char *') with an expression of type 'char[10]' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
        uint8_t *erVersion = "<unknown>";
                 ^           ~~~~~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/channel.c:667:38: warning: passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
        size_t erVersionLen = strlen(erVersion);
                                     ^~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include/string.h:82:28: note: passing argument to parameter '__s' here
size_t   strlen(const char *__s);
                            ^
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/channel.c:672:31: warning: passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
        ch->version = strndup(erVersion, erVersionLen);
                              ^~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include/string.h:132:27: note: passing argument to parameter '__s1' here
char    *strndup(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
                             ^
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/channel.c:703:71: warning: passing 'char[37]' to parameter of type 'const uint8_t *' (aka 'const unsigned char *') converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    ziti_channel_send_for_reply(ch, ContentTypeHelloType, headers, 2, ch->token, strlen(ch->token), hello_reply_cb, ch);
                                                                      ^~~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/channel.c:426:61: note: passing argument to parameter 'body' here
                                             const uint8_t *body, uint32_t body_len,
                                                            ^
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/channel.c:877:37: warning: passing 'char *const' to parameter of type 'uint8_t *' (aka 'unsigned char *') converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
        buffer_append(ch->incoming, buf->base, (uint32_t) len);
                                    ^~~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../inc_internal/buffer.h:45:39: note: passing argument to parameter 'buf' here
void buffer_append(buffer *, uint8_t *buf, size_t len);
                                      ^
6 warnings generated.
[37/67] Building C object deps/ziti-sd...ry/CMakeFiles/ziti.dir/conn_bridge.c.o
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/conn_bridge.c:364:39: warning: passing 'char *const' to parameter of type 'uint8_t *' (aka 'unsigned char *') converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
        int rc = ziti_write(br->conn, b->base, len, on_ziti_write, b->base);
                                      ^~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../includes/ziti/ziti.h:819:54: note: passing argument to parameter 'data' here
extern int ziti_write(ziti_connection conn, uint8_t *data, size_t length, ziti_write_cb write_cb, void *write_ctx);
                                                     ^
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/conn_bridge.c:392:39: warning: passing 'char *const' to parameter of type 'uint8_t *' (aka 'unsigned char *') converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
        int rc = ziti_write(br->conn, b->base, len, on_ziti_write, b->base);
                                      ^~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../includes/ziti/ziti.h:819:54: note: passing argument to parameter 'data' here
extern int ziti_write(ziti_connection conn, uint8_t *data, size_t length, ziti_write_cb write_cb, void *write_ctx);
                                                     ^
2 warnings generated.
[39/67] Building C object deps/ziti-sd.../CMakeFiles/ziti.dir/model_support.c.o
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/model_support.c:902:54: warning: format specifies type 'long *' but the argument has type '__darwin_suseconds_t *' (aka 'int *') [-Wformat]
                &t2.tm_hour, &t2.tm_min, &t2.tm_sec, &t->tv_usec);
                                                     ^~~~~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/model_support.c:1082:60: warning: format specifies type 'long' but the argument has type '__darwin_suseconds_t' (aka 'int') [-Wformat]
                      tm2.tm_hour, tm2.tm_min, tm2.tm_sec, t->tv_usec);
                                                           ^~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include/secure/_stdio.h:57:62: note: expanded from macro 'snprintf'
  __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
                                                             ^~~~~~~~~~~
2 warnings generated.
[41/67] Building C object deps/ziti-sd...ibrary/CMakeFiles/ziti.dir/connect.c.o
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/connect.c:565:59: warning: passing 'char[6]' to parameter of type 'const unsigned char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    sodium_bin2base64(conn->marker, sizeof(conn->marker), marker, sizeof(marker),
                                                          ^~~~~~
/Users/nzedler/ziti-sdk-nodejs/build/vcpkg_installed/arm64-osx/include/sodium/utils.h:90:53: note: passing argument to parameter 'bin' here
                        const unsigned char * const bin, const size_t bin_len,
                                                    ^
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/connect.c:1091:47: warning: passing 'string' (aka 'char *') to parameter of type 'const uint8_t *' (aka 'const unsigned char *') converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
                                              session->token, strlen(session->token),
                                              ^~~~~~~~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../inc_internal/zt_internal.h:361:115: note: passing argument to parameter 'body' here
ziti_channel_send_for_reply(ziti_channel_t *ch, uint32_t content, const hdr_t *headers, int nhdrs, const uint8_t *body,
                                                                                                                  ^
2 warnings generated.
[43/67] Building C object deps/ziti-sd...ibrary/CMakeFiles/ziti.dir/zitilib.c.o
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/zitilib.c:275:31: warning: incompatible pointer types passing 'ziti_context *' (aka 'struct ziti_ctx **') to parameter of type 'void **' [-Wincompatible-pointer-types]
    int err = await_future(f, &ztx);
                              ^~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/util/future.h:26:38: note: passing argument to parameter 'result' here
int await_future(future_t *f, void **result);
                                     ^
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/zitilib.c:644:29: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
                .identity = req->terminator,
                            ^~~~~~~~~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/zitilib.c:857:29: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
                .identity = req->terminator,
                            ^~~~~~~~~~~~~~~
3 warnings generated.
[44/67] Building C object deps/ziti-sd...CMakeFiles/ziti.dir/internal_model.c.o
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/internal_model.c:401:5: warning: passing 'const model_list *' (aka 'const struct model_list_s *') to parameter of type 'model_list *' (aka 'struct model_list_s *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    MODEL_LIST_FOREACH(range_addr, *range) {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../includes/ziti/model_collections.h:112:83: note: expanded from macro 'MODEL_LIST_FOREACH'
#define MODEL_LIST_FOREACH(el, list) for(model_list_iter it = model_list_iterator(&(list)); \
                                                                                  ^~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../includes/ziti/model_collections.h:102:59: note: passing argument to parameter 'l' here
ZITI_FUNC model_list_iter model_list_iterator(model_list *l);
                                                          ^
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/internal_model.c:443:5: warning: passing 'const model_list *' (aka 'const struct model_list_s *') to parameter of type 'model_list *' (aka 'struct model_list_s *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    MODEL_LIST_FOREACH(p, *proto_list) {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../includes/ziti/model_collections.h:112:83: note: expanded from macro 'MODEL_LIST_FOREACH'
#define MODEL_LIST_FOREACH(el, list) for(model_list_iter it = model_list_iterator(&(list)); \
                                                                                  ^~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../includes/ziti/model_collections.h:102:59: note: passing argument to parameter 'l' here
ZITI_FUNC model_list_iter model_list_iterator(model_list *l);
                                                          ^
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/internal_model.c:454:5: warning: passing 'const model_list *' (aka 'const struct model_list_s *') to parameter of type 'model_list *' (aka 'struct model_list_s *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    MODEL_LIST_FOREACH(p, *port_range_list) {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../includes/ziti/model_collections.h:112:83: note: expanded from macro 'MODEL_LIST_FOREACH'
#define MODEL_LIST_FOREACH(el, list) for(model_list_iter it = model_list_iterator(&(list)); \
                                                                                  ^~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../includes/ziti/model_collections.h:102:59: note: passing argument to parameter 'l' here
ZITI_FUNC model_list_iter model_list_iterator(model_list *l);
                                                          ^
3 warnings generated.
[46/67] Building C object deps/ziti-sdk-c/library/CMakeFiles/ziti.dir/bind.c.o
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/bind.c:309:57: warning: passing 'char[32]' to parameter of type 'const unsigned char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    sodium_bin2base64(listener_id, sizeof(listener_id), conn->server.listener_id, sizeof(conn->server.listener_id), sodium_base64_VARIANT_URLSAFE);
                                                        ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/build/vcpkg_installed/arm64-osx/include/sodium/utils.h:90:53: note: passing argument to parameter 'bin' here
                        const unsigned char * const bin, const size_t bin_len,
                                                    ^
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/bind.c:513:45: warning: passing 'string' (aka 'char *') to parameter of type 'const uint8_t *' (aka 'const unsigned char *') converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
                                            s->token, strlen(s->token), bind_reply_cb,
                                            ^~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../inc_internal/zt_internal.h:361:115: note: passing argument to parameter 'body' here
ziti_channel_send_for_reply(ziti_channel_t *ch, uint32_t content, const hdr_t *headers, int nhdrs, const uint8_t *body,
                                                                                                                  ^
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/bind.c:581:45: warning: passing 'string' (aka 'char *') to parameter of type 'const uint8_t *' (aka 'const unsigned char *') converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
                                            s->token, strlen(s->token),
                                            ^~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../inc_internal/zt_internal.h:361:115: note: passing argument to parameter 'body' here
ziti_channel_send_for_reply(ziti_channel_t *ch, uint32_t content, const hdr_t *headers, int nhdrs, const uint8_t *body,
                                                                                                                  ^
3 warnings generated.
[47/67] Building C object CMakeFiles/z..._nodejs.dir/src/Ziti_https_request.c.o
FAILED: CMakeFiles/ziti_sdk_nodejs.dir/src/Ziti_https_request.c.o 
/Library/Developer/CommandLineTools/usr/bin/cc -DSODIUM_STATIC -DZITI_BRANCH=HEAD -DZITI_COMMIT=d336721 -DZITI_VERSION=0.36.9 -Dziti_sdk_nodejs_EXPORTS -I/Users/nzedler/ziti-sdk-nodejs/build/include -I/Users/nzedler/.cmake-js/node-arm64/v20.16.0/include/node -I/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../includes -I/Users/nzedler/ziti-sdk-nodejs/build/_deps/tlsuv-src/include -I/Users/nzedler/ziti-sdk-nodejs/build/_deps/tlsuv-src/deps/uv_link_t/include -isystem /Users/nzedler/ziti-sdk-nodejs/build/vcpkg_installed/arm64-osx/include -isystem /Users/nzedler/ziti-sdk-nodejs/build/vcpkg_installed/arm64-osx/include/json-c -isystem /Users/nzedler/ziti-sdk-nodejs/build/vcpkg_installed/arm64-osx/lib/pkgconfig/../../include -O3 -DNDEBUG -std=gnu99 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -fPIC -pthread -MD -MT CMakeFiles/ziti_sdk_nodejs.dir/src/Ziti_https_request.c.o -MF CMakeFiles/ziti_sdk_nodejs.dir/src/Ziti_https_request.c.o.d -o CMakeFiles/ziti_sdk_nodejs.dir/src/Ziti_https_request.c.o -c /Users/nzedler/ziti-sdk-nodejs/src/Ziti_https_request.c
/Users/nzedler/ziti-sdk-nodejs/src/Ziti_https_request.c:621:19: error: incompatible function pointer types assigning to 'tlsuv_http_body_cb' (aka 'void (*)(struct tlsuv_http_req_s *, char *, long)') from 'void (tlsuv_http_req_t *, const char *, ssize_t)' (aka 'void (struct tlsuv_http_req_s *, const char *, long)') [-Wincompatible-function-pointer-types]
    resp->body_cb = on_resp_body;
                  ^ ~~~~~~~~~~~~
1 error generated.
[49/67] Building C object CMakeFiles/z...js.dir/src/Ziti_https_request_data.c.o
FAILED: CMakeFiles/ziti_sdk_nodejs.dir/src/Ziti_https_request_data.c.o 
/Library/Developer/CommandLineTools/usr/bin/cc -DSODIUM_STATIC -DZITI_BRANCH=HEAD -DZITI_COMMIT=d336721 -DZITI_VERSION=0.36.9 -Dziti_sdk_nodejs_EXPORTS -I/Users/nzedler/ziti-sdk-nodejs/build/include -I/Users/nzedler/.cmake-js/node-arm64/v20.16.0/include/node -I/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../includes -I/Users/nzedler/ziti-sdk-nodejs/build/_deps/tlsuv-src/include -I/Users/nzedler/ziti-sdk-nodejs/build/_deps/tlsuv-src/deps/uv_link_t/include -isystem /Users/nzedler/ziti-sdk-nodejs/build/vcpkg_installed/arm64-osx/include -isystem /Users/nzedler/ziti-sdk-nodejs/build/vcpkg_installed/arm64-osx/include/json-c -isystem /Users/nzedler/ziti-sdk-nodejs/build/vcpkg_installed/arm64-osx/lib/pkgconfig/../../include -O3 -DNDEBUG -std=gnu99 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -fPIC -pthread -MD -MT CMakeFiles/ziti_sdk_nodejs.dir/src/Ziti_https_request_data.c.o -MF CMakeFiles/ziti_sdk_nodejs.dir/src/Ziti_https_request_data.c.o.d -o CMakeFiles/ziti_sdk_nodejs.dir/src/Ziti_https_request_data.c.o -c /Users/nzedler/ziti-sdk-nodejs/src/Ziti_https_request_data.c
/Users/nzedler/ziti-sdk-nodejs/src/Ziti_https_request_data.c:230:47: error: incompatible function pointer types passing 'void (tlsuv_http_req_t *, const char *, ssize_t)' (aka 'void (struct tlsuv_http_req_s *, const char *, long)') to parameter of type 'tlsuv_http_body_cb' (aka 'void (*)(struct tlsuv_http_req_s *, char *, long)') [-Wincompatible-function-pointer-types]
  tlsuv_http_req_data(r, chunk, bufferLength, on_req_body );
                                              ^~~~~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/build/_deps/tlsuv-src/include/tlsuv/http.h:293:101: note: passing argument to parameter 'cb' here
int tlsuv_http_req_data(tlsuv_http_req_t *req, const char *body, size_t bodylen, tlsuv_http_body_cb cb);
                                                                                                    ^
1 error generated.
[50/67] Building C object CMakeFiles/ziti_sdk_nodejs.dir/src/utils.c.o
In file included from /Users/nzedler/ziti-sdk-nodejs/src/utils.c:20:
/Users/nzedler/ziti-sdk-nodejs/build/include/build_config.h:1:9: warning: 'ZITI_VERSION' macro redefined [-Wmacro-redefined]
#define ZITI_VERSION 0.17.0
        ^
<command line>:4:9: note: previous definition is here
#define ZITI_VERSION 0.36.9
        ^
In file included from /Users/nzedler/ziti-sdk-nodejs/src/utils.c:20:
/Users/nzedler/ziti-sdk-nodejs/build/include/build_config.h:2:9: warning: 'ZITI_COMMIT' macro redefined [-Wmacro-redefined]
#define ZITI_COMMIT  d88eb31
        ^
<command line>:3:9: note: previous definition is here
#define ZITI_COMMIT d336721
        ^
In file included from /Users/nzedler/ziti-sdk-nodejs/src/utils.c:20:
/Users/nzedler/ziti-sdk-nodejs/build/include/build_config.h:3:9: warning: 'ZITI_BRANCH' macro redefined [-Wmacro-redefined]
#define ZITI_BRANCH  main
        ^
<command line>:2:9: note: previous definition is here
#define ZITI_BRANCH HEAD
        ^
3 warnings generated.
[53/67] Building C object CMakeFiles/ziti_sdk_nodejs.dir/src/ziti_enroll.c.o
FAILED: CMakeFiles/ziti_sdk_nodejs.dir/src/ziti_enroll.c.o 
/Library/Developer/CommandLineTools/usr/bin/cc -DSODIUM_STATIC -DZITI_BRANCH=HEAD -DZITI_COMMIT=d336721 -DZITI_VERSION=0.36.9 -Dziti_sdk_nodejs_EXPORTS -I/Users/nzedler/ziti-sdk-nodejs/build/include -I/Users/nzedler/.cmake-js/node-arm64/v20.16.0/include/node -I/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../includes -I/Users/nzedler/ziti-sdk-nodejs/build/_deps/tlsuv-src/include -I/Users/nzedler/ziti-sdk-nodejs/build/_deps/tlsuv-src/deps/uv_link_t/include -isystem /Users/nzedler/ziti-sdk-nodejs/build/vcpkg_installed/arm64-osx/include -isystem /Users/nzedler/ziti-sdk-nodejs/build/vcpkg_installed/arm64-osx/include/json-c -isystem /Users/nzedler/ziti-sdk-nodejs/build/vcpkg_installed/arm64-osx/lib/pkgconfig/../../include -O3 -DNDEBUG -std=gnu99 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -fPIC -pthread -MD -MT CMakeFiles/ziti_sdk_nodejs.dir/src/ziti_enroll.c.o -MF CMakeFiles/ziti_sdk_nodejs.dir/src/ziti_enroll.c.o.d -o CMakeFiles/ziti_sdk_nodejs.dir/src/ziti_enroll.c.o -c /Users/nzedler/ziti-sdk-nodejs/src/ziti_enroll.c
/Users/nzedler/ziti-sdk-nodejs/src/ziti_enroll.c:131:12: warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    strcpy(item->json_salvo, output_buf);
           ^~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include/secure/_string.h:84:27: note: expanded from macro 'strcpy'
                __builtin___strcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                        ^~~~
/Users/nzedler/ziti-sdk-nodejs/src/ziti_enroll.c:221:44: error: incompatible function pointer types passing 'void (ziti_config *, int, char *, void *)' (aka 'void (struct ziti_config_s *, int, char *, void *)') to parameter of type 'ziti_enroll_cb' (aka 'void (*)(const struct ziti_config_s *, int, const char *, void *)') [-Wincompatible-function-pointer-types]
  int rc = ziti_enroll(&opts, thread_loop, on_ziti_enroll, addon_data);
                                           ^~~~~~~~~~~~~~
/Users/nzedler/ziti-sdk-nodejs/deps/ziti-sdk-c/library/../includes/ziti/ziti.h:413:80: note: passing argument to parameter 'enroll_cb' here
extern int ziti_enroll(ziti_enroll_opts *opts, uv_loop_t *loop, ziti_enroll_cb enroll_cb, void *enroll_ctx);
                                                                               ^
1 warning and 1 error generated.
[58/67] Building C object CMakeFiles/ziti_sdk_nodejs.dir/src/ziti_listen.c.o
ninja: build stopped: subcommand failed.
ERR! OMG Process terminated: 1
@rentallect
Copy link
Member

Hi @nzedler, I'm curious if you just need to install the SDK, or if you really need to build it from the source. Prebuilt binaries are available, and can be installed via npm i @openziti/ziti-sdk-nodejs or yarn add @openziti/ziti-sdk-nodejs commands.

@nzedler
Copy link
Author

nzedler commented Aug 21, 2024

Hi @rentallect, you're right, we didn't need to. We were troubleshooting to get it running on Next.js, the problem was a completely different one. I'll soon make a pull request for a Next.js/React example since this requires a special Webpack configuration and loader. You can close this issue if it is not relevant.

@rentallect
Copy link
Member

@nzedler Sounds good. Closing this as suggested.

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

3 participants
@rentallect @nzedler and others