Hello,
Je suis en train d’essayer de faire une intégration CI via GitLab et j’ai des soucis de compilation !
Je me suis basé les sur le pipeline circle ci
Si vous avez des idées je suis preneur !
A priori ça vient de bcrypt
, j’ai essayé de relancer la compile mais ça plante tout de même.
J’ai un problème sur la tâche test_server
et build_server
Les taches en question :
test_server:
image: node:12
stage: test
script:
# Install system dependencies
- apt-get update && apt-get install -y libudev-dev sqlite3 openssl openzwave libopenzwave1.5-dev build-essential python
# Install global dependencies
- npm install typescript node-gyp npm@latest -g
- cd server
# Install NPM dependencies
- npm install
- npm rebuild bcrypt --build-from-source
# Run prettier
- npm run prettier-check
# Run eslint
- npm run eslint
# Run tests witch coverage
- npm run coverage
.build_job_template: &build_job_definition
image: docker:18.06.3-ce-git
stage: deploy
script:
# Login in Gitlab Docker Registry
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
# Install build dependencies
- apk update && apk add --no-cache bash curl git jq make perl
- apk --no-cache add --virtual builds-deps build-base python
# - npm rebuild bcrypt --build-from-source
# To add qemu and define IMAGE_ID
- chmod +x .gitlab/load_env.sh
- set -eu
- . .gitlab/load_env.sh
# Build the image
- docker build -f docker/Dockerfile
-t ${IMAGE_ID} --build-arg target=$TARGET
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
--build-arg VERSION=$VERSION
.
# Push the image
- docker push ${IMAGE_ID}
les erreurs dans les tests :
npm install
> bcrypt@3.0.6 install /builds/*****/Gladys/server/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.6/bcrypt_lib-v3.0.6-node-v72-linux-x64-glibc.tar.gz
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.6 and node@12.13.1 (node-v72 ABI, glibc) (falling back to source compile with node-gyp)
make: Entering directory '/builds/*****/Gladys/server/node_modules/bcrypt/build'
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
COPY Release/bcrypt_lib.node
COPY /builds/*****/Gladys/server/node_modules/bcrypt/lib/binding/bcrypt_lib.node
TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/builds/*****/Gladys/server/node_modules/bcrypt/build'
> node-webcrypto-ossl@1.0.48 install /builds/*****/Gladys/server/node_modules/node-webcrypto-ossl
> node-gyp rebuild
make: Entering directory '/builds/*****/Gladys/server/node_modules/node-webcrypto-ossl/build'
CXX(target) Release/obj.target/nodessl/src/main.o
CXX(target) Release/obj.target/nodessl/src/core/key_exp.o
CXX(target) Release/obj.target/nodessl/src/core/scoped_ssl.o
CXX(target) Release/obj.target/nodessl/src/core/logger.o
CXX(target) Release/obj.target/nodessl/src/core/excep.o
CXX(target) Release/obj.target/nodessl/src/core/digest.o
CXX(target) Release/obj.target/nodessl/src/core/bn.o
CXX(target) Release/obj.target/nodessl/src/rsa/rsa_gen.o
CXX(target) Release/obj.target/nodessl/src/rsa/rsa_jwk.o
CXX(target) Release/obj.target/nodessl/src/rsa/rsa_pkcs1.o
CXX(target) Release/obj.target/nodessl/src/rsa/rsa_oaep.o
CXX(target) Release/obj.target/nodessl/src/rsa/rsa_pss.o
CXX(target) Release/obj.target/nodessl/src/ec/ec_gen.o
CXX(target) Release/obj.target/nodessl/src/ec/ec_dsa.o
CXX(target) Release/obj.target/nodessl/src/ec/ec_dh.o
CXX(target) Release/obj.target/nodessl/src/ec/ec_jwk.o
CXX(target) Release/obj.target/nodessl/src/aes/aes_gen.o
CXX(target) Release/obj.target/nodessl/src/aes/aes_ecb.o
CXX(target) Release/obj.target/nodessl/src/aes/aes_cbc.o
CXX(target) Release/obj.target/nodessl/src/aes/aes_gcm.o
CXX(target) Release/obj.target/nodessl/src/aes/aes_ctr.o
CXX(target) Release/obj.target/nodessl/src/hmac/hmac_gen.o
CXX(target) Release/obj.target/nodessl/src/hmac/hmac_sign.o
CXX(target) Release/obj.target/nodessl/src/pbkdf2/pbkdf2_derive.o
CXX(target) Release/obj.target/nodessl/src/node/common.o
CXX(target) Release/obj.target/nodessl/src/node/w_key.o
CXX(target) Release/obj.target/nodessl/src/node/w_aes.o
CXX(target) Release/obj.target/nodessl/src/node/w_hmac.o
CXX(target) Release/obj.target/nodessl/src/node/w_pbkdf2.o
CXX(target) Release/obj.target/nodessl/src/node/w_core.o
CXX(target) Release/obj.target/nodessl/src/node/async_rsa.o
CXX(target) Release/obj.target/nodessl/src/node/async_ec.o
CXX(target) Release/obj.target/nodessl/src/node/async_aes.o
CXX(target) Release/obj.target/nodessl/src/node/async_hmac.o
CXX(target) Release/obj.target/nodessl/src/node/async_pbkdf2.o
CXX(target) Release/obj.target/nodessl/src/node/async_core.o
SOLINK_MODULE(target) Release/obj.target/nodessl.node
COPY Release/nodessl.node
make: Leaving directory '/builds/*****/Gladys/server/node_modules/node-webcrypto-ossl/build'
> sqlite3@4.1.0 install /builds/*****/Gladys/server/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
[sqlite3] Success: "/builds/*****/Gladys/server/node_modules/sqlite3/lib/binding/node-v72-linux-x64/node_sqlite3.node" is installed via remote
> core-js@2.6.10 postinstall /builds/*****/Gladys/server/node_modules/core-js
> node postinstall || echo "ignore"
> nodemon@1.19.4 postinstall /builds/*****/Gladys/server/node_modules/nodemon
> node bin/postinstall || exit 0
Love nodemon? You can now support the project via the open collective:
> https://opencollective.com/nodemon/donate
npm WARN lifecycle gladys-server@~postinstall: cannot run in wd gladys-server@ node ./cli/install_service_dependencies.js (wd=/builds/*****/Gladys/server)
npm WARN gladys-server@ No description
npm WARN gladys-server@ No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 1188 packages from 1428 contributors and audited 5335 packages in 51.181s
found 13 vulnerabilities (1 moderate, 11 high, 1 critical)
run `npm audit fix` to fix them, or `npm audit` for details
$ npm run prettier-check
> gladys-server@ prettier-check /builds/*****/Gladys/server
> prettier --check '**/*.js' '**/*.json'
Checking formatting...
All matched files use Prettier code style!
$ npm run eslint
> gladys-server@ eslint /builds/*****/Gladys/server
> eslint .
/builds/*****/Gladys/server/services/mqtt/index.js
6:24 error Unable to resolve path to module 'mqtt' import/no-unresolved
/builds/*****/Gladys/server/services/philips-hue/index.js
8:29 error Unable to resolve path to module 'node-hue-api' import/no-unresolved
/builds/*****/Gladys/server/services/philips-hue/lib/light/index.js
1:28 error Unable to resolve path to module 'bottleneck/es5' import/no-unresolved
/builds/*****/Gladys/server/services/rtsp-camera/index.js
6:26 error Unable to resolve path to module 'fluent-ffmpeg' import/no-unresolved
/builds/*****/Gladys/server/services/telegram/index.js
10:31 error Unable to resolve path to module 'node-telegram-bot-api' import/no-unresolved
/builds/*****/Gladys/server/services/usb/api/usb.controller.js
13:17 warning Unexpected unnamed function func-names
/builds/*****/Gladys/server/services/usb/index.js
5:30 error Unable to resolve path to module 'serialport' import/no-unresolved
/builds/*****/Gladys/server/services/zwave/index.js
7:25 error Unable to resolve path to module 'openzwave-shared' import/no-unresolved
/builds/*****/Gladys/server/test/benchmark/triggers.js
68:8 warning Unexpected constant condition no-constant-condition
/builds/*****/Gladys/server/test/lib/gateway/GladysGatewayClientMock.test.js
4:33 warning Unexpected unnamed function func-names
✖ 10 problems (7 errors, 3 warnings)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gladys-server@ eslint: `eslint .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gladys-server@ eslint 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/2019-12-05T14_54_43_396Z-debug.log
Le début des erreurs dans le build :
> bcrypt@3.0.6 install /src/server/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.6/bcrypt_lib-v3.0.6-node-v72-linux-x64-musl.tar.gz
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.6 and node@12.13.1 (node-v72 ABI, musl) (falling back to source compile with node-gyp)
make: Entering directory '/src/server/node_modules/bcrypt/build'
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
In file included from ../src/bcrypt_node.cc:1:
../../nan/nan.h: In function 'void Nan::AsyncQueueWorker(Nan::AsyncWorker*)':
../../nan/nan.h:2232:62: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
, reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
^
In file included from ../../nan/nan.h:53,
from ../src/bcrypt_node.cc:1:
../src/bcrypt_node.cc: At global scope:
/root/.cache/node-gyp/12.13.1/include/node/node.h:566:43: warning: cast between incompatible function types from 'void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)' {aka 'void (*)(v8::Local<v8::Object>)'} to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
(node::addon_register_func) (regfunc), \
^
/root/.cache/node-gyp/12.13.1/include/node/node.h:600:3: note: in expansion of macro 'NODE_MODULE_X'
NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
^~~~~~~~~~~~~
../src/bcrypt_node.cc:378:1: note: in expansion of macro 'NODE_MODULE'
NODE_MODULE(bcrypt_lib, init);
^~~~~~~~~~~
In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
from ../../nan/nan.h:53,
from ../src/bcrypt_node.cc:1:
/root/.cache/node-gyp/12.13.1/include/node/v8.h: In instantiation of 'void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]':
/root/.cache/node-gyp/12.13.1/include/node/node_object_wrap.h:84:78: required from here
/root/.cache/node-gyp/12.13.1/include/node/v8.h:10004:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfo<node::ObjectWrap>::Callback' {aka 'void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)'} to 'Callback' {aka 'void (*)(const v8::WeakCallbackInfo<void>&)'} [-Wcast-function-type]
reinterpret_cast<Callback>(callback), type);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/.cache/node-gyp/12.13.1/include/node/v8.h: In instantiation of 'void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]':
../../nan/nan_object_wrap.h:65:61: required from here
/root/.cache/node-gyp/12.13.1/include/node/v8.h:10004:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback' {aka 'void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)'} to 'Callback' {aka 'void (*)(const v8::WeakCallbackInfo<void>&)'} [-Wcast-function-type]
SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
COPY Release/bcrypt_lib.node
COPY /src/server/node_modules/bcrypt/lib/binding/bcrypt_lib.node
TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/src/server/node_modules/bcrypt/build'
> node-webcrypto-ossl@1.0.48 install /src/server/node_modules/node-webcrypto-ossl
> node-gyp rebuild
make: Entering directory '/src/server/node_modules/node-webcrypto-ossl/build'
CXX(target) Release/obj.target/nodessl/src/main.o
Plus de log est dispo si besoin