zeromq.node icon indicating copy to clipboard operation
zeromq.node copied to clipboard

Static link zmq

Open leonpegg opened this issue 10 years ago • 14 comments

It would be nice if the zeromq library was statically linked into the node binding. this would reduce the amount of install problems

leonpegg avatar Jan 16 '15 17:01 leonpegg

I agree it would resolve most issues people have, and would allow us to stay uptodate with ZMQ's releases independent of peoples' environments (whether that's a positive or a negative can be debated).

Arguments for or against welcome!

ronkorving avatar Jan 22 '15 02:01 ronkorving

so like a pre-compilied lib directory with a .a file of libzmq for every single platform and architecture where iojs/node gets shipped? damn.. we'll probably need a speadsheet for starters..

if we supported a matrix of zmq versions, shit, that npm package would be among the fatest and largest known downloads on npm. but potentially everyone would be happy. imagine no matter where node works you could hit the ground running with a bunch of zmq sockets and no trouble. sounds like paradise :palm_tree:

i guess we could potentially combat the fatness by breaking it up into subpackages with platform specific static libs that the install script just somehow figures out how to pull down accordingly, or dont even use npm, but maybe do tagged releases on github and download them from a shell script like how nvm works... is that what we're talking about here?

reqshark avatar Jan 22 '15 04:01 reqshark

Rather than static linking, bundling the source could work. But it's GPL, so I'm guessing that would not be legal. We could also do what node-sqlite3 seems to do, which is download it and build it on demand.

ronkorving avatar Jan 22 '15 06:01 ronkorving

I am for the bundling the source, and downloading on demand for avoid GPL issues. We use zeromq.node in a distributed system and the deploy systems vary, it would also simplify our docker version as would not have to install any additional packages.

I could try and work on this and provide a pull request, though my experience in this type of thing is limited.

leonpegg avatar Jan 22 '15 14:01 leonpegg

by all means! and at that point i think we'd need to bump this repo to version 3

reqshark avatar Jan 22 '15 14:01 reqshark

Ok, I have started work on a commit regarding linking local version of libzmq downloaded and compiled for OS X (my default os)

leonpegg avatar Jan 22 '15 16:01 leonpegg

@reqshark a bump would be appropriate. By the way, this would be a great opportunity to unify the Windows and *Nix flavors of this module.

ronkorving avatar Jan 23 '15 02:01 ronkorving

@ronkorving is the windows version separate from this module? also what would be your opinions on using node-pre-gyp to supply precompiled library

leonpegg avatar Jan 23 '15 08:01 leonpegg

I have no knowledge on that, so no opinion yet either. Regarding Windows, see: https://github.com/JustinTulloss/zeromq.node/tree/master/windows

ronkorving avatar Jan 23 '15 08:01 ronkorving

Thanks

leonpegg avatar Jan 23 '15 09:01 leonpegg

Node-pre-gyp seems like a good solution for many problems of this nature. @springmeyer would you recommend using node-pre-gyp for this purpose?

kkoopa avatar Jan 23 '15 10:01 kkoopa

:+1: for node-pre-gyp. I'd love to see pre-built binaries available for zeromq.node, to make installation easier for all my packages that rely on it in primarily desktop applications (Electron based).

rgbkrk avatar Sep 18 '15 02:09 rgbkrk

Rather than static linking, bundling the source could work. But it's GPL, so I'm guessing that would not be legal.

libzmq's license is "LGPL with a static linking exception", i.e. static linking should be treated the same as dynamic linking. A binary that statically links libzmq specifically does not inherit LGPL.

minrk avatar Feb 08 '16 09:02 minrk

Ah, you're right. That's great.

ronkorving avatar Feb 08 '16 12:02 ronkorving