How do I use mingw and msys2 shells?


#1

Hello,

I have successfully installed msys2 via choco install -y msys2 and it is installed to C:\tools\msys64 but I am unsure of the way to invoke the mingw and msys2 shells in order to run its commands such as installing packages using pacman and using them.

I have tried to use C:\tools\msys64\usr\bin\bash -lc 'COMMAND' but i hit fatal error - cygheap base mismatch detected.. Is this the correct way and that I should try and fix this error?

Thank you for the help!


#2

Starting off by saying I barely know what I’m talking about here, anyone feel free to come correct me.

It seems that trying to launch the MSYS2 bash from inside Travis’ provided git bash does not work, because they are both cygwin based and use different versions of the dll (or something like that, basically you’re loading a cygwin environment when you’re already inside one, and it doesn’t work).

I have had luck by running bash -lc '...' from powershell. So basically I just include a powershell script in my repo and run it with powershell -executionpolicy bypass -file script.ps1. All it does is install some additional MSYS2 dependencies and run make.