LeonardLaszlo / nw.js-armv7-binaries

NW.js ARMv7 and ARMv8 binaries and the scripts for building and running the executable.
145 stars 22 forks source link

Building NW.js v0.28.x fails #24

Closed tiitremmel closed 3 years ago

tiitremmel commented 6 years ago

I'm trying to build v0.28 version. Using Ubuntu version 16.04.5 LTS (Xenial Xerus) stretch/sid.

I followed all instructions as in this doc https://github.com/LeonardLaszlo/nw.js-armv7-binaries/blob/master/docs/build-nwjs-v0.28.x.md

After last step

ninja -C out_gn_arm/nw nwjs &&
ninja -C out_gn_arm/nw v8_libplatform &&
ninja -C out_gn_arm/Release node &&
ninja -C out_gn_arm/nw copy_node &&
ninja -C out_gn_arm/nw dump &&
ninja -C out_gn_arm/nw dist

I'm getting lot of error's saying that sys/types.h and error.h and assert.h file not found.

Here's last 3 errors

[6/1233] CC obj/third_party/node-nw/deps/uv/src/unix/libuv.getnameinfo.o
FAILED: obj/third_party/node-nw/deps/uv/src/unix/libuv.getnameinfo.o
../../third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF obj/third_party/node-nw/deps/uv/src/unix/libuv.getnameinfo.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DDISABLE_NACL -D_LARGEFILE_SOURCE -DCHROMIUM_BUILD -DCR_CLANG_REVISION=318667-1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DUSE_PROPRIETARY_CODECS -DENABLE_PEPPER_CDMS -DENABLE_NOTIFICATIONS -DUSE_UDEV -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DBUILDING_UV_SHARED=1 -D_GNU_SOURCE -DUSE_LIBPCI=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DNDEBUG -DNO_UNWIND_TABLES -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../third_party/node-nw/deps/uv/include -I../../third_party/node-nw/deps/uv/src -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -fcolor-diagnostics -Xclang -load -Xclang /home/myuser/nwjs/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -g -pthread -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-unused-function -Wno-unused-private-field -Wno-tautological-constant-compare -Wno-unused-variable -fvisibility=hidden -g --std=gnu89 -pedantic -Wall -Wno-unused-parameter -Wstrict-prototypes -Wno-varargs --std=gnu99 -target arm-linux-gnueabihf -march=armv7-a -mtune=generic-armv7-a -mfpu=neon -mfloat-abi=hard -mthumb --sysroot=/home/myuser/nwjs/src/build/linux/debian_jessie_arm-sysroot -O2 -fno-ident -fdata-sections -ffunction-sections -fno-unwind-tables -fno-asynchronous-unwind-tables   -c ../../third_party/node-nw/deps/uv/src/unix/getnameinfo.c -o obj/third_party/node-nw/deps/uv/src/unix/libuv.getnameinfo.o
../../third_party/node-nw/deps/uv/src/unix/getnameinfo.c:22:10: fatal error: 'assert.h' file not found
#include <assert.h>
         ^~~~~~~~~~
1 error generated.
[7/1233] CC obj/third_party/node-nw/deps/uv/src/unix/libuv.loop.o
FAILED: obj/third_party/node-nw/deps/uv/src/unix/libuv.loop.o
../../third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF obj/third_party/node-nw/deps/uv/src/unix/libuv.loop.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DDISABLE_NACL -D_LARGEFILE_SOURCE -DCHROMIUM_BUILD -DCR_CLANG_REVISION=318667-1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DUSE_PROPRIETARY_CODECS -DENABLE_PEPPER_CDMS -DENABLE_NOTIFICATIONS -DUSE_UDEV -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DBUILDING_UV_SHARED=1 -D_GNU_SOURCE -DUSE_LIBPCI=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DNDEBUG -DNO_UNWIND_TABLES -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../third_party/node-nw/deps/uv/include -I../../third_party/node-nw/deps/uv/src -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -fcolor-diagnostics -Xclang -load -Xclang /home/myuser/nwjs/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -g -pthread -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-unused-function -Wno-unused-private-field -Wno-tautological-constant-compare -Wno-unused-variable -fvisibility=hidden -g --std=gnu89 -pedantic -Wall -Wno-unused-parameter -Wstrict-prototypes -Wno-varargs --std=gnu99 -target arm-linux-gnueabihf -march=armv7-a -mtune=generic-armv7-a -mfpu=neon -mfloat-abi=hard -mthumb --sysroot=/home/myuser/nwjs/src/build/linux/debian_jessie_arm-sysroot -O2 -fno-ident -fdata-sections -ffunction-sections -fno-unwind-tables -fno-asynchronous-unwind-tables   -c ../../third_party/node-nw/deps/uv/src/unix/loop.c -o obj/third_party/node-nw/deps/uv/src/unix/libuv.loop.o
In file included from ../../third_party/node-nw/deps/uv/src/unix/loop.c:22:
In file included from ../../third_party/node-nw/deps/uv/include/uv.h:50:
../../third_party/node-nw/deps/uv/include/uv-errno.h:25:10: fatal error: 'errno.h' file not found
#include <errno.h>
         ^~~~~~~~~
1 error generated.
[8/1233] CC obj/third_party/node-nw/deps/zlib/zlib.trees.o
FAILED: obj/third_party/node-nw/deps/zlib/zlib.trees.o
../../third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF obj/third_party/node-nw/deps/zlib/zlib.trees.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DDISABLE_NACL -DCHROMIUM_BUILD -DCR_CLANG_REVISION=318667-1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DUSE_PROPRIETARY_CODECS -DENABLE_PEPPER_CDMS -DENABLE_NOTIFICATIONS -DUSE_UDEV -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DZ_HAVE_UNISTD_H -DHAVE_HIDDEN -DUSE_LIBPCI=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DNDEBUG -DNO_UNWIND_TABLES -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../third_party/node-nw/deps/zlib -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -fcolor-diagnostics -Xclang -load -Xclang /home/myuser/nwjs/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -g -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-unused-function -Wno-unused-private-field -Wno-tautological-constant-compare -Wno-unused-variable -target arm-linux-gnueabihf -march=armv7-a -mtune=generic-armv7-a -mfpu=neon -mfloat-abi=hard -mthumb --sysroot=/home/myuser/nwjs/src/build/linux/debian_jessie_arm-sysroot -O2 -fno-ident -fdata-sections -ffunction-sections -fno-unwind-tables -fno-asynchronous-unwind-tables   -c ../../third_party/node-nw/deps/zlib/trees.c -o obj/third_party/node-nw/deps/zlib/zlib.trees.o
In file included from ../../third_party/node-nw/deps/zlib/trees.c:37:
In file included from ../../third_party/node-nw/deps/zlib/deflate.h:16:
In file included from ../../third_party/node-nw/deps/zlib/zutil.h:22:
In file included from ../../third_party/node-nw/deps/zlib/zlib.h:34:
../../third_party/node-nw/deps/zlib/zconf.h:444:14: fatal error: 'sys/types.h' file not found
#    include <sys/types.h>      /* for off_t */
             ^~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.

Any ideas why?

LeonardLaszlo commented 6 years ago

What are your ffmpeg branging or sdk settings?

tiitremmel commented 6 years ago

The command I used

cd $NWJS/src
export GYP_CROSSCOMPILE="1"
export GYP_DEFINES="is_debug=false is_component_ffmpeg=true target_arch=arm target_cpu=\"arm\" arm_float_abi=hard"
export GN_ARGS="nwjs_sdk=true enable_nacl=false ffmpeg_branding=\"Chrome\"" #

export GYP_CHROMIUM_NO_ACTION=1
gclient sync --reset --with_branch_heads --nohooks
LeonardLaszlo commented 6 years ago

try to set enable_nacl=true

tiitremmel commented 6 years ago

I'll try and let you know if it helps

LeonardLaszlo commented 6 years ago

Ok

LeonardLaszlo commented 6 years ago

I had difficulties building with the following params:

export GN_ARGS="nwjs_sdk=false enable_nacl=false ffmpeg_branding=\"Chrome\""

That's why v0.28.4 was not released yet

LeonardLaszlo commented 6 years ago

@jtg-gg could you take a look at this issue, please?

LeonardLaszlo commented 6 years ago

I am getting an error at a different stage, when linking libnode.so: gist

jtg-gg commented 6 years ago

@tiitremmel try earlier version of node.js (28.3) Roger Wang might update the 28.4 version then abandoned it and move the nw29

Update Maybe it was me who skips 28.3 Try to build nw28.2 instead

pcaffardi commented 5 years ago

any progress here? ;-)

NbrTDB commented 4 years ago

Interesting, I am now experiencing the exact same issue trying to build nw28. Building with:

export PATH=$PATH:~/depot_tools
export NWJS=$HOME/nwjs
export GYP_CROSSCOMPILE="1"
export GYP_DEFINES="is_debug=false is_component_ffmpeg=true target_arch=arm target_cpu=\"arm\" arm_float_abi=hard"
export GN_ARGS="nwjs_sdk=false enable_nacl=false ffmpeg_branding=\"Chrome\"" #
export GYP_CHROMIUM_NO_ACTION=0

