zeromq/pyzmq — pull request #625 by edisongustavo (2014-12-06 20:10:10+00:00)
Title: when setup.py receives --debug it will put '_d' on the library name

If I have a python compiled locally in [debug mode](https://docs.python.org/2/c-api/intro.html#debugging-builds) then I won't be able to compile the library since it says that the `libzmq` library was not found.

The problem is that the `libzmq_d.pyd` is created the linker doesn't know about this filename.

# Motivation

I wanted to use IPython with [Python Debug Builds](https://docs.python.org/2/c-api/intro.html#debugging-builds) and `pyqmz` is a dependency.

# Tests

I'm running Windows 7 - 64bits, Python 2.7.7.

[*Pytest*](http://pytest.org) was used to run the tests.

These *python 2* versions were tested against:

# 32 bits - debug

No failures.

# 32 bits - release

`TestMonitoredQueue.test_router_router` failed:

```
____________________ TestMonitoredQueue.test_router_router ____________________

self =

def test_router_router(self):
"""test router-router MQ devices"""
dev = devices.ThreadMonitoredQueue(zmq.ROUTER, zmq.ROUTER, zmq.PUB, b'in', b'out')
self.device = dev
dev.setsockopt_in(zmq.LINGER, 0)
dev.setsockopt_out(zmq.LINGER, 0)
dev.setsockopt_mon(zmq.LINGER, 0)

binder = self.context.socket(zmq.DEALER)
porta = binder.bind_to_random_port('tcp://127.0.0.1')
portb = binder.bind_to_random_port('tcp://127.0.0.1')
binder.close()
time.sleep(0.1)
a = self.context.socket(zmq.DEALER)
a.identity = b'a'
b = self.context.socket(zmq.DEALER)
b.identity = b'b'
self.sockets.extend([a, b])

a.connect('tcp://127.0.0.1:%i'%porta)
dev.bind_in('tcp://127.0.0.1:%i'%porta)
b.connect('tcp://127.0.0.1:%i'%portb)
dev.bind_out('tcp://127.0.0.1:%i'%portb)
dev.start()
time.sleep(0.2)
if zmq.zmq_version_info() >= (3,1,0):
# flush erroneous poll state, due to LIBZMQ-280
ping_msg = [ b'ping', b'pong' ]
for s in (a,b):
s.send_multipart(ping_msg)
try:
s.recv(zmq.NOBLOCK)
except zmq.ZMQError:
pass
msg = [ b'hello', b'there' ]
a.send_multipart([b'b']+msg)
> bmsg = self.recv_multipart(b)

test_monqueue.py:203:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
f:\Shared\dist\12.0-win32\pyzmq-14.4.1\lib\site-packages\zmq\tests\__init__.py:169: in recv_multipart
return self._select_recv(True, socket, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
multipart = True, socket =
kwargs = {}, r = [], w = [], x = []

def _select_recv(self, multipart, socket, **kwargs):
"""call recv[_multipart] in a way that raises if there is nothing to receive"""
if zmq.zmq_version_info() >= (3,1,0):
# zmq 3.1 has a bug, where poll can return false positives,
```

However, If I run this test alone it passes:

```
dist-12.0-win32 $ pytest test_monqueue.py -k test_router_router -v
test_monqueue.py::TestMonitoredQueue::test_router_router PASSED
```

# 64 bits - debug

The same situation as "win32 release" happens

# 64 bits - release

no failures