jenkinsmingw32msys2

How to setup jenkins windows slave node to support msys2 mingw shell


I want to build a program with a jenkins windows 7 node. The program is build using cmake but in the configure stage cmake tells me that there is no g++ compiler. I think this error occurs due to the wrong shell but I don't know how to set the right shell. The documentation says that the first sh file on windows is executed but msys2 needs mingw32.exe as the correct shell.


Solution

  • There are several ways start MinGW shell:

    1. Set env variable with set MSYSTEM=mingw32 or set MSYSTEM=mingw64. Then start msys2_shell.cmd or usr/bin/bash --login.
    2. Start msys2_shell.cmd with -mingw32 or -mingw64 arg.
    3. Type in MSYS2 source shell <name> where can be: msys, mingw32, mingw64.
    4. Install msys2-launcher-git and run mingw32.exe or mingw64.exe