Msys2: Difference between revisions
Line 86: | Line 86: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote><!-- Compiler Environment --> | </blockquote><!-- Compiler Environment --> | ||
= Usage = | |||
<blockquote> | |||
To run, execute the <code>msys2</code> executable (opens [[mintty]]). | |||
You can also run commands within msys2 using it's bash executable. | |||
<syntaxhighlight lang="bash"> | |||
C:\tools\msys64\usr\bin\bash.exe -c 'pacman -Syy' | |||
</syntaxhighlight> | |||
</blockquote><!-- Usage-> | |||
= Troubleshooting = | = Troubleshooting = |
Latest revision as of 20:32, 27 August 2023
msys2 is a fork of cygwin, created by the mingw team. The difference between msys and cygwin is that msys does not use compatibility layers to run pure linux programs. Instead, it's programs are native windows executables, they can be run without an Xserver, and they tend to be much faster.
Msys2 is fantastic. It is faster than cygwin, runs without the Xserver, and it manages it's packages with pacman. vim, Zsh, python2, and tmux are all available which makes this the tool of my dreams.
WARNING:
msys2 is a fantastic tool that provides a unixlike compile environment for windows, and unixlike shell with some (very basic) dependencies.
msys2 can use tmux, python, zsh, etc.
The problem for me, when considering it as a development platform, is that any python library requiring a compiled component must be built specifically for msys2. Saltstack, for example, cannot be used within msys2 because it requires pycrypto which does not compile under msys2.
So basically, treat msys as a barebones unix shell. you'll be able to install builtin scripting languages, like zsh, sh, bash, python, perl, ruby, ... but you will be severely restricted when it comes to libraries. Think of it as a shell, and a shell only.
..HOWEVER..
It is a wonderful shell-environment that you can use to run THE WINDOWS PYTHON
from, and still have access to tmux/vim-splits/ack/find.
Install
The easiest install route is to install using chocolatey. Run an msys shell from
C:\tools\msys64\mingw64_shell.bat
.sudo pacman -S zsh tmux vim python2
Configuration
%USERPROFILE% as $HOME
/etc/nsswitch.conf
db_home: windows # use C:\Users\willjp as $HOME. # (This also corrects SSH behaviour)vim with python
mkdir -p /home/src git clone https://github.com/vim/vim cd vim ./configure --prefix=/usr --with-tlib=ncursesw --enable-luainterp \ --with-lua-prefix=/usr/local --disable-gui --disable-tclinterp \ --enable-cscope --without-x CPPFLAGS="${CPPFLAGS} -I/usr/include/ncursesw" \ --enable-python3interp=dynamic --enable-pythoninterp=dynamic \ --enable-multibyte make make install
Compiler Environment
Occasionally, you'll run into a package that is too new, too old, or not available in the package repository. Or maybe you want to compile something yourself. To install the mingw version of gcc and the rest of the compile environment:
pacman -S mingw-w64-x86_64-toolchain
Usage
To run, execute the
msys2
executable (opens mintty).You can also run commands within msys2 using it's bash executable.
C:\tools\msys64\usr\bin\bash.exe -c 'pacman -Syy'
downloading old versions packages
http://repo.msys2.org/ # find/download desired package pacman -U <yourpackage>