-
Notifications
You must be signed in to change notification settings - Fork 226
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
zeromq should depend on libsodium #515
Comments
Agreed. I tried to get this working for the 2.4 release, but it didn't quite make it. We will have this shortly on all platforms - Windows included. |
Awesome, thanks. |
@minrk how do you build/obtain libsodium for VS2008 (Py2.7 support?) It seems like they even omit VS2010 in their latest prebuilt distributions. Are they using C++11 stuff that requires VS2012+? If so, then we'll only be able to support libsodium for Py3.5+, or alternatively, pin an older version of libsodium. Thoughts on what might be most attractive? |
Yikes. I don't know. When I build libsodium with pyzmq on Windows, I let Python compile it as an Extension rather than using VS to build it as a standalone library. My Windows-building expertise is lacking. |
Thanks - I think there are no issues with compiling with VS2008. The upstream guys probably just don't want to deal with supporting old build solutions. What's the state of pyzmq 15.0.0? Should I bundle that, or stick with 14.7? What does that major version bump mean, and does it break anything I should be wary of? |
The main 'breaking' change in 15 is that it changes how it builds when old libzmq is found on the system, which won't affect conda. The Python API is stable. |
FWIW, I have a PR to add Win support to libsodium at conda-forge/libsodium-feedstock#7 |
Do you mean "on Windows" here? On Linux it does at least depend on and install both
I will update after some more tests. |
libzmq.so gets loaded, but libsodium.so does not. I believe there's still an issue with the build of zeromq here. |
@migwandroid, I'll check again, maybe I accidentally used pip. Also, I deleted my comment since I thought I had posted it in the wrong project, but since you replied, here it is again for anyone else reading: conda install pyzmq on linux doesn't pull in zeromq or libsodium, it appears to be using the version of zeromq bundled with pyzmq (which pyzmq uses only if it can't find libzmq at compile time), which pyzmq compiles without libsodium. This results in slow encryption in pyzmq because the bundled tweetnacl library that comes with zmq is much slower than libsodium. Encryption would be much faster if the conda pyzmq package was compiled against the conda zeromq package, which itself is compiled with the conda libsodium package, instead of using pyzmq's bundling method. Pyzmq docs recommend compiling against system zeromq, they only provide the bundling mechanism for convenience. |
@jjhelmus has recently uploaded new builds of zeromq, it would be good if you can test them. This is the correct place and issue at which to report this. |
The version 17.0.0 pyzmq packages do pull in libsodium and zeromq and the Python libraries link against libzeromq. Although installing, I'm not seeing libsodium being loaded which seems suspect. |
Link to the original report (with a testcase) |
My mistake, looks like I got the dependencies wrong, pyzmq does depend on zeromq and libsodium. But yes, as in the pyzmq bug report, the original observation was that conda pyzmq has observably slow crypto compared to the Ubuntu repo's pyzmq, indicating libsodium not being used, and then I leapt to conclusions about pyzmq bundling. Confirmed with the testcase from the pyzmq report that crypto is slow with latest conda zeromq and pyzmq (6.5 seconds compared to about 0.5 seconds on my computer with system pyzmq):
|
@mingwandroid and myself noticed an incorrect argument in the recipe we were using to build zeromq which resulted in zeromq not using libsodium. New build are on their way that should fix this. |
I believe we've fixed this in the recipe now. Package builds should be available soon, hopefully. |
Oops, seems our messages crossed each other! |
zeromq packages which use libsodium for crypto are now available. These are build
A significant improvements over the previous build of zeromq:
as well as the 4.2.2 version of the zeromq:
|
This has regressed, I am once again seeing slow crypto in pyzmq as shipped by Anaconda in Windows. It looks like the zeromq package is no longer being built with libsodium on Windows as of 4.3.2. Here is a test script that prints dlls from the import os
import psutil
import zmq
for dll in psutil.Process(os.getpid()).memory_maps():
if 'Library' in dll.path:
print(dll.path)
But after downgrading to zeromq 4.3.1 libsodium is listed as well: click to see output of downgrade command
And this lines up with the observed crypto speed, being slower when lisodium is not loaded. |
The zeromq package should be built against libsodium to provide encryption and authentication support. The version in conda-recipes does this, except on Windows.
The text was updated successfully, but these errors were encountered: