Switch between different mingw distributions using a single msys-bin—as opposed to storing various copies of msys for each mingw distro.
Is a work in progress. If something is broken or you have any questions or suggestions, please let me know by way of a comment.
This is a personal configuration for hacking. I do recommend recreating this environment on your system if you haven't one already, however there are a few more advanced tool-chains out there (which I'm working on figuring out in my spare time).
Suggested elements for such a configuration (marked with 'configure') demonstrated. The rest are automatically a part of the msys+ download.
- Atom (configure)
- Git
- Go (configure)
- Java-JDK/Ant (configure)
- Mercurial
- MiKeTeX (configure)
- MinGW-64 & Mingw-Builds (configure)
- NodeJS
- Python (configure)
- Ruby/Rails (configure)
- Create postinstall directory in your msys path if it doesn't exist
- Copy the two scripts into this directory
- Update/hack and test out the windows command script
Currently this is something that you should do manually, becuase it is the fastest way to get what you want when you want it.
There are two things that you would need to do in order to use this...
- SET UP YOUR PATH
- SET UP YOUR MINGW DISTROS
I provided my configuration because it would be a good thing for a programming enthusiast to have such a wonderful set of tools at their finger-tips. I wish I had a configuration like this ten years ago. So all of my configuration is in there and it will grow as my configuration grows.
All of the PATH settings are injected into a batch file ridiculously named mingw.bat
. See the script part named :ADDTOPATH
.
:ADDTOPATH
ECHO SET PATH=.;%MRT%
ECHO SET PYTHONHOME=%PY%>>mingw.bat
ECHO SET PYTHONPATH=%PY%\lib>>mingw.bat
ECHO SET JAVA_HOME=%JH%>>mingw.bat
ECHO SET GOROOT=%GOROOT%>>mingw.bat
ECHO SET GOPATH=%GOPATH%>>mingw.bat
ECHO SET PATH=%PATH%>>mingw.bat
GOTO:EOF
It is important to understand the ENVIRONMENT %PATH% you are dealing with, so the semantics of this script entirely re-build the %PATH% to simplify build related configurations (bringing them to one place)—that way all environment related issues are in one place.
In the batch-command-script pi-set.bat
, there are three parts we would add to or remove from.
All the following three edits take place in the :BEGIN
section.
- This is numbered 1 to whatever.
- Assign the
%choice%
in a conditionalif
command. - Next you update the
if %choice% GEQ [a-number-goes-here] GOTO:BEGIN
to an appropriate numeric. If you have choices one throuh twelve, you would use 13 for this value.
I downloaded msys+7za+wget+svn+git+mercurial+cvs-rev12.7z and was trying to figure out how to configure that particular MSYS bin to any of the few versions of MinGW I have laying around my PC.
Running pi-set.cmd will reconfigure your msys 'mount' of whatever mingw version intended (or specified).
I've run into a few scenarios when switching between different MinGW configurations. These are rare scenarios when build building large projects such as FFmpeg.
BE SURE NO MSYS SCRIPTS ARE HANGING WHEN YOU EXECUTE THIS SCRIPT—This is particularly useful if you have attempted to compile something HUGE like ffmpeg or something like, or if you break out of a build that is hanging for some reason. This is not by any means a typical or common problem. You can identify them in process manager under a running conhost.exe in windows 7 or more likely in a running sh.exe executing any script that might be locked.
Also (if in doubt), be sure that if you change the mingw-bin while another console-window is open, the compiler you're targeting checks out (is working properly) by executing the mingw executable you're targeting for version-information. (EG: gcc.exe -version)
THE ERROR is caused when you don't have a python environment in the same location as it is configured for mercurial. If you intend to use Golang, you are going to need Hg.exe functional.
To solve this issue, rename your ./bin/hg.exe to something like hg.exe.bak or something, unless you would like to delete it, install tortoise mercurial, and add it to your batch-script's PATH.
$ hg --version
Traceback (most recent call last):
File "c:\Python26\lib\site-packages\py2exe\boot_common.py", line 92, in <module>
ImportError: No module named linecache
Traceback (most recent call last):
File "<install zipextimporter>", line 1, in <module>
ImportError: No module named zipextimporter
Traceback (most recent call last):
File "hg", line 10, in <module>
ImportError: No module named os