measurement-kit / measurement-kit-node

Node.js bindings for measurement-kit [discontinued]
https://measurement-kit.github.io
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Have you considered making prebuilt binaries? #9

Open ralphtheninja opened 6 years ago

bassosimone commented 6 years ago

Not yet, but this is something we most likely want to do. Do you know how other projects obtain a similar objective? Is the final goal to download the binaries when running npm install?

ralphtheninja commented 6 years ago

Not yet, but this is something we most likely want to do. Do you know how other projects obtain a similar objective?

I'm one of the maintainers for leveldown and we automatically build binaries for linux and Windows using prebuild and prebuild-ci.

Is the final goal to download the binaries when running npm install?

Exactly. We use prebuild-install which downloads prebuilt binaries from GitHub. If no prebuilt can be found it falls back to a compile step. prebuild-install caches the binaries in ~/.npm/_prebuilds as well so when installing it checks the cache first.

ralphtheninja commented 6 years ago

Forgot to mention that we also build for osx and electron. Electron is a bit special since we build that for linux, osx and windows.

ralphtheninja commented 6 years ago

Our workflow (the level org) is basically:

Once the binaries are built, we do npm publish. The reason for this is to make sure the binaries are already built before someone tries to do npm install on the newest version.

As an example of what it can look like after a successful build, see e.g. https://github.com/Level/leveldown/releases/tag/v2.1.1 (which is a GitHub release with included binaries)

prebuild-install then picks binaries from this release (if not already downloaded and cached), unpacks the .tar.gz, tries to do require() as a test that the binary actually can be required on the local system.

bassosimone commented 6 years ago

@ralphtheninja thanks for the detailed explanation!

I would say now it's a bit too early to bless a real release and hence make packages available. As @hellais proceeds with creating the OONI probe apps and we can be more confident around the Node bindings, I believe we should really consider going down the road you propose.

ralphtheninja commented 6 years ago

@bassosimone I can help you set it up of course. Ping me when the time is right :) I can even swing by Italy for a weekend. Ooni is an awesome project and I'd like to help out.