erickt / rust-zmq

Rust zeromq bindings.
Apache License 2.0
900 stars 194 forks source link

Fix errno::EPROTO build error on openbsd #171

Closed kpcyrd closed 7 years ago

kpcyrd commented 7 years ago

EPROTO is undefined on openbsd, so this works around the build failure.

I wrote a small program using rust-zmq and the library works nicely after this patch. Can you please cherrypick this commit and release it as 0.8.2? :)

Fixes #170

kpcyrd commented 7 years ago

I've investigated further and it turned out that libzmq solved that problem this way:

// EPROTO is not used by OpenBSD and maybe other platforms.
#ifndef EPROTO
#define EPROTO 0
#endif

https://github.com/zeromq/libzmq/blob/d514bb598a1ad10e0faebd53215675f94d31198c/src/err.hpp#L51-L54

I might have to set it to 0 as well, though, I believe this is incorrect and should be changed in libzmq.

kpcyrd commented 7 years ago

I've talked to the nice folks in #openbsd and found the openbsd patchset for zeromq, EPROTO is replaced with EOPNOTSUPP, so I've aligned my patch to reflect that.

The build is still failing on nightly, that shouldn't be related to my changes, though.

rotty commented 7 years ago

I've now pushed this to the release/v0.8 after rebasing and squashing the commits -- thanks!

kpcyrd commented 7 years ago

@rotty thanks! you might need to apply this patch to master as well, so future releases won't have the same issue :)

Would you mind bumping the version with a patch release so I can reference a working version in my Cargo.toml?

rotty commented 7 years ago

I'll do a patch release; merging release/v0.8 into master is currently on hold, as there are API design issues I need a bit more thinking about.