Skip to content

Instantly share code, notes, and snippets.

@adamleerich
Forked from ReneNyffenegger/mingw vs msys
Last active January 12, 2022 16:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamleerich/ff64e45de45aa70e12a90248259733ef to your computer and use it in GitHub Desktop.
Save adamleerich/ff64e45de45aa70e12a90248259733ef to your computer and use it in GitHub Desktop.
msys2 vs msys vs msysgit
MinGW doesn't provide a linux-like environment, that is MSYS(2) and/or Cygwin
Cygwin is an attempt to create a complete UNIX/POSIX environment on Windows.
MinGW is a C/C++ compiler suite which allows you to create Windows executables - you only
need the normal MSVC runtimes, which are part of any normal Microsoft Windows installation.
MinGW provides headers and libraries so that GCC (a compiler suite,
not just a "unix/linux compiler") can be built and used against the Windows C runtime.
MSYS is a fork of Cygwin (msys.dll is a fork of cygwin.dll)
cygwyn gcc + cygwin environment defaults to producing
binaries linked to the (GPL) cygwin dll (or cygwin1.dll???)
mingw + msys defaults to producing binaries linked to the platform C lib.
MinGW: It does not have a Unix emulation layer like Cygwin, but as a
result your application needs to specifically be programmed to be able to run in Windows,
MinGW forked from version 1.3.3 of Cygwin
Unlike Cygwin, MinGW does not require a compatibility layer DLL and thus programs do not need to be distributed with source code.
This means, other than Cygwin, MinGW does not attempt to offer a complete POSIX layer on top of Windows,
but on the other hand it does not require you to link with a special compatibility library.
Cygwin comes with the MingW libaries and headers and you can compile without linking to the cygwin1.dll by
using -mno-cygwin flag with gcc. I greatly prefer this to using plain MingW and MSYS.
( This does not work any more with cygwin 1.7.6. gcc: The -mno-cygwin flag has been removed; use a mingw-targeted cross-compiler. )
MSYS is a collection of GNU utilities such as bash, make, gawk and grep to allow building of applications and programs
which depend on traditionally UNIX tools to be present.
It is intended to supplement MinGW and the deficiencies of the cmd shell.
An example would be building a library that uses the autotools build system. Users will typically run "./configure" then "make" to build it.
The configure shell script requires a shell script interpreter which is not present on Windows systems, but provided by MSYS.
A common misunderstanding is MSYS is "UNIX on Windows", MSYS by itself
does not contain a compiler or a C library, therefore does not give the
ability to magically port UNIX programs over to Windows nor does it provide any UNIX specific functionality
like case-sensitive filenames. Users looking for such functionality
should look to Cygwin or Microsoft's Interix instead.
MSYS2 uses Pacman (of Arch Linux) to manage its packages and comes with three different package repositories:
- msys2: Containing MSYS2-dependent software
- mingw64: Containing 64-bit native Windows software (compiled with mingw-w64 x86_64 toolchain)
- mingw32: Containing 32-bit native Windows software (compiled with mingw-w64 i686 toolchain)
Cygwin provides a runtime library called cygwin1.dll that provides the POSIX compatibility layer
where necessary. The MSYS2 variant of this library
is called msys-2.0.dll and includes the following changes to support using native Windows programs:
1) Automatic path mangling of command line arguments and environment variables to Windows form on the fly.
MSYS is a fork of an old Cygwin version with a number of tweaks
aimed at improved Windows integration, whereby the automatic POSIX path
translation when invoking native Windows programs is arguably the most significant.
## [May 13, 2020 ALR]
All notes are quotes from the listed websites.
### https://www.msys2.org/#installation
* At its core, it is an independent rewrite of MSYS, based on modern Cygwin (POSIX compatibility layer) and MinGW-w64
* It provides
- a bash shell
- Autotools
- revision control systems and the like
* For building native Windows applications using MinGW-w64 toolchains
### https://www.msys2.org/wiki/How-does-MSYS2-differ-from-Cygwin/
* Cygwin tries to bring a POSIX-compatible environment to Windows
* Most software that runs on unices will build and run on Cygwin
* Cygwin provides a large collection of packages containing such software, and libraries for their development
* MSYS2 tries to provide an environment for building native Windows software
* MSYS2 provides a large collection of packages containing such software, and libraries for their development
* As a large portion of the software uses GNU build tools which are tightly coupled to the unix world, this environment is also POSIX-compatible, and is in fact based on Cygwin
* MSYS2 provides a minimal shell required to run autotools and other build systems
* The shell and core tools exist mainly to allow porting Unix programs to run natively on Windows (i.e. without requiring a POSIX emulation layer)
* MSYS2 doesn't try to duplicate Cygwin's efforts more than necessary, so the number of provided POSIX-emulated software is very small
### https://github.com/r-windows/rtools-installer
* Rtools40 uses the msys2 build environment
* The major difference between rtools and the upstream msys2 distribution is that our toolchains and external libraries have been reconfigured for static linking
### https://stackoverflow.com/a/792142/245022
* Compile something in Cygwin and you are compiling it for Cygwin
* Compile something in MinGW and you are compiling it for Windows
### https://stackoverflow.com/a/771782/245022
*
## Installation output for MSYS2
Preparing the installation...
Installing component MSYS2 64bit base...
Extracting "20190524msys64.7z"
Copying skeleton files.
These files are for the users to personalise their msys2 experience.
They will never be overwritten nor automatically updated.
'./.bashrc' -> '/home/richad/.bashrc'
'./.bash_logout' -> '/home/richad/.bash_logout'
'./.bash_profile' -> '/home/richad/.bash_profile'
'./.inputrc' -> '/home/richad/.inputrc'
'./.profile' -> '/home/richad/.profile'
'C:\WINDOWS\system32\drivers\etc\hosts' -> '/etc/hosts'
'C:\WINDOWS\system32\drivers\etc\protocol' -> '/etc/protocols'
'C:\WINDOWS\system32\drivers\etc\services' -> '/etc/services'
'C:\WINDOWS\system32\drivers\etc\networks' -> '/etc/networks'
==> Updating trust database...
==> Appending keys from msys2.gpg...
==> Locally signing trusted keys in keyring...
-> Locally signing key D55E7A6D7CE9BA1587C0ACACF40D263ECA25678A...
-> Locally signing key 123D4D51A1793859C2BE916BBBE514E53E0D0813...
-> Locally signing key B91BCF3303284BF90CC043CA9F418C233E652008...
-> Locally signing key 9DD0D4217D75A33B896159E6DA7EF2ABAEEA755C...
==> Importing owner trust values...
==> Updating trust database...
--> Installing /usr/share/info/assuan.info.gz ...
done
--> Installing /usr/share/info/autosprintf.info.gz ...
done
--> Installing /usr/share/info/bash.info.gz ...
done
--> Installing /usr/share/info/coreutils.info.gz ...
done
--> Installing /usr/share/info/find.info.gz ...
done
--> Installing /usr/share/info/find-maint.info.gz ...
done
--> Installing /usr/share/info/flex.info.gz ...
done
--> Installing /usr/share/info/gawk.info.gz ...
done
--> Installing /usr/share/info/gawkinet.info.gz ...
done
--> Installing /usr/share/info/gawkworkflow.info.gz ...
done
--> Installing /usr/share/info/gcrypt.info.gz ...
done
--> Installing /usr/share/info/gettext.info.gz ...
done
--> Installing /usr/share/info/gmp.info.gz ...
done
--> Installing /usr/share/info/gnupg.info.gz ...
done
--> Installing /usr/share/info/gnutls.info.gz ...
done
--> Installing /usr/share/info/gnutls-guile.info.gz ...
done
--> Installing /usr/share/info/gpgme.info.gz ...
done
--> Installing /usr/share/info/grep.info.gz ...
done
--> Installing /usr/share/info/gzip.info.gz ...
done
--> Installing /usr/share/info/history.info.gz ...
done
--> Installing /usr/share/info/inetutils.info.gz ...
done
--> Installing /usr/share/info/info-stnd.info.gz ...
done
--> Installing /usr/share/info/ksba.info.gz ...
done
--> Installing /usr/share/info/libffi.info.gz ...
done
--> Installing /usr/share/info/libgomp.info.gz ...
done
--> Installing /usr/share/info/libidn2.info.gz ...
done
--> Installing /usr/share/info/libquadmath.info.gz ...
done
--> Installing /usr/share/info/libtasn1.info.gz ...
done
--> Installing /usr/share/info/libunistring.info.gz ...
done
--> Installing /usr/share/info/m4.info.gz ...
done
--> Installing /usr/share/info/mpfr.info.gz ...
done
--> Installing /usr/share/info/nettle.info.gz ...
done
--> Installing /usr/share/info/pinentry.info.gz ...
done
--> Installing /usr/share/info/readline.info.gz ...
done
--> Installing /usr/share/info/rluserman.info.gz ...
done
--> Installing /usr/share/info/sed.info.gz ...
done
--> Installing /usr/share/info/time.info.gz ...
done
--> Installing /usr/share/info/wget.info.gz ...
done
--> Installing /usr/share/info/which.info.gz ...
done

###################################################################
# #
# #
# C A U T I O N #
# #
# This is first start of MSYS2. #
# You MUST restart shell to apply necessary actions. #
# #
# #
###################################################################

Done
Writing maintenance tool.
Installation finished!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment