{"action":"created","issue":{"url":"https://api.github.com/repos/P-H-C/phc-winner-argon2/issues/44","labels_url":"https://api.github.com/repos/P-H-C/phc-winner-argon2/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/P-H-C/phc-winner-argon2/issues/44/comments","events_url":"https://api.github.com/repos/P-H-C/phc-winner-argon2/issues/44/events","html_url":"https://github.com/P-H-C/phc-winner-argon2/issues/44","id":121305849,"number":44,"title":"Compilation on Visual Studio/MSVC 9","user":{"login":"hynek","id":41240,"avatar_url":"https://avatars.githubusercontent.com/u/41240?v=3","gravatar_id":"","url":"https://api.github.com/users/hynek","html_url":"https://github.com/hynek","followers_url":"https://api.github.com/users/hynek/followers","following_url":"https://api.github.com/users/hynek/following{/other_user}","gists_url":"https://api.github.com/users/hynek/gists{/gist_id}","starred_url":"https://api.github.com/users/hynek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hynek/subscriptions","organizations_url":"https://api.github.com/users/hynek/orgs","repos_url":"https://api.github.com/users/hynek/repos","events_url":"https://api.github.com/users/hynek/events{/privacy}","received_events_url":"https://api.github.com/users/hynek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-12-09T18:09:53Z","updated_at":"2015-12-09T20:38:39Z","closed_at":null,"body":"Hi,\r\n\r\ncontext: I’ve built friendly CFFI-base [Python wrappers](https://github.com/hynek/argon2_cffi) that work over all Python version and implementations (PyPy…).  I also vendor Argon2 and want to offer binary packages (called wheels) for Windows.\r\n\r\nThis may become a story of multiple tickets I’m afraid since I’m not too skilled WRT Windows.  Anyhow but the first problem I’ve run into is that Argon2 currently can’t be compiled using MSVC 9.0 (which I believe is VS 2008) which unfortunately is the one you have to use for Python 2.7 extensions (Microsoft even put it online just for that reason: [Microsoft Visual C++ Compiler for Python 2.7\r\n](http://www.microsoft.com/en-us/download/details.aspx?id=44266))\r\n\r\nThe first problem I ran into is that you’re including `inttypes.h` which VS 2008 lacks.  I was able to work around that one by dropping http://msinttypes.googlecode.com/svn/trunk/stdint.h into the repo and change the includes.\r\n\r\nAs such, I was able to compile most of the project:\r\n\r\n```\r\nbuilding 'libargon2' library\r\nC:\\Users\\Hynek Schlawack\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe /c /nologo /Ox\r\n/MD /W3 /GS- /DNDEBUG -Ilibargon2/src -Ilibargon2/src/blake2 /Tclibargon2/src/argon2.c /Fobuild\\temp.win32-2.7\\libargon2\r\n/src/argon2.obj\r\nargon2.c\r\nC:\\Users\\Hynek Schlawack\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe /c /nologo /Ox\r\n/MD /W3 /GS- /DNDEBUG -Ilibargon2/src -Ilibargon2/src/blake2 /Tclibargon2/src/blake2/blake2b.c /Fobuild\\temp.win32-2.7\\l\r\nibargon2/src/blake2/blake2b.obj\r\nblake2b.c\r\nC:\\Users\\Hynek Schlawack\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe /c /nologo /Ox\r\n/MD /W3 /GS- /DNDEBUG -Ilibargon2/src -Ilibargon2/src/blake2 /Tclibargon2/src/core.c /Fobuild\\temp.win32-2.7\\libargon2/s\r\nrc/core.obj\r\ncore.c\r\nC:\\Users\\Hynek Schlawack\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe /c /nologo /Ox\r\n/MD /W3 /GS- /DNDEBUG -Ilibargon2/src -Ilibargon2/src/blake2 /Tclibargon2/src/encoding.c /Fobuild\\temp.win32-2.7\\libargo\r\nn2/src/encoding.obj\r\nencoding.c\r\nlibargon2/src/encoding.c(407) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprint\r\nf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.\r\n        C:\\Users\\Hynek Schlawack\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Include\\stdio.h(36\r\n6) : see declaration of 'sprintf'\r\nlibargon2/src/encoding.c(409) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprint\r\nf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.\r\n        C:\\Users\\Hynek Schlawack\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Include\\stdio.h(36\r\n6) : see declaration of 'sprintf'\r\nlibargon2/src/encoding.c(411) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprint\r\nf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.\r\n        C:\\Users\\Hynek Schlawack\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Include\\stdio.h(36\r\n6) : see declaration of 'sprintf'\r\nC:\\Users\\Hynek Schlawack\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe /c /nologo /Ox\r\n/MD /W3 /GS- /DNDEBUG -Ilibargon2/src -Ilibargon2/src/blake2 /Tclibargon2/src/opt.c /Fobuild\\temp.win32-2.7\\libargon2/sr\r\nc/opt.obj\r\nopt.c\r\nlibargon2/src/opt.c(18) : fatal error C1083: Cannot open include file: 'immintrin.h': No such file or directory\r\nerror: command 'C:\\\\Users\\\\Hynek Schlawack\\\\AppData\\\\Local\\\\Programs\\\\Common\\\\Microsoft\\\\Visual C++ for Python\\\\9.0\\\\VC\\\r\n\\Bin\\\\cl.exe' failed with exit status 2\r\n```\r\n\r\nAnd I really don’t know how to fix that one…\r\n\r\n***\r\n\r\nTo be clear: this means it’s currently impossible to build Python 2 (still 90+% of the landscape) packages on Windows.\r\n\r\n***\r\n\r\n## Steps to reproduce (tested on Windows 10):\r\n\r\n1. Install [Microsoft Visual C++ Compiler for Python 2.7](http://www.microsoft.com/en-us/download/details.aspx?id=44266)\r\n1. Install [Python 2.7.11](https://www.python.org/downloads/release/python-2711/)\r\n1. `git clone https://github.com/hynek/argon2_cffi` and `cd` into it.\r\n1. `git submodules update` to pull in your library.\r\n1. Install virtualenv:  `C:\\Python27\\Scripts\\pip.exe install virtualenv`\r\n1. create a virtualenv:  `C:\\Python27\\Scripts\\virtualenv.exe venv`\r\n1. try to build a wheel using that virtualenv: `.\\venv\\Scripts\\python.exe .\\setup.py bdist_wheel`\r\n\r\nBehold the fail.\r\n\r\n***\r\n\r\nI’m sorry. :(\r\n\r\nI really hope we can get this working on all platforms as I’d like to establish Argon2 in the Python community.  But that impossible if it doesn’t work on 2.7/Windows…\r\n\r\nAnd tomorrow I’ll try to get it working on Python 3. :-/"},"comment":{"url":"https://api.github.com/repos/P-H-C/phc-winner-argon2/issues/comments/163385198","html_url":"https://github.com/P-H-C/phc-winner-argon2/issues/44#issuecomment-163385198","issue_url":"https://api.github.com/repos/P-H-C/phc-winner-argon2/issues/44","id":163385198,"user":{"login":"sneves","id":1407263,"avatar_url":"https://avatars.githubusercontent.com/u/1407263?v=3","gravatar_id":"","url":"https://api.github.com/users/sneves","html_url":"https://github.com/sneves","followers_url":"https://api.github.com/users/sneves/followers","following_url":"https://api.github.com/users/sneves/following{/other_user}","gists_url":"https://api.github.com/users/sneves/gists{/gist_id}","starred_url":"https://api.github.com/users/sneves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sneves/subscriptions","organizations_url":"https://api.github.com/users/sneves/orgs","repos_url":"https://api.github.com/users/sneves/repos","events_url":"https://api.github.com/users/sneves/events{/privacy}","received_events_url":"https://api.github.com/users/sneves/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T20:38:39Z","updated_at":"2015-12-09T20:38:39Z","body":"It was actually something much simpler---a C99-style declaration was still existing in the `BLAKE2_ROUND` macros. Fixed in latest commit."}}