New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support for MSYS2 in Windows #1605
Comments
if you're using both msys git and msys python this works as intended -- there's supposed to be a warning for this but it's possible that it crashes too early to show that warning now Lines 180 to 197 in 3e2b9dc
|
Yes, I am using msys2 Python and msys2 git in a virtualenv. |
if sys.platform is win32 this is the windows-like python and not the msys-like python so this is a mismatch. this combination is unsupported |
@asottile No, msys2 Python returns win32. Look at my version information above. It is Python compiled with GCC (mingw64) and sys.platform is win32. This is what is expected in msys2. I did say it is a niche platform, it is definitely a strange one 😄 |
no I'm very familiar with what you're saying, the problem is that you're best to use the posix-like pythons with posixlike git: https://github.com/asottile/scratch/wiki/platforms#msys2-msys-cpython-3x-64-bit vs https://github.com/asottile/scratch/wiki/platforms#msys2-mingw64-cpython-3x-64-bit |
@asottile Ahh, OK, I see what you are saying. Thanks for further explaining! MSYS2 compiled packages run on Windows using a POSIX emulation layer, in this case that would be the msys/python package. I am developing for Windows directly using the Win32 API with MINGW, and I'm using the mingw-w64-x86_64-python package. My program doesn't depend on being in POSIX, so using an emulation layer isn't desired. Sorry, I should have been more clear about my use case in the initial issue description. This is the supported way to run GTK applications in Windows. The maintainer the PyGObject bindings has packaged Quod Libet the same way. I understand though if you don't want to support this use case. 👍 I'll either not use pre-commit when developing in Windows or patch it downstream. |
If anyone stumbles on this issue in the future and you want to run MINGW Python:
Git-for-windows is compiled using MINGW64 as well, and returns the correct Windows paths. Thanks @asottile for the guidance, I don't think this is well known for MSYS2 users, I'll see if I can't add it to their FAQ or other documentation. Sorry for being hard headed 😄. |
no problem! thanks for the helpful comment as well :) |
Thanks @asottile and all the other contributors for the great tool! ❤️ 👍
I am one of the maintainers for Gaphor, and we make heavy use of pre-commit as part of our work flow. It is also built in GTK, and we have to use MSYS2 to build the app for Windows. I know it is a pretty niche environment to support, but it would be really great if we could make it happen.
Current Behavior
version information
error information
Updates Needed
cygpath
command to convert the path to the standard Windows path format after it gets the top-level path from git.My plan, as long is everyone is good with adding support for this environment, is to submit a PR for the first two, and then I'll start to work with the setuptools_scm team to see if I can fix the third one as well.
The text was updated successfully, but these errors were encountered: