aitjcize / cppman

C++ 98/11/14 manual pages for Linux/MacOS
GNU General Public License v3.0
1.27k stars 79 forks source link

[Suggestion] Windows support #85

Closed williamjcm closed 5 years ago

williamjcm commented 5 years ago

Currently, cppman fails on Windows (I use MSYS2) with the following error:

Traceback (most recent call last):
  File "C:/msys64/mingw64/bin/cppman", line 40, in <module>
    from cppman.main import Cppman
  File "C:/msys64/mingw64/lib/python3.7/site-packages\cppman\main.py", line 36, in <module>
    from cppman import util
  File "C:/msys64/mingw64/lib/python3.7/site-packages\cppman\util.py", line 25, in <module>
    import fcntl
ModuleNotFoundError: No module named 'fcntl'

This answer on StackOverflow mentions a cross-platform module that could be used instead of fcntl, and could therefore make cppman compatible (or at least more compatible) with Windows (and by extension MSYS2).

aitjcize commented 5 years ago

What shell are you using on windows? I can create a patch for you to test it out, since I don't have a windows machine to verify whether or not it works.

williamjcm commented 5 years ago

MSYS2 uses Bash as its default shell.

SGSSGene commented 5 years ago

I removed the dependency to fcntl. Since I don't have windows I can't try it out. I would be happy if you could check if this works now.

williamjcm commented 5 years ago

So, I just tried it with MSYS2, and it works correctly.

Note: I had to build cppman using the Python packages in MSYS2's msys repo, as it supports the termios module. The Python packages in MSYS2's mingw32 and mingw64 repos are built to be 100% compatible with native Windows apps, while the one in msys is linked against MSYS2's POSIX compatibility/emulation layer, and therefore has access to some POSIX-only Python modules.

SGSSGene commented 5 years ago

That is good news. Also thank you for explaining how you made it work. This is helpful for others.