<p>In the beginning there was <a href="https://cygwin.com/">Cygwin</a>, by <a href="https://en.wikipedia.org/wiki/Cygnus_Solutions">Cygnus Solutions</a> (later acquired by Red Hat), then came <a href="https://mingw.org/wiki/msys">msys</a>, a lightweight derivative with no package manager, no fancy integration tools, just the bare minimum necessary to support a gcc compiler and the GNU autotools.</p>
<p><a href="https://www.msys2.org/">msys2</a> is cygwin minus the package manager plus an adaptation of the <a href="https://www.archlinux.org/pacman/">pacman</a> package manager from <a href="https://www.archlinux.org/">Arch</a>, and a big archive of packages of all kinds. It offers a friendlier command-line experience than Cygwin does.</p>
<p>I failed to mention here that msys was explicitly made to support the <a href="https://mingw.org/">MinGW</a> (Minimalist GNU for Windows) flavor of GCC, which is intended for building native Windows applications. GCC for Windows has two types of output, <code>cygwin</code> or <code>mingw</code>, where <code>cygwin</code> is for source code that expects POSIX-y facilities and <code>mingw</code> is for code that should compile (possibly with some minor adjustments for C dialect) equally well under GCC and Microsoft Visual C, and should produce about the same output.</p>