neon-bindings/examples

failed to run custom build command for `neon-sys v0.3.3`

CoinSIQI opened this issue · 2 comments

I've followed the guide here: https://neon-bindings.com/docs/hello-world

At the last step where neon build --release, it fails with this message.

error: failed to run custom build command for neon-sys v0.3.3

Caused by:
process didn't exit successfully: /mnt/d/neon/examples-main/hello-world/native/target/debug/build/neon-sys-0cc2556522515c80/build-script-build (exit code: 1)
--- stdout
added 96 packages from 70 contributors and audited 96 packages in 5.661s
found 7 vulnerabilities (3 low, 1 moderate, 3 high)
run npm audit fix to fix them, or npm audit for details

@ build-debug /mnt/d/neon/examples-main/hello-world/native/target/debug/build/neon-sys-8c04c05edc17c5e6/out/native
node-gyp build --debug

TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
AR_x86_64-unknown-linux-gnu = None
AR_x86_64_unknown_linux_gnu = None
HOST_AR = None
AR = None
running: "ar" "crs" "/mnt/d/neon/examples-main/hello-world/native/target/debug/build/neon-sys-8c04c05edc17c5e6/out/libneon.a" "/mnt/d/neon/examples-main/hello-world/native/target/debug/build/neon-sys-8c04c05edc17c5e6/out/native/build/Debug/obj.target/neon/src/neon.o"
cargo:warning=ar: /mnt/d/neon/examples-main/hello-world/native/target/debug/build/neon-sys-8c04c05edc17c5e6/out/native/build/Debug/obj.target/neon/src/neon.o: No such file or directory
exit code: 1

--- stderr
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at getNotFoundError (/mnt/d/neon/node-v14.15.4-linux-x64/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/mnt/d/neon/node-v14.15.4-linux-x64/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/mnt/d/neon/node-v14.15.4-linux-x64/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /mnt/d/neon/node-v14.15.4-linux-x64/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /mnt/d/neon/node-v14.15.4-linux-x64/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack at /mnt/d/neon/node-v14.15.4-linux-x64/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqCallback.oncomplete (fs.js:183:21)
gyp ERR! System Linux 4.19.128-microsoft-standard
gyp ERR! command "/mnt/d/neon/node-v14.15.4-linux-x64/bin/node" "/mnt/d/neon/node-v14.15.4-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--debug"
gyp ERR! cwd /mnt/d/neon/examples-main/hello-world/native/target/debug/build/neon-sys-8c04c05edc17c5e6/out/native
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ build-debug: node-gyp build --debug
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ build-debug 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! /root/.npm/_logs/2021-02-08T01_16_34_723Z-debug.log

error occurred: Command "ar" "crs" "/mnt/d/neon/examples-main/hello-world/native/target/debug/build/neon-sys-8c04c05edc17c5e6/out/libneon.a" "/mnt/d/neon/examples-main/hello-world/native/target/debug/build/neon-sys-8c04c05edc17c5e6/out/native/build/Debug/obj.target/neon/src/neon.o" with args "ar" did not execute successfully (status code exit code: 1).

neon ERR! cargo build failed

Error: cargo build failed
at Target. (/mnt/c/Users/honor_station/AppData/Roaming/npm/node_modules/neon-cli/lib/target.js:98:27)
at Generator.next ()
at fulfilled (/mnt/c/Users/honor_station/AppData/Roaming/npm/node_modules/neon-cli/lib/target.js:24:58)
at processTicksAndRejections (internal/process/task_queues.js:93:5)

Environment:
neon version
0.7.0

ructc --version
rustc 1.47.0

cargo -V
cargo 1.47.0

node --version
v14.15.4

@CoinSIQI It appears like your system may be missing some of the require build tooling. Neon with the legacy-backend has the same requirements as node-gyp based C++ native modules (https://www.npmjs.com/package/node-gyp#installation).

In your case make is missing, but other dependencies may be missing as well. This is covered in the build tools section https://neon-bindings.com/docs/getting-started#install-node-build-tools.

The newer napi-backend (opt-in only), has simpler requirements and only requires cargo / rustc.

All examples use the Node-API backend now.