How are msys, msys2, and msysgit related to each other? - msys

I've been searching around, but I can't find a thorough description of what's going on with these 3 versions of MSYS. (It's entirely possible I just don't know what to look for.) I do understand that MSYS is a minimal port of Linux tools to support development using MinGW, but I'm not clear on the relationship between the three of them or the teams that developed/maintain them.
Particular issues to address:
Which ones are under active development? (In particular, is MSYS dead and MSYS2 active?)
What is the relationship between the groups that maintain them? (In particular, did the MSYS team create MSYS2?)
Does msysgit just use one of the others, or do they have their own branch of MSYS?
Are any of these compatible with each other?
Are there any compatibility issues with particular versions of Windows for any of these?
Does one provide major features over the other?

Disclaimer: I am an MSYS2 developer
While MSYS isn't dead, I would say it's not looking very healthy either. It is a project started by the MinGW team many years ago as a fork of Cygwin that never kept up with Cygwin.
msysgit is a fork of a slightly older version of MSYS with some custom patches, old versions of Bash and Perl and a native port of Git.
MSYS2 is a project started by Alexey Pavlov of the mingw-builds team (who are the official packagers for MinGW-w64 toolchains) as a recent fork of Cygwin which tracks the latest Cygwin closely so that it doesn't end up out of date. Alexey forward ported the old MSYS patches and added some of his own.
As well as providing the necessary Unix tools with which to compile native software - the stated goal of MSYS - we ported the Pacman package manager from Arch Linux. Pacman is more than just about managing binary packages (though it does that very well). It has a software building infrastructure called makepkg that allows the creation of recipes (PKGBUILD and patch files) for building software.
IMHO, the adoption of Pacman changes things significantly for open source development on Windows. Instead of everyone hacking on their own bespoke shell scripts to build software in a hodge-podge, incompatible way, packages can now depend on other packages and PKGBUILD files and associated patches can be used as a reference for constructing new PKGBUILDs. It's as close to a Linux system as a (native) Windows can get (Arch Linux in particular) and allows for simple updating of all the installed packages.
We target Windows XP SP3 as a minimum and support both 32-bit and 64-bit Windows. We would ask that you never mix MSYS2 with msys or msysgit. Pacman is used to manage the whole system and as such, files from the other systems will cause conflicts.
We also try to upstream our patches to the projects we build and actively solicit contributions from other open source projects. We hope others find it easy to work with us.
Our main website is on SourceForge, and it contains links to our PKGBUILD repositories. We also have a more user friendly installer site on GitHub.
Feel free to join us on IRC (oftc #msys2) if you want more information.

Git 2.8 (March 2016) includes a very detailed commit which explains the importance of msys2 for the new git-for-windows which replaced msysgit in early 2015.
See commit df5218b (13 Jan 2016) by Johannes Schindelin (dscho).
(Merged by Junio C Hamano -- gitster -- in commit 116a866, 29 Jan 2016)
For a long time, Git for Windows lagged behind Git's 2.x releases because the Git for Windows developers wanted to let that big jump coincide with a well-needed jump away from MSys to MSys2.
To understand why this is such a big issue, it needs to be noted that many parts of Git are not written in portable C, but instead Git relies on a POSIX shell and Perl to be available.
To support the scripts, Git for Windows has to ship a minimal POSIX emulation layer with Bash and Perl thrown in, and when the Git for Windows effort started in August 2007, this developer settled on using MSys, a stripped down version of Cygwin.
Consequently, the original name of the project was "msysGit" (which, sadly, caused a lot of confusion because few Windows users know about MSys, and even less care).
To compile the C code of Git for Windows, MSys was used, too: it sports
two versions of the GNU C Compiler:
one that links implicitly to the POSIX emulation layer,
and another one that targets the plain Win32 API (with a few convenience functions thrown in).
Git for Windows' executables are built using the latter, and therefore they are really just Win32 programs. To discern executables requiring the POSIX emulation layer from the ones that do not, the latter are called MinGW
(Minimal GNU for Windows) when the former are called MSys executables.
This reliance on MSys incurred challenges, too, though:
some of our changes to the MSys runtime -- necessary to support Git for Windows better -- were not accepted upstream, so we had to maintain our own
fork.
Also, the MSys runtime was not developed further to support e.g. UTF-8 or 64-bit, and apart from lacking a package management system until much later (when mingw-get was introduced), many packages provided by the MSys/MinGW project lag behind the respective source code versions, in particular Bash and OpenSSL.
For a while, the Git for Windows project tried to remedy the situation by trying to build newer versions of those packages, but the situation quickly became untenable, especially with problems like the Heartbleed bug requiring swift action that has nothing to do with developing Git for Windows further.
Happily, in the meantime the MSys2 project (https://msys2.github.io/)
emerged, and was chosen to be the base of the Git for Windows 2.x.
Just like MSys, MSys2 is a stripped down version of Cygwin, but it is
actively kept up-to-date with Cygwin's source code.
Thereby, it already supports Unicode internally, and it also offers the 64-bit support that we yearned for since the beginning of the Git for Windows project.
MSys2 also ported the Pacman package management system from Arch Linux
and uses it heavily. This brings the same convenience to which Linux
users are used to from yum or apt-get, and to which MacOSX users are
used to from Homebrew or MacPorts, or BSD users from the Ports system,
to MSys2: a simple pacman -Syu will update all installed packages to
the newest versions currently available.
MSys2 is also very active, typically providing package updates
multiple times per week.
It still required a two-month effort to bring everything to a state
where Git's test suite passes, many more months until the first official
Git for Windows 2.x was released, and a couple of patches still await
their submission to the respective upstream projects. Yet without MSys2,
the modernization of Git for Windows would simply not have happened.
This commit lays the ground work to supporting MSys2-based Git builds.
In the comments, the question was asked in January 2016:
Since Git for Windows is already based on MSYS2, have the binaries that don't depend on the emulation layer been made available as an MSYS2 package?
Ray Donnelly answered at the time:
We haven't fully merged yet, no. We're working on it though.
But... madz points out that during early 2017, that effort did not pan out.
See:
Alexpux/MSYS2-packages PR 786
git-for-windows/git issue 284
The problem is that I cannot contribute changes that will result in a new msys2-runtime in a timely manner.
Not a big problem, though: I'll just keep the fork of Git for Windows running indefinitely.
The wiki therefore mentions now (2018):
Git for Windows created some patches for msys2-runtime that have not been sent upstream. (This had been planned, but it was determined in issue #284 that it would probably not be happening.)
This means that you have to install Git for Windows customized msys2-runtime to have a fully working git inside MSYS2.
Note that, since commit aeb582a9 (Git 2.22, Q2 2019), the Git for Windows project started the upgrade process to a MSYS2 runtime version based on Cygwin v3.x.
mingw: allow building with an MSYS2 runtime v3.x
Recently the Git for Windows project started the upgrade process to a MSYS2 runtime version based on Cygwin v3.x.
This has the very notable consequence that $(uname -r) no longer
reports a version starting with "2", but a version with "3".
That breaks our build, as df5218b (config.mak.uname: support MSys2,
2016-01-13, Git v2.8.0-rc0) simply did not expect the version reported by uname -r to depend on the underlying Cygwin version: it expected the reported
version to match the "2" in "MSYS2".
So let's invert that test case to test for anything else than a version starting with "1" (for MSys).
That should safeguard us for the future, even if Cygwin ends up releasing versions like 314.272.65536.
Git 2.22 (Q2 2019) will future-proof a test against an update to MSYS2 runtime v3.x series.
See commit c871fbe (07 May 2019) by Johannes Schindelin (dscho).
(Merged by Junio C Hamano -- gitster -- in commit b20b8fe, 19 May 2019)
t6500(mingw): use the Windows PID of the shell
In Git for Windows, we use the MSYS2 Bash which inherits a non-standard
PID model from Cygwin's POSIX emulation layer: every MSYS2 process has a regular Windows PID, and in addition it has an MSYS2 PID (which
corresponds to a shadow process that emulates Unix-style signal
handling).
With the upgrade to the MSYS2 runtime v3.x, this shadow process cannot
be accessed via OpenProcess() any longer, and therefore t6500 thought
incorrectly that the process referenced in gc.pid (which is not
actually a real gc process in this context, but the current shell) no
longer exists.
Let's fix this by making sure that the Windows PID is written into
gc.pid in this test script so that git.exe is able to understand
that that process does indeed still exist.
Git 2.37.3 (Q3 2022) illustrates how msys2 is used, through conditionally allow building Python interpreter on Windows:
See commit 2f0623a, commit 7934c74, commit 49d279f (29 Jul 2022) by Johannes Schindelin (dscho).
(Merged by Junio C Hamano -- gitster -- in commit 8dfa09f, 08 Aug 2022)
mingw: remove unneeded NO_CURL directive
Signed-off-by: Johannes Schindelin
In df5218b ("config.mak.uname: support MSys2", 2016-01-13, Git v2.8.0-rc0 -- merge listed in batch #4), we introduced support for building Git for Windows in the then-brand new Git for Windows v2.x build environment that was based off of MSYS2.
To do that, we split the non-msysGit part (that targeted MSys1) in two, and instead of sharing the NO_CURL = YesPlease setting with MSys1, we overrode it for MSYS2 with the empty value because we very much want to build Git for Windows with libcurl.
But that was unnecessary: we never set that variable beforehand, therefore there is no need to override it.
Let's just remove that unnecessary line.

My understanding on the connections between them is
Cygwin offers POSIX emulation on top of windows
msys tried to simplify Cygwin but is obsolete from 2010
msysGit - allowed Git up to 1.9.4 on Windows (could be called git-for-windows-1.X), based on an old version of msys.
msys2 - a simplified Cygwin, forked from it, with changes from msys and kept in sync with features from Cygwin, integrated with Pacman
MinGW - initial MinGW, abandoned from 2010
MinGW-w64 - a faster and better integration with windows, without POSIX
git-for-windows-2.x - offers Git from 2.X for Windows using MinGW-64, MinGW-32 and when is not possible with a fallback to msys2
Fiddle with complete graph definition in mermaid.

Related

What is the best way to have multiple g++ toolchains installed on Debian Jessie

I'm pretty new to linux, and I want to have installed multiple toolchains versions on my machine for testing purposes, I've read many documents on the internet refering to how to install test/experimental/unstable packages to get very new compilers packages (i.e. g++-6), but after setting Debian to find packages from test/experimental/unstable channels and install g++-6 my machine crashed, so as a new Linux user I would like to get your help to understand what is the recommended way of doing this, in my case I would like to have an easy way of testing my code against g++ (4.9, 5 and 6).
On Windows I used to download a zip package from a daily build version of mingw including g++ 5 or 6 and just setted the IDE to look for the toolchain in each folder, is that possible on Linux?
Mixing up stable/testing/unstable branch of debian is not easy and i wouldn't recommend to do it. What you could do is to download diractly the tarball, or clone the cvs and compile the compiler on your own, having each version in their own directory.
The different releases can be found here, for example.

Current Cygwin version is not supported by Clion, how to install an earlier version of it?

I am trying to get my Clion 1.1.1 to work with Cygwin. I've installed Cygwin using its setup-x86_64.exe installer. but when I set Cygwin path in Clion's toolchains dialog, it says:
Environment: Cygwin; current version is 2.2.1; supported version range is 1.7.32-2.0.x
On the Cygwin website there is a snapshots page, in which packages are sorted by date (not version) and in faq page it says:
If you are looking for the version number for the whole Cygwin release, there is none. Each package in the Cygwin release has its own version.
So, if there is no version number for whole Cygwin release, what is Clion complaining about?
and if there is, how can I install an earlier version?
afaik, you'll either need an older installer (and some luck on the repos) or someone's older package directory and installer. All recent installers only go back one release which won't be enough to get you back in line with Clion's requirement.
Might also be worth reaching out to Clion and asking them when support for the recent versions is coming out.

Has anyone ever successfully compiled Vowpal Wabbit on a Windows 7 machine?

I am trying to compile Vowpal Wabbit on a Windows 7 machine and after trying Netbeans, Cygwin, and MinGW I'm starting to wonder if I'm trying something that's even feasible.
Each of the above has required **.h files that aren't designed for windows such as sys/socket.h.
Anyone that has actually done this, I would appreciate any suggestions.
Run cygwin's setup.exe, type "boost", click on "Default" several times until it changes to "Install", proceed with installing boost library from cygwin.
Download latest Vowpal Wabbit and extract to you vw directory.
Open cygwin and go to that vw directory, where Makefile is(cd .. (see #home) cd vw_dir)
In cygwin command prompt type "make"
After that you can close cygwin, and use cmd to run vowpal.
I took this from a kaggle forum:
"
I managed to compile VW under Windows 7 64 bit without Professional Visual Studio 2010.
You can do it by using Cygwin ( http://www.cygwin.com/ ).
first of all install Cygwin on your computer: just choose the standard configuration
run Cygwin shell and enter : git clone git://github.com/JohnLangford/vowpal_wabbit.git
after the download have completed write: cd vowpal_wabbit
at this point you can run the command: configure
the configure procedure will point out all the libraries which are missing from your system and that you should install by running again the Cygwin setup
after some iterations of point 5 you will have finally provided all the necessary libraries to Cygwin, and you can run the command: make
7 after the compiler will finish the make of vw.exe, run: make test in order to check if everything is all right with your build.
Now you can start using VW under Windows, just open a shell and try it.
"
Another update, binary releases for Windows is now available since 21 June 2016. The latest link as of today is: https://github.com/eisber/vowpal_wabbit/releases/tag/v8.2.0.6
It's available in MSI installer file.
(In case you encounter dead link in the future, please find most recent version from the eisber's github repo.)
John Langford recently made a post to the VW mailing list saying a Windows port was in progress, but still broken in certain respects. I would suspect that it currently is not possible to get VW running on windows (but I haven't actually tried)
From this thread:
Chris Quirk created a windows port for VW, which is now in the
distribution. It's still incomplete: networking and threads are
problem points.
I managed to build on 64bit win without cygwin, native windows. Took a long time to set up env for the build so I wrote a blog about it. I know that self promotion is frowned upon but this link has the binary I built on my machine, guaranteed to work on only my machine but anyone is free to try it out.
An update for curious googlers: the VW Windows instructions have recently been updated, and if you get the most recent source you should be able to compile on Visual Studio without major hurdles (I have tried successfully): https://github.com/JohnLangford/vowpal_wabbit/blob/master/README.windows.txt

How to update GCC in MinGW on Windows?

I'm used to manually install GCC from source before on Ubuntu and it was a painful process. So I really don't want to do repeat this process. Currently, I have MinGW and GCC (4.6.2) installed on my machine. So is there an easy way to update GCC without building it entirely from source? Has anyone done it before can share me some tips?
Update using terminal:
Run the command prompt/terminal (cmd or sh).
Update the package list:
mingw-get update
After updating the package list, run:
mingw-get upgrade
When the command finishes running, all of your packages will be upgraded.
Update using the GUI version:
If you aren't used to the terminal, there is also a GUI version of MinGW called "MinGW Installation Manager", which is normally located at:
C:\MinGW\libexec\mingw-get\guimain.exe
When the GUI is open, tap Installation -> Update Catalogue. This will update the package list.
After that, tap Installation -> Mark All Upgrades. This will select all of the packages which can be upgraded.
Finally, tap Installation -> Apply Changes to apply the upgrades.
Snapshots and release builds of the MinGW http://code.google.com/p/mingw-builds/downloads/list
UPDATE: As of Nov-5-2012, MinGW includes 4.7.2 of the GCC compiler, which is the most current version. I personally will use the MinGW package, since it includes MSYS and other tools, and since it is the defacto standard, I hope that it is better supported. The only drawback is the included GDB does not include Python scripting, but I think that can be updated separately.
I don't know if you can update the GCC in MinGW, but there are alternative projects to MinGW with newer versions of GCC.
The MinGW-builds project provides a package similar to MinGW but with an updated GCC (4.7.2). I extracted the files to c:\MinGW (so I could use the same path) after moving my existing MinGW to another folder. Only MinGW has MSYS, so if you need that (I did) copy the msys folder from the original MinGW.
After installing MinGW-builds, the result of g++ --version:
g++ (Built by MinGW-builds project) 4.7.2
The latest GCC that comes with standard MinGW is currently 4.7.0. I compiled a few simple projects in Code::Blocks, and the latest wxWidgets source, and everything seems to work.
It's worth noting that MinGW-builds includes a Python script enabled version of GDB, in case you want STL pretty printer support, or other GDB Python features.
Another good choice is TDM-GCC, which is a project that hosts an impressive installer that includes an updated GCC compiler (4.7.1) and support tools. It is a standalone package. As far as I can tell, Python scripting is not supported in the GDB that comes with this package.
Finally there is the MinGW-w64 project, which is a fork of MinGW. Rubenvb, who posted an answer to this question, has good standalone packages (in the personal builds folder) based on this project which include an updated GCC (4.7.2). The included GDB seems to be Python script enabled.
if you use MSYS2
just open mingw64-console and type in:
# Update the package database and core system packages with:
pacman -Syu
# If needed, close MSYS2, run it again from Start menu. Update the rest with:
pacman -Su
I have built a more up to date GCC 4.7 (it's built within code freeze, so it should be equivalent with the release). Also, this build contains <thread> support.
32-bit
64-bit
The -gcc_linux package is what you want if you want to use it on Linux. Just extract somewhere and add the mingw??/bin directory to PATH.
PS: There's a native Windows compiler and a Windows Clang build. I suggest using Clang only with one of my GCC 4.6 builds, as it has trouble with GCC 4.7's libstd++. Extract the Clang package in the same directory as the GCC package and it will work out of the box.
The MinGW-w64 build from http://winlibs.com/ has the latest GCC version and requires no installation, just unzip the download. To upgrade you can just replace the mingw32 or mingw64 folder with the new version.
To get latest MinGW64 in Windows: https://sourceforge.net/projects/mingw-w64/?source=typ_redirect
For all platforms: https://mingw-w64.org/doku.php/download
You just need to update your g++ compiler if its not.
First problem can be solved through this:
Update using the GUI version:
If you aren't used to the terminal, there is also a GUI version of MinGW called "MinGW Installation Manager", which is normally located at:
C:\MinGW\libexec\mingw-get\guimain.exe
When the GUI is open, tap
Installation -> Update Catalogue
. This will update the package list.
After that, tap
Installation -> Mark All Upgrades
. This will select all of the packages which can be upgraded.
Finally, tap
Installation -> Apply Changes
to apply the upgrades.
2nd Problem could be that if you didn't updated the path of mingw in environment variables.

learning c++ on linux mint ( for .net developer )

My goal is to hop on to C++ programming language by doing a homework project on linux mint and learn some linux & c++ at the same time.
I intend to write a small desktop application to show current network traffic ( like DU meter in windows). I have following questions:
I noticed in mint there is an application called 'System Monitor' which also shows network history with info and graph like current download/upload of data and speed. Is it a good idea to get started by looking at the code for this ? how can I find the code for same in mint and dig into it ? pls help with some steps here if possible.
what tools do I need here for writing c++ application for/in linux mint ?
Which GUI library to use ( like in c# winforms , it offers user controls as part of GDI lib) on linux mint what do we have that offers user controls like window/button/panel/etc ?
Links to beginner level tutorials will be helpful.
Hoping NOT to re-invent the wheel completely here. Would love to re-use some lib that do the network traffic part, ideas ?
PS: i know this post reads 'wanna be' - I am really excited to kickstart with some c++. Will rephrase this post with more precise questions.Hunting in the dark at this point being a c# developer totally spoiled by windows.
Thanks in Advance!!! for tips on this...
The mint distribution is based on Ubuntu/Debian, so I assume that my Ubuntu approach also works on mint.
First
you need some tools, libraries and headers:
# install the standard toolchain (g++, make, etc.)
sudo aptitude install build-essential
# install the build dependencies for a desktop based networking tool
sudo aptitude build-dep gnome-nettool
Optionally
because you mentioned the system-monitor - it might be helpful to build the gnome-system-monitor from source:
# install the build dependencies for gnome-system-monitor
sudo aptitude build-dep gnome-system-monitor
# get the sources for the gnome-system-monitor
mkdir example
cd example
apt-get source gnome-system-monitor
# build the gnome-system-monitor
# note: you might have a different version. But I'm sure you get the idea ;-)
cd gnome-system-monitor-2.28.0
sh configure
make
Finally
you need something to develop and debug. A lot of unix developers recommend emacs or vi(m). But my personal opinion is that you should start with a "modern" GUI based IDE.
here's a collection of some commonly used IDEs:
Eclipse with CDT
NetBeans
Code::Blocks
Anjuta (was this used to develop the gnome-system-monitor ?)
CodeLite (which is my personal favorite)
see also: discussion on SOF regarding "the best" C++ IDE for Linux
People usually use text editors like (g)Vim or emacs to write C++ applications. If you've never seen them before they may be a bit overwhelming. You can also use IDEs like Geany, Anjuta, QtCreator, Eclipse...
I think the default desktop environment in Mint is GNOME which uses the GTK library. You could use GTK for your application. It is written in C but there is a c++ interface for it, gtkmm, and a tutorial for it on the projects site.
There is also Qt, which is the base of the K Desktop Environment or KDE. It is a very large library and has a pretty good IDE written in it, for it, QtCreator.
Finally, you should search stackoverflow because most of your questions have already been answered.
In answer to you "what tools do I need", you should at a minimum install g++, the standard C++ compiler on a GNU/Linux system.
Linux Mint is based on Ubuntu (which is in turn based on Debian), so for a binary like gnome-system-monitor, the command
apt-get source $(dpkg -S $(which gnome-system-monitor) | cut -d: -f1)
will download and unpack the source package for it in the current directory. Note that it probably depends on a number of libraries, that can be found in different packages. You can see what these are with apt-cache show package_name, and libraries often have associated development packages named with -dev that contain the associated headers and statically-linked archives. You can find the dev package names by searching using apt-cache search foo, where foo is the base name of the library package you're interested in.