Build Duniter dev : neon-sys, c++ nécessaire

J’essaye de rattraper le retard de ma suivie du développement du logiciel Duniter.

Je n’arrive pas à compiler neon-sys qui est en v0.4.0, bien qu’une v0.8.1 soit sortie.
Selon Cargo.{toml,lock} neon-sys/neon viennent de la crate duniteroxyde qui se trouve dans le dossier neon/native. J’ai tenté des les mettre à jour et d’installer gyp mais rien n’y fait, je n’y arrive pas encore.

Logs de compilation
cargo xtask build
    Finished dev [unoptimized + debuginfo] target(s) in 0.56s
     Running `target/debug/xtask build`
rustc 1.51.0 (Fedora 1.51.0-3.fc33)
cargo 1.51.0
Check node version …
Node v10.24.0 already installed ✔
npm WARN deprecated express-fileupload@0.0.5: Please upgrade express-fileupload to version 1.1.8+ due to a security vulnerability with the parseNested option
npm WARN deprecated node-pre-gyp@0.6.34: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated request-promise@4.2.0: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.81.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@4.2.1: this library is no longer supported
npm WARN deprecated hawk@3.1.3: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated sntp@1.0.9: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated cryptiles@2.0.5: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN duniter-ui@1.7.14 requires a peer of duniter@1.7.x but none is installed. You must install peer dependencies yourself.

+ duniter-ui@1.7.14
updated 1 package and audited 987 packages in 8.41s

17 packages are looking for funding
  run `npm fund` for details

found 108 vulnerabilities (39 low, 16 moderate, 48 high, 5 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
npm WARN prepare removing existing node_modules/ before installation

> sqlite3@4.1.1 install /home/gtest/duniter/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
[sqlite3] Success: "/home/gtest/duniter/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node" is installed via remote

> leveldown@5.6.0 install /home/gtest/duniter/node_modules/leveldown
> node-gyp-build


> duniter@1.8.1 install /home/gtest/duniter
> ./neon/build.sh

neon info forcing rebuild for new build settings
neon info running cargo
   Compiling neon-sys v0.4.0
   Compiling headers v0.3.4
   Compiling smallvec v1.6.1
   Compiling serde_json v1.0.64
The following warnings were emitted during compilation:

warning: ar: /home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/native/build/Release/obj.target/neon/src/neon.o: Aucun fichier ou dossier de ce type

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

Caused by:
  process didn't exit successfully: `/home/gtest/duniter/target/release/build/neon-sys-8f2e21598f2f7093/build-script-build` (exit code: 1)
  --- stdout
  Skipping node-gyp installation as part of npm install.
  audited 96 packages in 2.087s
  found 7 vulnerabilities (3 low, 1 moderate, 3 high)
    run `npm audit fix` to fix them, or `npm audit` for details

  > @ build-release /home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/native
  > node-gyp build

  make : on entre dans le répertoire « /home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/native/build »
    CXX(target) Release/obj.target/neon/src/neon.o
  make : on quitte le répertoire « /home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/native/build »
  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" "cq" "/home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/libneon.a" "/home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/native/build/Release/obj.target/neon/src/neon.o"
  cargo:warning=ar: /home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/native/build/Release/obj.target/neon/src/neon.o: Aucun fichier ou dossier de ce type
  exit code: 1

  --- stderr
  make: g++: Aucun fichier ou dossier de ce type
  make: *** [neon.target.mk:103 : Release/obj.target/neon/src/neon.o] Erreur 127
  gyp ERR! build error 
  gyp ERR! stack Error: `make` failed with exit code: 2
  gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:191:23)
  gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
  gyp ERR! System Linux 5.10.17-libre.200.fc33.gnu.x86_64
  gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build"
  gyp ERR! cwd /home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/native
  gyp ERR! node -v v10.24.0
  gyp ERR! node-gyp -v v5.1.0
  gyp ERR! not ok 
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! @ build-release: `node-gyp build`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the @ build-release 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!     /home/gtest/.npm/_cacache/_logs/2021-05-13T19_19_15_335Z-debug.log


  error occurred: Command "ar" "cq" "/home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/libneon.a" "/home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/native/build/Release/obj.target/neon/src/neon.o" with args "ar" did not execute successfully (status code exit code: 1).


warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:

warning: ar: /home/gtest/duniter/target/release/build/neon-sys-58bfee087a698940/out/native/build/Release/obj.target/neon/src/neon.o: Aucun fichier ou dossier de ce type

