-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove node-pre-gyp, use prebuildify #890
Remove node-pre-gyp, use prebuildify #890
Conversation
82ade45
to
75ffc8d
Compare
663bac5
to
5956934
Compare
Hey bcryptjs maintainers! I've spent more time on this recently and believe I have a workable solution with github actions (I have a fork of node-sqlite3 ported to prebuildify + gh actions.) It will parallelize tests on multiple nodejs versions and also parallelizes the native build for different platforms (presently linux-{x64,arm,arm64}. May be possible to build for Alpine/musl too. So this now has potential to resolve #858
Aside: While nodeunit should probably be replaced, it still works and changing the test script to |
ff5ef19
to
fbb90b4
Compare
Ok these appear to be in good shape now. I added nodejs 10 and alpine builders to the build matrix as well. You can see the actions run against a PR on my fork here: https://github.com/thom-nic/node.bcrypt.js/pull/1/checks |
af81d7f
to
6aafa54
Compare
I think this is an important issue too. Due to the spread of M1 Macs, many developers have begun to use ARM, which is an increasingly high demand problem. |
Hey there, any idea on when this could get merged? |
Let's merge it. Can you rebase it again with some changes in main? |
The latest release got rid of nodeunit and tap |
I will rebase this week |
@thom-nic I made an attempt at rebasing over here.
With these changes the build is passing for me, as you can see here. I should also notice that I am by no means an expert in building native node extensions, and just followed your changes. So please have a careful look/feel free to discard everything I did. |
when is this getting merged? |
What exactly is the state of this PR? @thom-nic @recrsn I wouldn't mind forking myself and applying the changes from this PR, or do anything else I can to help promote #665 |
This PR is two years old, seems like we're all on our own :( Good luck y'all. |
Added Dockerfiles for cross-platform build.
6aafa54
to
44dfae8
Compare
44dfae8
to
cf1d061
Compare
Apparently node-gyp just published v10 over the weekend and dropped support for nodejs 14. I pinned the installed version in the dockerfiles. FWIW the nodejs version used when building is independent of the runtime nodejs version support. I verified this by building running the build on node 18 then changing to node v14 and running the test suite. |
do not do CI as part of test
Test by using the Alpine dockerfiles now
@recrsn do you plan to drop the appveyor and travis CI? |
9187b6a
to
28a7198
Compare
Ok only using two dockerfiles with |
Yes |
9f591e3
to
64d6e23
Compare
I think I mostly have CI running correctly. I have the workflows running on another branch in a private repo and I believe it's working or very close to. For some reason the arm64 workflow is taking forever at the moment (~20 minutes+) before it fails because the repetition tests timeout. It was much faster before so I'm not sure what changed or if there's some hiccup in github's infra at the moment. Worth pointing out, the original |
64d6e23
to
fdfa667
Compare
Github is releasing arm64 runners soon, so if the tests are taking forever, we can hold it off for a while. Meanwhile, I already use a Mac and two RPIs to test releases. |
fdfa667
to
ae21bf1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good now
@recrsn would it be possible to cut a release for this, please? It happens to also remove a vulnerable dependency, which I'm sure will start to nag people's CI systems :) |
Added Dockerfiles for cross-platform build on linux-x64, arm64 and arm32.
Note that on ARM platforms unit tests presently fail :(Tests pass on all architectures (x64,arm,arm64/glibc and musl) and nodejs versions (10,12,14,16 x64/glibc)Note if you want to run/debug unit tests in an interactive environment it's possible to
docker run -it blah/bcryptjs-linux-armhf-builder
which will start a bash session inside the container.Edit: I should mention, the tests have probably always failed on ARM in a way that has nothing to do with prebuildify or docker/ARM emulation. I did try to checkout the master branch on an arm device and run the tests, and IIRC they failed the same way. But the good news is, now it's easy to do full cross-platform build and test in CI using these arm32 and arm64 docker images.This is all fixed.Edit 2: worth noting, the package/ release process needs to be updated a bit. Unlike node-pre-gyp which would download a platform specific prebuilt archive, prebuildify publishes all prebuilt binaries to NPM (or github nodejs registry). So while CI could paralellize builds for different platforms, each prebuild artifact needs to be collected into a single unified folder before publishing to NPM. i.e. when you do an
npm publish
your folder structure should look like this:So I'm not yet clear on what an automated CI publish process would look like. Basically you need a sort of "reducer" step that runs after all of the parallel platform-specific prebuilds have completed. I've been playing with github actions and think there's a workable solution there.See comment below I have github actions working now.Fixes #858
Fixes #665