MSYS2 Website Documentation
repository·main·Indexed 25 days ago
https://github.com/msys2/msys2.github.ioSource files and development guides for the MSYS2 website. Includes instructions for local preview using properdocs and mkdocs-material, building msys2-fonts via npm, and detailed technical documentation on the MSYS2 automated build process, Azure Artifact Signing, keyring management, and mirror synchronization using rsync.
What's inside msys2-msys2.github.io
- Software packaged within the MSYS2 repository may communicate with third-party servers for functional, analytics, or other purposes. Users should consult the specific upstream documentation for any package to understand its external communication behavior.
Understand the purpose of MSYS2
mainMSYS2 provides a native build environment based on open source software. It is designed to provide a Linux-like experience on Windows, specifically optimized for building native Windows programs using Windows APIs. It is not a general-purpose Linux subsystem, but a toolset for native development.Understand MSYS2 package repositories and management
mainMSYS2 uses the
pacmanpackage manager (from Arch Linux) and organizes software into three distinct repositories based on their purpose and target architecture:msys2: Contains software that depends on the MSYS2 runtime (POSIX-emulation layer).mingw64: Contains 64-bit native Windows software (compiled with themingw-w64x86_64 toolchain).mingw32: Contains 32-bit native Windows software (compiled with themingw-w64i686 toolchain).
This differs from Cygwin, which primarily provides Cygwin-dependent software via its own
setup.exemanager.Understand MSYS2 Subsystems
mainMSYS2 is composed of three distinct subsystems, each with its own package repository and purpose:
mingw32andmingw64: These are the primary focus of MSYS2. They provide native Windows programs built via the MinGW-w64 project. Programs in these subsystems are designed to cooperate seamlessly with other native Windows software.msys2: Provides an emulated, mostly-POSIX-compliant environment based on Cygwin. It is used for shell scripting, package management, and building software that requires a Unix-like environment. These programs live in a virtual single-root filesystem.
Toolchains:
- Native toolchains are available in
mingw-w64-i686-toolchainandmingw-w64-x86_64-toolchain. - Cross-compiler toolchains exist in
mingw-w64-cross-toolchainbut have limited utility due to a lack of library packages.
Understand MSYS2 Package Repositories
mainMSYS2 uses three primary repositories. Choosing the correct one depends on whether your software requires POSIX emulation or is a native Windows application:
- msys: Contains software that depends on
msys-2.0.dll(similar to Cygwin). Use this for POSIX-like tools. - mingw32: Contains native Windows software targeting the 32-bit environment.
- mingw64: Contains native Windows software targeting the 64-bit environment.
Note: Native Windows software should link dynamically to
msvcrt.dlland should not depend onmsys-2.0.dll.- msys: Contains software that depends on
Check supported Windows versions for MSYS2
mainMSYS2 support varies depending on whether you are using the GUI installer, the packages themselves, or the toolchains for building software.
GUI Installer
Requires 64-bit Windows 10 (1809+) or Windows Server 2019.
Packages
- Msys/Cygwin Packages: Requires 64-bit Windows 10 or Windows Server 2016.
- Mingw Packages: Requires 64-bit Windows 10 or Windows Server 2016.
Toolchains (Targeting Windows)
- MINGW32/MINGW64 environments: Can still target Windows 7+.
- All other environments: Allow targeting Windows 10+.
Ways to contribute to the MSYS2 project
mainThe MSYS2 project accepts various forms of contribution. You can help by:
- Package Management: Prepare and maintain packages, or improve core packages.
- Software Development: Fix bugs, triage bugs, report bugs, or provide upstream patches.
- User Support: Help other users and spread the word about MSYS2.
- Documentation: Write documentation for the project.
- Infrastructure & Operations: Help with organization or infrastructure, or provide mirrors.
- Adoption: Use MSYS2 for your own projects.
- Financial Support: Donate to the project.
Understand how MSYS2 package mirrors work
mainMSYS2 distributes packages via multiple mirror servers. By default, the package manager
pacmanautomatically selects the best available mirror based on the order defined in specific configuration files.pacmanchecks mirrors in this order:/etc/pacman.d/mirrorlist.mingw(for mingw packages)/etc/pacman.d/mirrorlist.msys(for msys packages)
Key mirror entries:
mirror.msys2.org: A special geo-redirector that automatically routes you to the nearest tier 1 mirror.repo.msys2.org: The main package server.- Other entries: Third-party mirrors.
Understand the difference between Terminals and Shells in MSYS2
mainIn the MSYS2 environment, it is important to distinguish between the terminal emulator and the shell:
- Terminal Emulator: The program that interfaces with console programs to handle input (keypresses) and output (drawing glyphs). For MSYS2, Mintty is the recommended terminal emulator as it provides the necessary POSIX interfaces.
- Shell: The program that reads commands and executes them (e.g., bash).
While a Mintty window typically runs a bash shell, these are distinct components. You can run a Windows shell (like cmd) inside Mintty, or an MSYS2 shell (like bash) inside a Windows console (conhost).
Understand the MSYS2 Automated Build Process
mainThe MSYS2 build pipeline automates the transition from a
PKGBUILDchange in theMINGW-packagesgit repository to a package being available in thepacmanrepository.- Trigger: A
git pushto theMINGW-packagesrepository triggers GitHub Actions (GHA) to parse thePKGBUILDs and upload them topackages.msys2.org. - Polling:
packages.msys2.orgfetches the parsedPKGBUILDs every 5 minutes. - Build Loop: Every 2 hours,
msys2-autobuildtriggers a cron job in GHA. GHA fetches the TODO list from the API, fetches thePKGBUILDs from Git, fetches staging frommsys2-autobuild, builds the packages, and uploads them back tomsys2-autobuild. - Release: Developers fetch the built packages from
msys2-autobuild, sign them, and push them to thepacmanrepository.
- Trigger: A
Launch an MSYS2 environment
mainYou can launch specific MSYS2 environments using one of three methods:
- Wrapper Executables: Use the dedicated executables for the environment (e.g.,
ucrt64.exe). - msys2_shell.cmd with parameters: Call the shell script with a matching environment flag (e.g.,
msys2_shell.cmd -clang64). - MSYSTEM environment variable: Set the
MSYSTEMenvironment variable before running the shell.
msys2_shell.cmd -clang64- Wrapper Executables: Use the dedicated executables for the environment (e.g.,
Join the MSYS2 community for support and collaboration
mainIf you want to help the MSYS2 project, ask questions, or collaborate with developers, you can join the community via IRC, Matrix, or Discord. Note that response times may vary depending on participant availability.
Communication Channels:
- IRC: #msys2 on OFTC
- Matrix: msys2_msys2:gitter.im
- Discord: MSYS2 Discord Server