Skip to content
This repository was archived by the owner on Oct 16, 2021. It is now read-only.
This repository was archived by the owner on Oct 16, 2021. It is now read-only.

"npm install" for dependency ffi fails on z/OS #122

@mgerth

Description

@mgerth

I've a project where I need to call a shared library from Node.js. To achieve this I used "Node.js Foreign Function Interface" (https://github.com/node-ffi/node-ffi)... unfortunately the install stops with an error. I stripped down the package.json file to make it as simple as possible:

bash-4.3$ cat package.json
{
  "name": "ffi-test",
  "version": "1.0.0",
  "description": "FFI test.",
  "main": "index.js",
  "scripts": {
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "ffi": "^2.3.0"
  }
}

Here is the output of the "npm i" command:

bash-4.3$ npm i

ref@1.3.5 install /DA3F/u/ada/ger/code/test/node_modules/ref
node-gyp rebuild

make: Entering directory '/DA3F/u/ada/ger/code/test/node_modules/ref/build'
CXX(target) Release/obj.target/binding/src/binding.o
../src/binding_temp.cc:325:42: warning: data argument not used by format string [-Wformat-extra-args]
snprintf(strbuf, 128, "\x25" PRId64, val);
~~~~~~~~~~~~~ ^
../src/binding_temp.cc:412:42: warning: data argument not used by format string [-Wformat-extra-args]
snprintf(strbuf, 128, "\x25" PRIu64, val);
~~~~~~~~~~~~~ ^
../src/binding_temp.cc:640:8: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
Nan::ForceSet(target, Nan::Newv8::String("\x65\x6e\x64\x69\x61\x6e\x6e\x65\x73\x73").ToLocalChecked(), Nan::Newv8::String(CheckEndianness()).ToLocalChecked(), static_cast(ReadOnly|DontDelete));
^
../../nan/nan_maybe_43_inl_temp.h:130:35: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe ForceSet(
^
../src/binding_temp.cc:641:8: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
Nan::ForceSet(target, Nan::Newv8::String("\x4e\x55\x4c\x4c").ToLocalChecked(), WrapNullPointer(), static_cast(ReadOnly|DontDelete));
^
../../nan/nan_maybe_43_inl_temp.h:130:35: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe ForceSet(
^
4 warnings generated.
SOLINK_MODULE(target) Release/obj.target/binding.node
COPY Release/binding.node
make: Leaving directory '/DA3F/u/ada/ger/code/test/node_modules/ref/build'

ffi@2.3.0 install /DA3F/u/ada/ger/code/test/node_modules/ffi
node-gyp rebuild

make: Entering directory '/DA3F/u/ada/ger/code/test/node_modules/ffi/build'
CC(target) Release/obj.target/ffi/deps/libffi/src/prep_cif.o
../deps/libffi/src/prep_cif.c:26:10: fatal error: 'ffi.h' file not found
#include <ffi.h>
^
../deps/libffi/src/prep_cif_temp.c:27:10: fatal error: 'ffi.h' file not found
#include <ffi.h>
^
1 error generated.
Error while processing ../deps/libffi/src/prep_cif_temp.c.
CNJ0793(I) Compilation failed for file ../deps/libffi/src/prep_cif_temp.c. Object file not created.
deps/libffi/ffi.target.mk:103: recipe for target 'Release/obj.target/ffi/deps/libffi/src/prep_cif.o' failed
make: *** [Release/obj.target/ffi/deps/libffi/src/prep_cif.o] Error 12
make: Leaving directory '/DA3F/u/ada/ger/code/test/node_modules/ffi/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/DA3F/u/ada/ger/bin/node-v6.17.0-os390-s390x/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)
gyp ERR! System OS/390 25.00
gyp ERR! command "/DA3F/u/ada/ger/bin/node-v6.17.0-os390-s390x/bin/node" "/DA3F/u/ada/ger/bin/node-v6.17.0-os390-s390x/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /DA3F/u/ada/ger/code/test/node_modules/ffi
gyp ERR! node -v v6.17.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN ffi-test@1.0.0 No repository field.
npm ERR! OS/390 25.00
npm ERR! argv "/DA3F/u/ada/ger/bin/node-v6.17.0-os390-s390x/bin/node" "/DA3F/u/ada/ger/bin/node-v6.17.0-os390-s390x/bin/npm" "i"
npm ERR! node v6.17.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! ffi@2.3.0 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ffi@2.3.0 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ffi package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ffi
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ffi
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /DA3F/u/ada/ger/code/test/npm-debug.log
bash-4.3$

My environment is the following:

bash-4.3$ uname -a
OS/390 DA3F 25.00 04 2965
bash-4.3$ node --version
v6.17.0
bash-4.3$ npm --version
3.10.10

I assume that it is a problem of the node-ffi package, but perhaps has someone run into a similar problem. Any suggestions to solve the problem are appreciated ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions