node-bluetooth-serial-port icon indicating copy to clipboard operation
node-bluetooth-serial-port copied to clipboard

Distribute binaries

Open eelcocramer opened this issue 7 years ago • 9 comments

Currently to install this module you need a build environment present on the machine you want to install the module on.

It would be better and more user friendly to distribute the binaries that are build during automated builds.

See also:

  • https://www.npmjs.com/package/prebuild-install
  • https://github.com/node-serialport/node-serialport/blob/master/PUBLISHING.md

#173

eelcocramer avatar Jan 26 '18 08:01 eelcocramer

I understand this is to auto build binaries using "pre-build" but that doesn't seem realistic to me if it takes 1 hour to download the binaries. Is there any small version of the binaries? The visual studio library for windows is approx 500MB, is there another set of files we can use or a partial selection of files we could extract from visual studio to decrease the size of the download?

Then, at that point, we could implement something like above which would automate everything. I think first though, we would have to find an alternative source of a much smaller size. Thanks...

wayofthefuture avatar May 19 '18 14:05 wayofthefuture

The prebuild binaries are tiny compared to visual studio. You can check their size in the build folder after install. I think the suffix is ‘.node’

eelcocramer avatar May 19 '18 16:05 eelcocramer

So I guess maybe if I can isolate these files, I could put a script in node "prebuild" to move them to the appropriate place before installing?

wayofthefuture avatar May 20 '18 20:05 wayofthefuture

Sort off. It just something that needs to be configured but its currently not on my priority list.

eelcocramer avatar May 20 '18 21:05 eelcocramer

It seems that the large dependency is actually a dependency of Node-GYP, so there is really no way to pluck the small files for a build. I think at this point, I will have to locate the ".node" files and copy them into the repository. Then at that point, remove the node-gyp dependency and the build.

Obviously, I'd have to fork this repo and publish as something like: node-bluetooth-serial-port-windows, which would already be prebuilt for windows. This way, the dependency would install in seconds and wouldn't require such a huge download.

Do you see any problems with this? Would the ".node" file work on various Windows 10 computers, or would something as simple as a chipset difference break the build? Thanks...

wayofthefuture avatar May 21 '18 23:05 wayofthefuture

Sure, that would work but I see numerous problems.

First of all it is just annoying and error prone to have to manually do this every release. It is not the wayofthefuture :-) (pun intended)

But the real problem is thrust and accountability. When a continues integration script build and releases the binaries the binaries can be tracked to a specific commit and a build server like travis or appveyor acts like a trusted 3rd party that builds the binary on well monitored infrastructure. These parties make sure that the binaries are virus / malware free.

eelcocramer avatar May 22 '18 07:05 eelcocramer

By the way, the module does not have a dependency of node-gyp. It needs to be present to be able to build. It is present on the CI servers. The work that needs to be done is that the build servers push back the binary files to the repository so they can be included in the distribution package that is pushed to npm.

eelcocramer avatar May 22 '18 07:05 eelcocramer

Do the CI servers have the ability to build Windows binaries which would then be compatible with Windows operating systems?

wayofthefuture avatar May 22 '18 13:05 wayofthefuture

Yes this is already done after each commit to this repository. All platforms are being build against a selected set of nodejs to check whether the commit introduced a build error. See also the images in the top of the readme.

eelcocramer avatar May 22 '18 14:05 eelcocramer