Impossible de build Duniter sur Debian 7

Salut,

Lorsque j’essaie de build duniter sous node v6.9.4, je tombe sur l’erreur suivante :

npm WARN bl@0.7.0 requires a peer of stream-browserify@* but none was installed.
npm ERR! Linux 2.6.32-042stab123.9
npm ERR! argv "/opt/gtest/.nvm/versions/node/v6.9.4/bin/node" "/opt/gtest/.nvm/versions/node/v6.9.4/bin/npm" "install"
npm ERR! node v6.9.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! wotb@0.6.2 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the wotb@0.6.2 install script 'node-pre-gyp install --fallback-to-build'.
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 wotb package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs wotb
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls wotb
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /opt/gtest/duniter/npm-debug.log

Je lance la compilation sous debian 7 64 bits. Une idée de vers ou chercher la raison de cette erreur ?

ca ressemble a des erreurs de compilations que j’ai eu en testant le build de mon cote,
“node pre-gyp install” il me semble avoir lu des logs comme cela,

https://forum.duniter.org/t/fail-following-tuto-duniter-dev-contributions/2987/8?u=max

recommandation d’install de yarn, cela m’a enlevé ces erreurs / yarn qui doit gerer ca… pourquoi comment tout un mystere…

C’est simplement que yarn installe précisément la bonne version de chaque librairie, comme celle que moi-même j’installe quand je développe Duniter. On est donc sûr d’avoir strictement les mêmes éléments avec cet outil.

Tandis NPM fait un peu à sa sauce en revanche, et provoque des builds différents selon le système. Yarn est né à cause de cela.

1 « J'aime »

J’ai un peu plus de detail en utilisant yarn :

make: Entering directory `/opt/gtest/duniter/node_modules/wotb/build'
  CXX(target) Release/obj.target/wotb/wotb.o
In file included from ../../nan/nan.h:194:0,
                 from ../wotb.cc:2:
../../nan/nan_maybe_43_inl.h: In function ‘Nan::MaybeLocal<v8::Object> Nan::CloneElementAt(v8::Local<v8::Array>, uint32_t)’:
../../nan/nan_maybe_43_inl.h:220:58: warning: ‘v8::MaybeLocal<v8::Object> v8::Array::CloneElementAt(v8::Local<v8::Context>, uint32_t)’ is deprecated (declared at /opt/gtest/.node-gyp/6.9.4/include/node/v8.h:3031): Cloning is not supported. [-Wdeprecated-declarations]
In file included from ../../nan/nan_new.h:189:0,
                 from ../../nan/nan.h:200,
                 from ../wotb.cc:2:
../../nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::BooleanObject>::return_t Nan::imp::Factory<v8::BooleanObject>::New(bool)’:
../../nan/nan_implementation_12_inl.h:40:38: warning: ‘static v8::Local<v8::Value> v8::BooleanObject::New(bool)’ is deprecated (declared at /opt/gtest/.node-gyp/6.9.4/include/node/v8.h:4007): Pass an isolate [-Wdeprecated-declarations]
In file included from ../wotb.cc:2:0:
../../nan/nan.h: In function ‘bool Nan::SetAccessor(v8::Local<v8::Object>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’:
../../nan/nan.h:1969:16: warning: ‘bool v8::Object::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’ is deprecated (declared at /opt/gtest/.node-gyp/6.9.4/include/node/v8.h:2750): Use maybe version [-Wdeprecated-declarations]
  CXX(target) Release/obj.target/wotb/functions.o
In file included from ../../nan/nan.h:194:0,
                 from ../functions.cc:2:
../../nan/nan_maybe_43_inl.h: In function ‘Nan::MaybeLocal<v8::Object> Nan::CloneElementAt(v8::Local<v8::Array>, uint32_t)’:
../../nan/nan_maybe_43_inl.h:220:58: warning: ‘v8::MaybeLocal<v8::Object> v8::Array::CloneElementAt(v8::Local<v8::Context>, uint32_t)’ is deprecated (declared at /opt/gtest/.node-gyp/6.9.4/include/node/v8.h:3031): Cloning is not supported. [-Wdeprecated-declarations]
In file included from ../../nan/nan_new.h:189:0,
                 from ../../nan/nan.h:200,
                 from ../functions.cc:2:
../../nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::BooleanObject>::return_t Nan::imp::Factory<v8::BooleanObject>::New(bool)’:
../../nan/nan_implementation_12_inl.h:40:38: warning: ‘static v8::Local<v8::Value> v8::BooleanObject::New(bool)’ is deprecated (declared at /opt/gtest/.node-gyp/6.9.4/include/node/v8.h:4007): Pass an isolate [-Wdeprecated-declarations]
In file included from ../functions.cc:2:0:
../../nan/nan.h: In function ‘bool Nan::SetAccessor(v8::Local<v8::Object>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’:
../../nan/nan.h:1969:16: warning: ‘bool v8::Object::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’ is deprecated (declared at /opt/gtest/.node-gyp/6.9.4/include/node/v8.h:2750): Use maybe version [-Wdeprecated-declarations]
../functions.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE clearInstance(Nan::NAN_METHOD_ARGS_TYPE)’:
../functions.cc:84:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../functions.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE getDisabled(Nan::NAN_METHOD_ARGS_TYPE)’:
../functions.cc:241:11: warning: unused variable ‘d_min’ [-Wunused-variable]
../functions.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE getPaths(Nan::NAN_METHOD_ARGS_TYPE)’:
../functions.cc:261:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  CXX(target) Release/obj.target/wotb/wotcpp/FileWoT.o
  CXX(target) Release/obj.target/wotb/wotcpp/MemoryWoT.o
  CXX(target) Release/obj.target/wotb/wotcpp/webOfTrust.o
../wotcpp/webOfTrust.cpp: In member function ‘libwot::WebOfTrust* libwot::WebOfTrust::clone()’:
../wotcpp/webOfTrust.cpp:197:18: warning: unused variable ‘to’ [-Wunused-variable]
  CXX(target) Release/obj.target/wotb/wotcpp/node.o
../wotcpp/node.cpp: In constructor ‘libwot::Node::Node(libwot::WebOfTrust*)’:
../wotcpp/node.cpp:19:11: error: ‘UINT32_MAX’ was not declared in this scope
make: *** [Release/obj.target/wotb/wotcpp/node.o] Error 1
make: Leaving directory `/opt/gtest/duniter/node_modules/wotb/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/gtest/.nvm/versions/node/v6.9.4/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:215:12)
gyp ERR! System Linux 2.6.32-042stab123.9
gyp ERR! command "/opt/gtest/.nvm/versions/node/v6.9.4/bin/node" "/opt/gtest/.nvm/versions/node/v6.9.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/opt/gtest/duniter/node_modules/wotb/lib/binding/Release/node-v48-linux-x64/wotb.node" "--module_name=wotb" "--module_path=/opt/gtest/duniter/node_modules/wotb/lib/binding/Release/node-v48-linux-x64"
gyp ERR! cwd /opt/gtest/duniter/node_modules/wotb
gyp ERR! node -v v6.9.4
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/opt/gtest/.nvm/versions/node/v6.9.4/bin/node /opt/gtest/.nvm/versions/node/v6.9.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/opt/gtest/duniter/node_modules/wotb/lib/binding/Release/node-v48-linux-x64/wotb.node --module_name=wotb --module_path=/opt/gtest/duniter/node_modules/wotb/lib/binding/Release/node-v48-linux-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/opt/gtest/duniter/node_modules/wotb/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Linux 2.6.32-042stab123.9
node-pre-gyp ERR! command "/opt/gtest/.nvm/versions/node/v6.9.4/bin/node" "/opt/gtest/duniter/node_modules/wotb/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /opt/gtest/duniter/node_modules/wotb
node-pre-gyp ERR! node -v v6.9.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.23
node-pre-gyp ERR! not ok 
Failed to execute '/opt/gtest/.nvm/versions/node/v6.9.4/bin/node /opt/gtest/.nvm/versions/node/v6.9.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/opt/gtest/duniter/node_modules/wotb/lib/binding/Release/node-v48-linux-x64/wotb.node --module_name=wotb --module_path=/opt/gtest/duniter/node_modules/wotb/lib/binding/Release/node-v48-linux-x64' (1)

Il y a une erreur de compilation dans le code de wotb :

../wotcpp/node.cpp: In constructor ‘libwot::Node::Node(libwot::WebOfTrust*)’:
../wotcpp/node.cpp:19:11: error: ‘UINT32_MAX’ was not declared in this scope

J’ai testé cette modification de code qui permet de passer la compilation : https://github.com/duniter/wotb/pull/11

Une version 0.6.3 de wotb est en cours de déploiement.

Peux-tu réessayer le build de Duniter en modifiant la version de wotb dans package.json ? Puis :

rm -rf node_modules
yarn

yarn ne la trouve pas :

gtest@vps55093:/opt/gtest/duniter$ yarn
yarn install v0.27.5
[1/4] Resolving packages...
Couldn't find any versions for "wotb" that matches "0.6.3"
? Please choose a version of "wotb" from this list: (Use arrow keys)
❯ 0.6.2 
  0.5.9 

A savoir que j’ai build mon noeud ğ1-test en pointant sur la branche git de la pull-request, donc de ce côté je suis certain que le correctif fonctionne.

Ça devrait être bon là, le build Travis avait échoué et la publication avec.

C’est bon ! :+1:

Si je ne force pas la version 0.6.3 de wotb il tente la compilation avec la 0.6.2. Une idée ?

Pour l’instant la version de wotb dans les sources de Duniter (package.json, yarn.lock) est 0.6.2.

Tu peux forcer l’utilisation de la 0.6.3 en faisant “yarn add wotb@0.6.3”. Cela modifiera la version dans les deux fichiers.