nwjs 19 build crashed on MAC

404 views
Skip to first unread message

Shivani Pahuja

unread,
Jan 2, 2017, 5:05:52 AM1/2/17
to nw.js
Hi Roger,

I was trying to build nwjs 19 on MAC 10.10.5 and xcode 7.2 with below settings and command listed on http://docs.nwjs.io/en/latest/For%20Developers/Building%20NW.js/

export GYP_GENERATORS="ninja,xcode-ninja"
export GYP_DEFINES="clang=0"
export is_debug=false
export target_cpu="x64"


Build nwjs 
cd src
ninja -C out/nw nwjs

But final nwjs build crashed with below backtrace 

nwjs/src/out/nw/nwjs.app/Contents/MacOS/nwjs ; exit;
nwjs/src/out/nw/nwjs.app/Contents/MacOS/nwjs ; exit;
[0102/151300:WARNING:zip.cc(106)] Failed to open nwjs/src/out/nw/nwjs.app/Contents/Resources/app.nw
[0102/151300:WARNING:zip.cc(106)] Failed to open nwjs/src/out/nw/package.nw
[16921:1299:0102/151301:WARNING:persistent_histogram_allocator.cc(502)] Creating the results-histogram inside persistent memory can cause future allocations to crash if that memory is ever released (for testing).
[16921:1299:0102/151301:INFO:startup_browser_creator.cc(740)] loading default app: aafddpmiffkameplnjkglahmbnbgidce
[16924:16899:0102/151301:WARNING:persistent_histogram_allocator.cc(502)] Creating the results-histogram inside persistent memory can cause future allocations to crash if that memory is ever released (for testing).
[16921:1299:0102/151301:WARNING:push_messaging_service_factory.cc(30)] PushMessagingService could not be built because InstanceID is unexpectedly disabled
[16925:1299:0102/151301:FATAL:nw_content_renderer_hooks.cc(48)] Failed to load node library (error: dlopen(nwjs/src/out/nw/nwjs.app/Contents/Versions/55.0.2883.87/nwjs Framework.framework/libnode.dylib, 1): image not found)
0   libbase.dylib                       0x00000001207e1abe _ZN4base5debug10StackTraceC2Ev + 30
1   libbase.dylib                       0x00000001207e1b25 _ZN4base5debug10StackTraceC1Ev + 21
2   libbase.dylib                       0x0000000120878750 _ZN7logging10LogMessageD2Ev + 80
3   libbase.dylib                       0x0000000120876305 _ZN7logging10LogMessageD1Ev + 21
4   libcontent.dylib                    0x0000000128df422f _ZN2nw15LoadNodeSymbolsEv + 495
5   libcontent.dylib                    0x00000001288a3a9e _ZN7content12RendererMainERKNS_18MainFunctionParamsE + 430
6   libcontent.dylib                    0x0000000128dec527 _ZN7content23RunNamedProcessTypeMainERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKNS_18MainFunctionParamsEPNS_19ContentMainDelegateE + 599
7   libcontent.dylib                    0x0000000128dee973 _ZN7content21ContentMainRunnerImpl3RunEv + 2851
8   libcontent.dylib                    0x0000000128debdad _ZN7content11ContentMainERKNS_17ContentMainParamsE + 349
9   libnw.dylib                         0x000000010dd010e9 ChromeMain + 105
10  nwjs Helper                         0x000000010dcc4d8c main + 780
11  nwjs Helper                         0x000000010dcc4a74 start + 52

[16921:1299:0102/151301:WARNING:url_request_context_getter.cc(43)] URLRequestContextGetter leaking due to no owning thread.
[16921:1299:0102/151301:WARNING:pref_notifier_impl.cc(24)] Pref observer found at shutdown.
[16921:1299:0102/151301:ERROR:keep_alive_registry.cc(77)] KeepAliveRegistry not empty at destruction time. State:{registered_count_=1, restart_allowed_count_=0, KeepAlives=[APP_CONTROLLER (1)]}
logout

[Process completed]

As bt says Failed to load node library i tried to build the node library but it fails with error "ld: file not found: @rpath/libnw.dylib for architecture x86_64"  Below is complete error.
cd src
ninja -C out/Release node

ninja: Entering directory `out/Release'
[1/1] SOLINK libnode.dylib, POSTBUILDS
FAILED: libnode.dylib libnode.dylib.TOC 
if [ ! -e libnode.dylib -o ! -e libnode.dylib.TOC ] || otool -l libnode.dylib | grep -q LC_REEXPORT_DYLIB ; then c++ -shared ../nw/nwjs\ Framework.framework/nwjs\ Framework -Wl,-force_load ../nw/obj/v8/libv8_libbase.a -Wl,-force_load ../nw/obj/v8/libv8_libplatform.a -Wl,-no_pie -Wl,-search_paths_first -mmacosx-version-min=10.7 -arch x86_64 -L./ -install_name /usr/local/lib/libnode.dylib -Wl,-rpath,@loader_path/../../../../../../.. -stdlib=libc++ -o libnode.dylib @libnode.dylib.rsp && (export BUILT_FRAMEWORKS_DIR=//nwjs/src/out/Release; export BUILT_PRODUCTS_DIR=//nwjs/src/out/Release; export CONFIGURATION=Release; export DYLIB_INSTALL_NAME_BASE=/usr/local/lib; export EXECUTABLE_NAME=libnode.dylib; export EXECUTABLE_PATH=libnode.dylib; export FULL_PRODUCT_NAME=libnode.dylib; export LD_DYLIB_INSTALL_NAME=/usr/local/lib/libnode.dylib; export MACH_O_TYPE=mh_dylib; export PRODUCT_NAME=node; export PRODUCT_TYPE=com.apple.product-type.library.dynamic; export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk; export SRCROOT=//nwjs/src/out/Release/../../third_party/node; export SOURCE_ROOT="${SRCROOT}"; export TARGET_BUILD_DIR=//nwjs/src/out/Release; export TEMP_DIR="${TMPDIR}"; export XCODE_VERSION_ACTUAL=0720; (cd ../../third_party/node && install_name_tool -change "@executable_path/../Versions/55.0.2883.87/nwjs Framework.framework/nwjs Framework" "@executable_path/../../../nwjs Framework.framework/nwjs Framework" "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}"); G=$?; ((exit $G) || rm -rf libnode.dylib) && exit $G) && { otool -l libnode.dylib | grep LC_ID_DYLIB -A 5; nm -gP libnode.dylib | cut -f1-2 -d' ' | grep -v U$; true; } > libnode.dylib.TOC; else c++ -shared ../nw/nwjs\ Framework.framework/nwjs\ Framework -Wl,-force_load ../nw/obj/v8/libv8_libbase.a -Wl,-force_load ../nw/obj/v8/libv8_libplatform.a -Wl,-no_pie -Wl,-search_paths_first -mmacosx-version-min=10.7 -arch x86_64 -L./ -install_name /usr/local/lib/libnode.dylib -Wl,-rpath,@loader_path/../../../../../../.. -stdlib=libc++ -o libnode.dylib @libnode.dylib.rsp && (export BUILT_FRAMEWORKS_DIR=//nwjs/src/out/Release; export BUILT_PRODUCTS_DIR=//nwjs/src/out/Release; export CONFIGURATION=Release; export DYLIB_INSTALL_NAME_BASE=/usr/local/lib; export EXECUTABLE_NAME=libnode.dylib; export EXECUTABLE_PATH=libnode.dylib; export FULL_PRODUCT_NAME=libnode.dylib; export LD_DYLIB_INSTALL_NAME=/usr/local/lib/libnode.dylib; export MACH_O_TYPE=mh_dylib; export PRODUCT_NAME=node; export PRODUCT_TYPE=com.apple.product-type.library.dynamic; export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk; export SRCROOT=//nwjs/src/out/Release/../../third_party/node; export SOURCE_ROOT="${SRCROOT}"; export TARGET_BUILD_DIR=//nwjs/src/out/Release; export TEMP_DIR="${TMPDIR}"; export XCODE_VERSION_ACTUAL=0720; (cd ../../third_party/node && install_name_tool -change "@executable_path/../Versions/55.0.2883.87/nwjs Framework.framework/nwjs Framework" "@executable_path/../../../nwjs Framework.framework/nwjs Framework" "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}"); G=$?; ((exit $G) || rm -rf libnode.dylib) && exit $G) && { otool -l libnode.dylib | grep LC_ID_DYLIB -A 5; nm -gP libnode.dylib | cut -f1-2 -d' ' | grep -v U$; true; } > libnode.dylib.tmp && if ! cmp -s libnode.dylib.tmp libnode.dylib.TOC; then mv libnode.dylib.tmp libnode.dylib.TOC ; fi; fi
ld: file not found: @rpath/libnw.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.


Request you to please suggest what i am missing.

Regards,
Shivani Pahuja



rucka...@gmail.com

unread,
Jan 2, 2017, 9:13:09 AM1/2/17
to nw.js
It seems to me you built just nwjs and not node (or you didn't copy node library into nwjs folder). You need to have node in order to run nwjs.

Roger

unread,
Jan 2, 2017, 9:25:31 AM1/2/17
to rucka...@gmail.com, nw.js

That's right.


--
You received this message because you are subscribed to the Google Groups "nw.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nwjs-general...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shivani Pahuja

unread,
Jan 2, 2017, 11:34:50 AM1/2/17
to Roger, rucka...@gmail.com, nw.js
Hi,

Yes you are right. i already tried building node.but got below error.
 "ld: file not found: @rpath/libnw.dylib for architecture x86_64"  Below is complete error.
cd src
ninja -C out/Release node

ninja: Entering directory `out/Release'
[1/1] SOLINK libnode.dylib, POSTBUILDS
FAILED: libnode.dylib libnode.dylib.TOC 
if [ ! -e libnode.dylib -o ! -e libnode.dylib.TOC ] || otool -l libnode.dylib | grep -q LC_REEXPORT_DYLIB ; then c++ -shared ../nw/nwjs\ Framework.framework/nwjs\ Framework -Wl,-force_load ../nw/obj/v8/libv8_libbase.a -Wl,-force_load ../nw/obj/v8/libv8_libplatform.a -Wl,-no_pie -Wl,-search_paths_first -mmacosx-version-min=10.7 -arch x86_64 -L./ -install_name /usr/local/lib/libnode.dylib -Wl,-rpath,@loader_path/../../../../../../.. -stdlib=libc++ -o libnode.dylib @libnode.dylib.rsp && (export BUILT_FRAMEWORKS_DIR=//nwjs/src/out/Release; export BUILT_PRODUCTS_DIR=//nwjs/src/out/Release; export CONFIGURATION=Release; export DYLIB_INSTALL_NAME_BASE=/usr/local/lib; export EXECUTABLE_NAME=libnode.dylib; export EXECUTABLE_PATH=libnode.dylib; export FULL_PRODUCT_NAME=libnode.dylib; export LD_DYLIB_INSTALL_NAME=/usr/local/lib/libnode.dylib; export MACH_O_TYPE=mh_dylib; export PRODUCT_NAME=node; export PRODUCT_TYPE=com.apple.product-type.library.dynamic; export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk; export SRCROOT=//nwjs/src/out/Release/../../third_party/node; export SOURCE_ROOT="${SRCROOT}"; export TARGET_BUILD_DIR=//nwjs/src/out/Release; export TEMP_DIR="${TMPDIR}"; export XCODE_VERSION_ACTUAL=0720; (cd ../../third_party/node && install_name_tool -change "@executable_path/../Versions/55.0.2883.87/nwjs Framework.framework/nwjs Framework" "@executable_path/../../../nwjs Framework.framework/nwjs Framework" "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}"); G=$?; ((exit $G) || rm -rf libnode.dylib) && exit $G) && { otool -l libnode.dylib | grep LC_ID_DYLIB -A 5; nm -gP libnode.dylib | cut -f1-2 -d' ' | grep -v U$; true; } > libnode.dylib.TOC; else c++ -shared ../nw/nwjs\ Framework.framework/nwjs\ Framework -Wl,-force_load ../nw/obj/v8/libv8_libbase.a -Wl,-force_load ../nw/obj/v8/libv8_libplatform.a -Wl,-no_pie -Wl,-search_paths_first -mmacosx-version-min=10.7 -arch x86_64 -L./ -install_name /usr/local/lib/libnode.dylib -Wl,-rpath,@loader_path/../../../../../../.. -stdlib=libc++ -o libnode.dylib @libnode.dylib.rsp && (export BUILT_FRAMEWORKS_DIR=//nwjs/src/out/Release; export BUILT_PRODUCTS_DIR=//nwjs/src/out/Release; export CONFIGURATION=Release; export DYLIB_INSTALL_NAME_BASE=/usr/local/lib; export EXECUTABLE_NAME=libnode.dylib; export EXECUTABLE_PATH=libnode.dylib; export FULL_PRODUCT_NAME=libnode.dylib; export LD_DYLIB_INSTALL_NAME=/usr/local/lib/libnode.dylib; export MACH_O_TYPE=mh_dylib; export PRODUCT_NAME=node; export PRODUCT_TYPE=com.apple.product-type.library.dynamic; export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk; export SRCROOT=//nwjs/src/out/Release/../../third_party/node; export SOURCE_ROOT="${SRCROOT}"; export TARGET_BUILD_DIR=//nwjs/src/out/Release; export TEMP_DIR="${TMPDIR}"; export XCODE_VERSION_ACTUAL=0720; (cd ../../third_party/node && install_name_tool -change "@executable_path/../Versions/55.0.2883.87/nwjs Framework.framework/nwjs Framework" "@executable_path/../../../nwjs Framework.framework/nwjs Framework" "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}"); G=$?; ((exit $G) || rm -rf libnode.dylib) && exit $G) && { otool -l libnode.dylib | grep LC_ID_DYLIB -A 5; nm -gP libnode.dylib | cut -f1-2 -d' ' | grep -v U$; true; } > libnode.dylib.tmp && if ! cmp -s libnode.dylib.tmp libnode.dylib.TOC; then mv libnode.dylib.tmp libnode.dylib.TOC ; fi; fi
ld: file not found: @rpath/libnw.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.


Request you to please suggest what i am missing.

Regards,
Shivani Pahuja



-- 
You received this message because you are subscribed to a topic in the Google Groups "nw.js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nwjs-general/SO2HNpkriSU/unsubscribe.


That's right.


To unsubscribe from this group and stop receiving emails from it, send an email to nwjs-general+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "nw.js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nwjs-general/SO2HNpkriSU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nwjs-general+unsubscribe@googlegroups.com.

rucka...@gmail.com

unread,
Jan 2, 2017, 1:05:48 PM1/2/17
to nw.js, wen...@gmail.com, rucka...@gmail.com
Did you generated ninja files? It is described in nwjs building documentation you posted in first post:


That's right.


To unsubscribe from this group and stop receiving emails from it, send an email to nwjs-general...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "nw.js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nwjs-general/SO2HNpkriSU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nwjs-general...@googlegroups.com.

Shivani Pahuja

unread,
Jan 3, 2017, 5:17:04 AM1/3/17
to nw.js, wen...@gmail.com, rucka...@gmail.com
Hi,

Thanks for the reply.i have successfully generated ninja build files as listed on 
 But could not build node but it was throwing error like
 FAILED: obj/third_party/node/src/node.debug-agent.o 
 ../../v8/include/v8.h:365:33: error: use of undeclared identifier 'nullptr'
  V8_INLINE MaybeLocal() : val_(nullptr) {}
                                ^
../../v8/include/v8.h:365:33: error: use of undeclared identifier 'nullptr'
  V8_INLINE MaybeLocal() : val_(nullptr) {}
                                ^
../../v8/include/v8.h:372:51: error: use of undeclared identifier 'nullptr'
  V8_INLINE bool IsEmpty() const { return val_ == nullptr; }
                                                  ^
../../v8/include/v8.h:376:29: error: use of undeclared identifier 'nullptr'
    out->val_ = IsEmpty() ? nullptr : this->val_;
                            ^
../../v8/include/v8.h:444:25: error: use of undeclared identifier 'nullptr'
    return callback_ != nullptr;
                        ^
../../v8/include/v8.h:468:6: warning: scoped enumerations are a C++11 extension [-Wc++11-extensions]
enum class WeakCallbackType { kParameter, kInternalFields, kFinalizer };
     ^
../../v8/include/v8.h:477:51: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions]
  virtual ~EmbedderReachableReferenceReporter() = default;
    
 ./../v8/include/v8.h:3904:26: error: no member named 'unique_ptr' in namespace 'std'
  typedef std::pair<std::unique_ptr<const uint8_t[]>, size_t> SerializedModule;
 
fatal error: too many errors emitted, stopping now [-ferror-limit=]
53 warnings and 20 errors generated.
ninja: build stopped: subcommand failed.

i have verified v8 and thirdparty ,node all are on nw19 branch but still getiing error.

user$ ./build/gyp_chromium -I third_party/node/common.gypi third_party/node/node.gyp
Updating projects from gyp files...
user$  ninja -C out/Release node

<Fatal error: too many errors emitted, stopping now [-ferror-limit=]
53 warnings and 20 errors generated.
ninja: build stopped: subcommand failed.>


Regards,
Shivani Pahuja

Roger

unread,
Jan 3, 2017, 5:24:30 AM1/3/17
to Shivani Pahuja, nw.js, rucka...@gmail.com

You should make sure that the Chromium repo is at the right branch.

Shivani Pahuja

unread,
Jan 3, 2017, 5:44:31 AM1/3/17
to nw.js, pahuja...@gmail.com, rucka...@gmail.com
Roger Thanks for quick reply,

i have verified nwjs/src/chrome is on nw19 and depot_tools are on master branch.

Request you to please confirm where else i can verify .

Roger

unread,
Jan 3, 2017, 5:52:17 AM1/3/17
to Shivani Pahuja, nw.js, rucka...@gmail.com

You can see how the official binary was built here and verify your steps: http://buildbot-master.node-webkit.org:8010/waterfall

Shivani Pahuja

unread,
Jan 3, 2017, 6:42:49 AM1/3/17
to nw.js, pahuja...@gmail.com, rucka...@gmail.com
Roger, 

i have verified all repos as per  http://buildbot-master.node-webkit.org:8010/waterfall . They are on nw19.
nwjs/src -> nw19
nwjs/src/v8-> nw19
src/third_party/node->nw19

But still getting those errors. 
in past i was successfull to build nw14 but facing these errors in nw19.

Roger

unread,
Jan 3, 2017, 6:46:38 AM1/3/17
to Shivani Pahuja, nw.js, rucka...@gmail.com
The configuration steps are different with nw14 after we migrated from gyp to gn in Chromium repo. And Node is still using gyp.

Please see the 'stdio' of the build step 'config node' and 'build node'.

Roger
Reply all
Reply to author
Forward
0 new messages