The following files are apparently missing:

../../third_party/node-nw/deps/zlib/zconf.h:444:14: fatal error: 'sys/types.h' file not found
...
../../third_party/node-nw/deps/uv/src/unix/getnameinfo.c:22:10: fatal error: 'assert.h' file not found
...
../../third_party/node-nw/deps/uv/include/uv-errno.h:25:10: fatal error: 'errno.h' file not found

Interestingly, sysroot for the compilation was --sysroot=/home/user/nwjs/src/build/linux/debian_jessie_arm-sysroot

This path doesn't exist!!!!

However, this one does:

/home/user/nwjs/src/build/linux/debian_stretch_arm-sysroot

and indeed, if you check in there:

$ cd /home/user/nwjs/src/build/linux/debian_jessie_arm-sysroot
$ find . -name "assert.h"
./usr/include/assert.h

$ find . -name "types.h"
./usr/include/gssrpc/types.h
./usr/include/rpc/types.h
./usr/include/asm-generic/types.h
./usr/include/linux/iio/types.h
./usr/include/linux/types.h
./usr/include/c++/6/parallel/types.h
./usr/include/mit-krb5/gssrpc/types.h
./usr/include/arm-linux-gnueabihf/bits/types.h
./usr/include/arm-linux-gnueabihf/asm/types.h
./usr/include/arm-linux-gnueabihf/sys/types.h
./usr/include/pci/types.h

Unfortunately, I'm really not sure how to get this rather complicated build system to point at the debian Stretch path instead of Jessie. I did try cheekily copying and renaming the folder so I had both Stretch and Jessie paths. Then I hit a similar libnode issue as @LeonardLaszlo, it seems it's missing another file:

ninja: Entering directory `out_gn_arm/Release'
[1232/1232] SOLINK lib/libnode.so
FAILED: lib/libnode.so lib/libnode.so.TOC 
if [ ! -e lib/libnode.so -o ! -e lib/libnode.so.TOC ]; then ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -Wl,-z,now -Wl,-z,relro -Wl,--fatal-warnings -Wl,-z,defs -pthread -Wl,-z,noexecstack -fPIC -B/home/user/nwjs/src/third_party/binutils/Linux_x64/Release/bin -L../nw/lib/ -lnw ../nw/obj/buildtools/third_party/libc++/libc++/*.o ../nw/obj/buildtools/third_party/libc++abi/libc++abi/*.o ../nw/obj/buildtools/third_party/libunwind/libunwind/*.o -pthread -target arm-linux-gnueabihf --sysroot=/home/user/nwjs/src/build/linux/debian_jessie_arm-sysroot -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -Wl,--no-as-needed -lpthread -Wl,--as-needed -o lib/libnode.so -Wl,-soname=libnode.so @lib/libnode.so.rsp && { readelf -d lib/libnode.so | grep SONAME ; nm -gD -f p lib/libnode.so | cut -f1-2 -d' '; } > lib/libnode.so.TOC; else ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -Wl,-z,now -Wl,-z,relro -Wl,--fatal-warnings -Wl,-z,defs -pthread -Wl,-z,noexecstack -fPIC -B/home/user/nwjs/src/third_party/binutils/Linux_x64/Release/bin -L../nw/lib/ -lnw ../nw/obj/buildtools/third_party/libc++/libc++/*.o ../nw/obj/buildtools/third_party/libc++abi/libc++abi/*.o ../nw/obj/buildtools/third_party/libunwind/libunwind/*.o -pthread -target arm-linux-gnueabihf --sysroot=/home/user/nwjs/src/build/linux/debian_jessie_arm-sysroot -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -Wl,--no-as-needed -lpthread -Wl,--as-needed -o lib/libnode.so -Wl,-soname=libnode.so @lib/libnode.so.rsp && { readelf -d lib/libnode.so | grep SONAME ; nm -gD -f p lib/libnode.so | cut -f1-2 -d' '; } > lib/libnode.so.tmp && if ! cmp -s lib/libnode.so.tmp lib/libnode.so.TOC; then mv lib/libnode.so.tmp lib/libnode.so.TOC ; fi; fi
clang: error: no such file or directory: '../nw/obj/buildtools/third_party/libunwind/libunwind/*.o'
ninja: build stopped: subcommand failed.

Due to all the relative paths I'm not sure where exactly it is trying to search (what its current working directory is), but the libunwind folder can be found in: $NWJS/src/buildtools/third_party/libunwind.

LeonardLaszlo commented 3 years ago

Not relevant anymore.