agracio / edge-js

Run .NET and Node.js code in-process on Windows, macOS, and Linux
MIT License
618 stars 93 forks source link

Build failed on Node 19 and 20 on MacOS #186

Closed tripheo0412 closed 8 months ago

tripheo0412 commented 8 months ago

Building on Mac M1 using node 18 is fine. When building on Node 19 or 20 we got an error due to incompatible C++ 17 standard

$ node tools/install.js
gyp info it worked if it ends with ok
gyp info using node-gyp@10.0.1
gyp info using node@20.10.0 | darwin | arm64
gyp info find Python using Python version 3.10.8 found at "/Library/Frameworks/Python.framework/Versions/3.10/bin/python3"

gyp info spawn /Library/Frameworks/Python.framework/Versions/3.10/bin/python3
gyp info spawn args [
gyp info spawn args '/Users/trihoang/Documents/github/edge-js/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/trihoang/Documents/github/edge-js/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/trihoang/Documents/github/edge-js/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/trihoang/Library/Caches/node-gyp/20.10.0',
gyp info spawn args '-Dnode_gyp_dir=/Users/trihoang/Documents/github/edge-js/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/trihoang/Library/Caches/node-gyp/20.10.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/trihoang/Documents/github/edge-js',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/edge_coreclr/src/common/v8synchronizationcontext.o
In file included from ../src/common/v8synchronizationcontext.cpp:17:
In file included from ../src/common/edge_common.h:4:
In file included from /Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8.h:24:
In file included from /Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-array-buffer.h:12:
In file included from /Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-local-handle.h:12:
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
SHARED_EXTERNAL_POINTER_TAGS(CHECK_SHARED_EXTERNAL_POINTER_TAGS)
                             ^
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
PER_ISOLATE_EXTERNAL_POINTER_TAGS(CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS)
                                  ^
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:693:61: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
    static_assert(kJSObjectType + 1 == kFirstJSApiObjectType);
                                                            ^
                                                            , ""
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:694:55: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
    static_assert(kJSObjectType < kLastJSApiObjectType);
                                                      ^
                                                      , ""
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-internal.h:695:63: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
    static_assert(kFirstJSApiObjectType < kLastJSApiObjectType);
                                                              ^
                                                              , ""
In file included from ../src/common/v8synchronizationcontext.cpp:17:
In file included from ../src/common/edge_common.h:4:
In file included from /Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8.h:24:
In file included from /Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-array-buffer.h:13:
In file included from /Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-object.h:9:
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-maybe.h:106:45: error: no template named 'is_lvalue_reference_v' in namespace 'std'; did you mean 'is_lvalue_reference'?
  template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
                                       ~~~~~^~~~~~~~~~~~~~~~~~~~~
                                            is_lvalue_reference
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_reference.h:26:29: note: 'is_lvalue_reference' declared here
struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
                            ^
In file included from ../src/common/v8synchronizationcontext.cpp:17:
In file included from ../src/common/edge_common.h:4:
In file included from /Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8.h:24:
In file included from /Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-array-buffer.h:13:
In file included from /Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-object.h:9:
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-maybe.h:106:69: error: expected '(' for function-style cast or type construction
  template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-maybe.h:123:43: error: no template named 'is_lvalue_reference_v' in namespace 'std'; did you mean 'is_lvalue_reference'?
template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
                                     ~~~~~^~~~~~~~~~~~~~~~~~~~~
                                          is_lvalue_reference
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_reference.h:26:29: note: 'is_lvalue_reference' declared here
struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
                            ^
In file included from ../src/common/v8synchronizationcontext.cpp:17:
In file included from ../src/common/edge_common.h:4:
In file included from /Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8.h:24:
In file included from /Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-array-buffer.h:13:
In file included from /Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-object.h:9:
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-maybe.h:123:67: error: expected '(' for function-style cast or type construction
template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
In file included from ../src/common/v8synchronizationcontext.cpp:17:
In file included from ../src/common/edge_common.h:4:
In file included from /Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8.h:33:
In file included from /Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-function.h:11:
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-function-callback.h:151:66: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
                kReturnValueDefaultValueIndex - kReturnValueIndex);
                                                                 ^
                                                                 , ""
/Users/trihoang/Library/Caches/node-gyp/20.10.0/include/node/v8-function-callback.h:153:50: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
                kIsolateIndex - kReturnValueIndex);
                                                 ^
                                                 , ""
22 warnings and 4 errors generated.
make: *** [Release/obj.target/edge_coreclr/src/common/v8synchronizationcontext.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.<anonymous> (/Users/trihoang/Documents/github/edge-js/node_modules/node-gyp/lib/build.js:209:23)
gyp ERR! System Darwin 23.1.0
gyp ERR! command "/Users/trihoang/.nvm/versions/node/v20.10.0/bin/node" "/Users/trihoang/Documents/github/edge-js/node_modules/.bin/node-gyp" "configure" "build"
gyp ERR! cwd /Users/trihoang/Documents/github/edge-js
gyp ERR! node -v v20.10.0
gyp ERR! node-gyp -v v10.0.1
gyp ERR! not ok