[yocto] nodejs project including zeromq fails to build with yocto

Jon Ove Storhaug jostorha at gmail.com
Fri Oct 26 06:02:11 PDT 2018


Hi,

I have a nodejs project which is including zeromq. I have made a simple
version of this project here: https://gitlab.com/jostor/my-npm-pkg.git
I am building for raspberry pi3. This is what I do:
devtool add https://gitlab.com/jostor/my-npm-pkg.git
devtool build my-npm-pkg

This fails with this output:
ERROR: my-npm-pkg-1.0.0+git999-r0 do_compile: Function failed: do_compile
(log file is located at
/workdir/poky/build/tmp/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/my-npm-pkg/1.0.0+git999-r0/temp/log.do_compile.5090)
ERROR: Logfile of failure stored in:
/workdir/poky/build/tmp/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/my-npm-pkg/1.0.0+git999-r0/temp/log.do_compile.5090
Log data follows:
| DEBUG: Executing python function externalsrc_compile_prefunc
| NOTE: my-npm-pkg: compiling from external source tree
/workdir/poky/build/workspace/sources/my-npm-pkg
| DEBUG: Python function externalsrc_compile_prefunc finished
| DEBUG: Executing shell function do_compile
| npm WARN using --force I sure hope you know what you are doing.
|
| > zeromq at 5.1.0 install
/workdir/poky/build/workspace/sources/my-npm-pkg/node_modules/zeromq
| > node scripts/prebuild-install.js || (node scripts/preinstall.js &&
node-gyp rebuild)
|
|
| prebuild-install WARN install No prebuilt binaries found (target=8.9.4
runtime=node arch=arm platform=linux)
|
| Building libzmq for linux
| checking for a BSD-compatible install...
/workdir/poky/build/tmp/hosttools/install -c
| checking whether build environment is sane... yes
| checking for a thread-safe mkdir -p...
/workdir/poky/build/tmp/hosttools/mkdir -p
| checking for gawk... gawk
| checking whether make sets $(MAKE)... yes
| checking whether make supports nested variables... yes
| checking whether UID '1000' is supported by ustar format... yes
| checking whether GID '1000' is supported by ustar format... yes
| checking how to create a ustar tar archive... gnutar
| checking whether make supports nested variables... (cached) yes
| checking for gcc... arm-poky-linux-gnueabi-gcc  -march=armv7ve -marm
-mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7
--sysroot=/workdir/poky/build/tmp/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/my-npm-pkg/1.0.0+git999-r0/recipe-sysroot
| checking whether the C compiler works... yes
| checking for C compiler default output file name... a.out
| checking for suffix of executables...
| checking whether we are cross compiling... configure: error: in
`/workdir/poky/build/workspace/sources/my-npm-pkg/node_modules/zeromq/zmq/zeromq-4.2.2':
| configure: error: cannot run C compiled programs.
| If you meant to cross compile, use `--host'.
| See `config.log' for more details
| child process exited with code 1
| make: Entering directory
'/workdir/poky/build/workspace/sources/my-npm-pkg/node_modules/zeromq/build'
|   CXX(target) Release/obj.target/zmq/binding.o
| ../binding.cc:28:10: fatal error: zmq.h: No such file or directory
|  #include <zmq.h>
|           ^~~~~~~
| compilation terminated.
| zmq.target.mk:93: recipe for target 'Release/obj.target/zmq/binding.o'
failed
| make: *** [Release/obj.target/zmq/binding.o] Error 1
| make: Leaving directory
'/workdir/poky/build/workspace/sources/my-npm-pkg/node_modules/zeromq/build'
| gyp ERR! build error
| gyp ERR! stack Error: `make` failed with exit code: 2
| gyp ERR! stack     at ChildProcess.onExit
(/workdir/poky/build/tmp/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/my-npm-pkg/1.0.0+git999-r0/recipe-sysroot-native/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
| gyp ERR! stack     at emitTwo (events.js:126:13)
| gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
| gyp ERR! stack     at Process.ChildProcess._handle.onexit
(internal/child_process.js:198:12)
| gyp ERR! System Linux 4.15.0-36-generic
| gyp ERR! command
"/workdir/poky/build/tmp/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/my-npm-pkg/1.0.0+git999-r0/recipe-sysroot-native/usr/bin/node"
"/workdir/poky/build/tmp/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/my-npm-pkg/1.0.0+git999-r0/recipe-sysroot-native/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js"
"rebuild"
| gyp ERR! cwd
/workdir/poky/build/workspace/sources/my-npm-pkg/node_modules/zeromq
| gyp ERR! node -v v8.9.4
| gyp ERR! node-gyp -v v3.6.2
| gyp ERR! not ok
| npm WARN my-npm-pkg at 1.0.0 No description
| npm WARN my-npm-pkg at 1.0.0 No repository field.
|
| npm ERR! code ELIFECYCLE
| npm ERR! errno 1
| npm ERR! zeromq at 5.1.0 install: `node scripts/prebuild-install.js || (node
scripts/preinstall.js && node-gyp rebuild)`
| npm ERR! Exit status 1
| npm ERR!
| npm ERR! Failed at the zeromq at 5.1.0 install script.
| npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
|
| npm ERR! A complete log of this run can be found in:
| npm ERR!
 /workdir/poky/build/tmp/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/my-npm-pkg/1.0.0+git999-r0/npm_cache/_logs/2018-10-26T12_49_46_985Z-debug.log
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at
/workdir/poky/build/tmp/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/my-npm-pkg/1.0.0+git999-r0/temp/log.do_compile.5090)
ERROR: Task
(/workdir/poky/build/workspace/recipes/my-npm-pkg/my-npm-pkg_git.bb:do_compile)
failed with exit code '1'
NOTE: Tasks Summary: Attempted 439 tasks of which 436 didn't need to be
rerun and 1 failed.

Summary: 1 task failed:
  /workdir/poky/build/workspace/recipes/my-npm-pkg/my-npm-pkg_git.bb:
do_compile
Summary: There was 1 ERROR message shown, returning a non-zero exit code.


If I instead of building this with yocto, are using npm install, it will
build without failing.
Can anyone help me with this? Thanks in advance for your help!

Best Regards,
Jon Ove
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20181026/4c089b05/attachment-0001.html>


More information about the yocto mailing list