Differences between MSYS2 and Cygwin

antonio picture antonio · Sep 9, 2014 · Viewed 21.7k times · Source

Traditionally MSYS bash has been considered inferior to Cygwin bash. The former was an ancillary tool inside MinGW intended for running autoconf scripts. But now there is MinGW-w64 and MSYS2. The latter ships with a sweet pacman like package manager and elegant shells like zsh, so I wonder if there is still a gap in the emulation layer.

While MinGW* applications are Windows native executables, MSYS2 software requires a POSIX-emulation layer, just like Cygwin does. At least to a casual user, it is hard to spot the differences between the two.

  • Which are the functional differences between the two emulation layers (if any)?
  • Which emulation is faster (more efficient)?

Answer

Ray Donnelly picture Ray Donnelly · Sep 10, 2014

Traditionally MSYS bash has been inferior, but mostly because Cygwin remained under active development whereas MSYS didn't. MSYS forked from Cygwin version 1.3.3 and never re-synced, whereas MSYS2 resyncs with the Cygwin project regularly.

We don't have a "sweet pacman like package manager", we have as direct a re-compilation of Arch Linux's pacman package manager as we could achieve.

MSYS2 doesn't have cygwin.dll but it does have msys-2.0.dll which does the same thing (and some more besides). Specifically, arguments that look like paths and the PATH env. var are converted to Windows form when running Windows-native software.

As for whether it's slower, I expect there'd be very little difference but MSYS2 would be a tiny amount slower due to the extra conversion work. Then again, chances are you'll run more Windows-native software from within MSYS2 (such as MinGW-w64 compilers) than you would from Cygwin so that'll shift things back in MSYS2's favour.