error: build failed
neon ERR! cargo build failed

Error: cargo build failed
    at Target.<anonymous> (/home/gtest/duniter/node_modules/neon-cli/lib/target.js:121:35)
    at step (/home/gtest/duniter/node_modules/neon-cli/lib/target.js:32:23)
    at Object.next (/home/gtest/duniter/node_modules/neon-cli/lib/target.js:13:53)
    at fulfilled (/home/gtest/duniter/node_modules/neon-cli/lib/target.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! duniter@1.8.1 install: `./neon/build.sh`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the duniter@1.8.1 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!     /home/gtest/.npm/_logs/2021-05-13T19_19_16_905Z-debug.log

Je ne peux pas mettre à jour neon (et toutes ses sous-crates dont neon-sys), car j’utilise massivement neon-serde pour générer une grosse partie de mon code de binding et que neon-serde dépend encore de neon 0.4.x.

À tu bien tous les prérequis demandés par neon :

Dans tous les cas, essaye de faire un cargo clean puis de relancer cargo xtask build

1 J'aime

Il me manquait python2. J’ai fait un cargo clean avant, mais le problème persiste, neon-sys v0.4.0 ne build pas.

Les logs ont-ils changés ? J’espère que oui, car sinon je ne suis pas en capacité de t’ aider :confused:

Si tu veux faire tourner un nœud de dev, l’image docker avec le tag dev est une possibilité :slight_smile:

Il me semble que les logs n’ont pas bougé.

logs
    Finished dev [unoptimized + debuginfo] target(s) in 0.29s
     Running `target/debug/xtask build`
rustc 1.51.0 (Fedora 1.51.0-3.fc33)
cargo 1.51.0
Check node version …
Node v10.24.0 already installed ✔
npm WARN deprecated express-fileupload@0.0.5: Please upgrade express-fileupload to version 1.1.8+ due to a security vulnerability with the parseNested option
npm WARN deprecated node-pre-gyp@0.6.34: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated request@2.81.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated request-promise@4.2.0: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated hawk@3.1.3: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated har-validator@4.2.1: this library is no longer supported
npm WARN deprecated sntp@1.0.9: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated cryptiles@2.0.5: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN duniter-ui@1.7.14 requires a peer of duniter@1.7.x but none is installed. You must install peer dependencies yourself.

+ duniter-ui@1.7.14
updated 1 package and audited 987 packages in 11.038s

17 packages are looking for funding
  run `npm fund` for details

found 108 vulnerabilities (39 low, 16 moderate, 48 high, 5 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
npm WARN prepare removing existing node_modules/ before installation

> sqlite3@4.1.1 install /home/gtest/duniter/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
[sqlite3] Success: "/home/gtest/duniter/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node" is installed via remote

> leveldown@5.6.0 install /home/gtest/duniter/node_modules/leveldown
> node-gyp-build


> duniter@1.8.1 install /home/gtest/duniter
> ./neon/build.sh

neon info forcing rebuild for new build settings
neon info running cargo
   Compiling neon-sys v0.4.0
   Compiling headers v0.3.4
   Compiling smallvec v1.6.1
   Compiling serde_json v1.0.64
The following warnings were emitted during compilation:

warning: ar: /home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/native/build/Release/obj.target/neon/src/neon.o: Aucun fichier ou dossier de ce type

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

Caused by:
  process didn't exit successfully: `/home/gtest/duniter/target/release/build/neon-sys-8f2e21598f2f7093/build-script-build` (exit code: 1)
  --- stdout
  Skipping node-gyp installation as part of npm install.
  audited 96 packages in 1.64s
  found 7 vulnerabilities (3 low, 1 moderate, 3 high)
    run `npm audit fix` to fix them, or `npm audit` for details

  > @ build-release /home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/native
  > node-gyp build

  make : on entre dans le répertoire « /home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/native/build »
    CXX(target) Release/obj.target/neon/src/neon.o
  make : on quitte le répertoire « /home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/native/build »
  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" "cq" "/home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/libneon.a" "/home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/native/build/Release/obj.target/neon/src/neon.o"
  cargo:warning=ar: /home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/native/build/Release/obj.target/neon/src/neon.o: Aucun fichier ou dossier de ce type
  exit code: 1

  --- stderr
  make: g++: Aucun fichier ou dossier de ce type
  make: *** [neon.target.mk:103 : Release/obj.target/neon/src/neon.o] Erreur 127
  gyp ERR! build error 
  gyp ERR! stack Error: `make` failed with exit code: 2
  gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:191:23)
  gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
  gyp ERR! System Linux 5.10.17-libre.200.fc33.gnu.x86_64
  gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build"
  gyp ERR! cwd /home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/native
  gyp ERR! node -v v10.24.0
  gyp ERR! node-gyp -v v5.1.0
  gyp ERR! not ok 
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! @ build-release: `node-gyp build`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the @ build-release 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!     /home/gtest/.npm/_cacache/_logs/2021-05-14T11_58_32_504Z-debug.log


  error occurred: Command "ar" "cq" "/home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/libneon.a" "/home/gtest/duniter/target/release/build/neon-sys-0bba5929ea84a1ef/out/native/build/Release/obj.target/neon/src/neon.o" with args "ar" did not execute successfully (status code exit code: 1).


warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:

warning: ar: /home/gtest/duniter/target/release/build/neon-sys-58bfee087a698940/out/native/build/Release/obj.target/neon/src/neon.o: Aucun fichier ou dossier de ce type

error: build failed
neon ERR! cargo build failed

Error: cargo build failed
    at Target.<anonymous> (/home/gtest/duniter/node_modules/neon-cli/lib/target.js:121:35)
    at step (/home/gtest/duniter/node_modules/neon-cli/lib/target.js:32:23)
    at Object.next (/home/gtest/duniter/node_modules/neon-cli/lib/target.js:13:53)
    at fulfilled (/home/gtest/duniter/node_modules/neon-cli/lib/target.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! duniter@1.8.1 install: `./neon/build.sh`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the duniter@1.8.1 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!     /home/gtest/.npm/_logs/2021-05-14T11_58_34_858Z-debug.log

Oui, si je n’y arrive pas je vais considérer utiliser l’image docker.

On dirait que j’ai trouvé la source en développant dans la partie Rust de Duniter :

Logs
cargo clippy --all --tests -- -D warnings --verbose
[…]

    Checking url v2.2.1
error: failed to run custom build command for `leveldb-sys v2.0.8`

Caused by:
  process didn't exit successfully: `/home/gtest/duniter/target/debug/build/leveldb-sys-298bf8982a9226b1/build-script-build` (exit code: 101)
  --- stdout
  [build] Started
  [snappy] Building
  running: "cmake" "/home/gtest/.cargo/registry/src/github.com-1ecc6299db9ec823/leveldb-sys-2.0.8/deps/snappy-1.1.7" "-DBUILD_SHARED_LIBS=OFF" "-DSNAPPY_BUILD_TESTS=OFF" "-DHAVE_LIBZ=OFF" "-DCMAKE_INSTALL_LIBDIR=/home/gtest/duniter/target/debug/build/leveldb-sys-e4705094a588dee0/out/lib" "-DCMAKE_INSTALL_PREFIX=/home/gtest/duniter/target/debug/build/leveldb-sys-e4705094a588dee0/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Debug"
  -- The C compiler identification is GNU 10.3.1
  -- The CXX compiler identification is unknown
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Configuring incomplete, errors occurred!
  See also "/home/gtest/duniter/target/debug/build/leveldb-sys-e4705094a588dee0/out/build/CMakeFiles/CMakeOutput.log".
  See also "/home/gtest/duniter/target/debug/build/leveldb-sys-e4705094a588dee0/out/build/CMakeFiles/CMakeError.log".

  --- stderr
  CMake Error at CMakeLists.txt:2 (project):
    The CMAKE_CXX_COMPILER:

      c++

    is not a full path and was not found in the PATH.

    Tell CMake where to find the compiler by setting either the environment
    variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
    to the compiler, or to the compiler name if it is in the PATH.


  thread 'main' panicked at '
  command did not execute successfully, got: exit code: 1

  build script failed, must exit now', /home/gtest/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.45/src/lib.rs:894:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

g++ était nécessaire pour leveldb-sys et surement pour neon-sys comme indiqué dans les pré-requis :

sudo dnf install gcc-c++

Tout a été compilé :slight_smile:

2 J'aime

Oui évidemment, je croyais que tu l’avais déjà, et c’est indiqué dans la doc de néon, c’est également indiqué dans la doc de compilation manuelle de Duniter, les « Build essential tools » comprenant un compilateur C++, mais apparemment ce n’est pas évident pour tout le monde :sweat_smile:

Tu veux bien faire une MR sur la doc pour rendre ça plus explicite ? :slight_smile:

Génial :smiley: