Ansible Vs Cygwin

with tags ansible cywin pip cffi -

New year, New job, New laptop.

As part of the fun and games when changing job I’ve been handed a windows laptop and rather than immediately running off and installing a Linux distro or whining till they gave me a mac I decided to stick with it. Unfortunately due to $Reasons, upgrading to Win10 anniversary edition to make use of the windows subsystem for linux is also out :(

Cygwin to save the day

So after installing all the usual tools I found I need to be able to work with ansible for which there is no windows binary and rather than having to bother with jumping onto a local vm every time I wanted to play with it I figured it can’t be that hard to get working … and it wasn’t except for one little package.

When attempting to run pip install ansible the cryptography dependency kept bombing out on install

Installing collected packages: cryptography, paramiko, jinja2, PyYAML, ansible
 Running install for cryptography ... error
   Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-L55Y3E/cryptography/';f=getattr(tokenize, 'open', open)(__file__);'\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-BRA9am-record/install-record.txt --single-version-externally-managed --compile:
   Traceback (most recent call last):
     File "<string>", line 1, in <module>
     File "/tmp/pip-build-L55Y3E/cryptography/", line 334, in <module>
     File "/usr/lib/python2.7/distutils/", line 111, in setup
       _setup_distribution = dist = klass(attrs)
     File "/usr/lib/python2.7/site-packages/setuptools/", line 320, in __init__
       _Distribution.__init__(self, attrs)
     File "/usr/lib/python2.7/distutils/", line 287, in __init__
     File "/usr/lib/python2.7/site-packages/setuptools/", line 387, in finalize_options
       ep.load()(self,, value)
     File "/usr/lib/python2.7/site-packages/cffi/", line 187, in cffi_modules
       add_cffi_module(dist, cffi_module)
     File "/usr/lib/python2.7/site-packages/cffi/", line 49, in add_cffi_module
       execfile(build_file_name, mod_vars)
     File "/usr/lib/python2.7/site-packages/cffi/", line 25, in execfile
       exec(code, glob, glob)
     File "src/_cffi_src/", line 85, in <module>
     File "/tmp/pip-build-L55Y3E/cryptography/src/_cffi_src/", line 61, in build_ffi_for_binding
     File "/tmp/pip-build-L55Y3E/cryptography/src/_cffi_src/", line 70, in build_ffi
     File "/usr/lib/python2.7/site-packages/cffi/", line 106, in cdef
       self._parser.parse(csource, override=override, packed=packed)
     File "/usr/lib/python2.7/site-packages/cffi/", line 165, in parse
     File "/usr/lib/python2.7/site-packages/cffi/", line 199, in _internal_parse
       realtype = self._get_type(decl.type,
     File "/usr/lib/python2.7/site-packages/cffi/", line 356, in _get_type
       return resolve_common_type(ident)
     File "/usr/lib/python2.7/site-packages/cffi/", line 38, in resolve_common_type
       "if you think it should be." % (commontype,))
   cffi.api.FFIError: Unsupported type: 'int __dotdotdot__'.  Please file a bug if you think it should be.

Fortunately this was quickly remedied by a quick pip uninstall ciff followed by rerunning pip install ansible

I’ve not yet bothered to dig into how I managed to break the cffi package but a quick reinstall did the job and I can now ansible locally to my hearts content.

Written by
Older article
AWS Renewal