node.bcrypt.js
node.bcrypt.js copied to clipboard
Move to prebuild
node-pre-gyp
has been causing a lot of installation errors. Move to prebuilt. This should fix most of the installation errors.
This task is high priority
+1
I've created a branch that uses prebuildify. https://github.com/thom-nic/node.bcrypt.js/tree/prebuildify-and-docker-build
It builds locally on darwin-x64 and I can create prebuilds in a Docker container for linux-x64. I have Dockerfile definitions to cross-build for armhf and aarch64. Builds succeed on both of those environments however unit tests fail. I would love to get some eyes on the failing tests.
Basic prebuildify usage:
npm i -g prebuildify node-gyp
npm run build # calls `prebuildify`
To start with Docker for cross-platform build, do this from my branch:
# Build everything and run unit tests:
docker build -t thom/bcryptjs-linux-x64-builder .
# Create a container just so we can copy the artifacts from the container to host (for deployment)
docker create --name donut thom/bcryptjs-linux-x64-builder
docker cp donut:/usr/local/opt/bcrypt-js/prebuilds .
Then you'll see (on MacOS, have already built locally):
± ls -lF prebuilds
total 0
drwxr-xr-x 3 thom staff 96 Sep 2 22:20 darwin-x64/
drwxr-xr-x 3 thom staff 96 Sep 2 22:20 linux-x64/
To run the armhf build, it is similar but add -f to choose a different docker file:
docker build -t thom/bcryptjs-linux-aarch64-builder -f Dockerfile-aarch64 .
To not run the failing tests then start an interactive session for test/debugging, do:
docker build -t thom/bcryptjs-linux-aarch64-builder -f Dockerfile-aarch64 --build-arg=RUN_TESTS=false .
docker run -it --name donut-aarch64 thom/bcryptjs-linux-aarch64-builder /bin/bash -l
As a baseline I'm going to try running the unit tests on a native armhf device and see if unit tests pass or fail there.
The docker files were inspired by node-sqlite3 and I've adapted it for cross-platform builds with prebuildify in that project. Feedback welcome.
Thanks a lot @thom-nic
@recrsn would you like me to submit a PR? I made some tweaks so it is as merge-friendly as possible.
@thom-nic Please submit a PR, I can check why the tests are failing
@recrsn Any idea when v6 will be released?