Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


mingw (17) Versions 2.1.0

Installs a mingw/msys based toolchain on windows

cookbook 'mingw', '= 2.1.0', :supermarket
cookbook 'mingw', '= 2.1.0'
knife supermarket install mingw
knife supermarket download mingw
Quality 100%

mingw Cookbook

Cookbook Version Build Status

Installs a mingw/msys based compiler tools chain on windows. This is required for compiling C software from source.



  • Windows


  • Chef 12.5+


  • seven_zip


Add this cookbook as a dependency to your cookbook in its metadata.rb and include the default recipe in one of your recipes.

# metadata.rb
depends 'mingw'
# your recipe.rb
include_recipe 'mingw::default'

Use the msys2_package resource in any recipe to fetch msys2 based packages. Use the mingw_get resource in any recipe to fetch mingw packages. Use the mingw_tdm_gcc resource to fetch a version of the TDM GCC compiler.

By default, you should prefer the msys2 packages as they are newer and better supported. C/C++ compilers on windows use various different exception formats and you need to pick the right one for your task. In the 32-bit world, you have SJLJ (set-jump/long-jump) based exception handling and DWARF-2 (shortened to DW2) based exception handling. SJLJ produces code that can happily throw exceptions across stack frames of code compiled by MSVC. DW2 involves more extensive metadata but produces code that cannot unwind MSVC generated stack-frames - hence you need to ensure that you don't have any code that throws across a "system call". Certain languages and runtimes have specific requirements as to the exception format supported. As an example, if you are building code for Rust, you will probably need a modern gcc from msys2 with DW2 support as that's what the panic/exception formatter in Rust depends on. In a 64-bit world, you may still use SJLJ but compilers all commonly support SEH (structured exception handling).

Of course, to further complicate matters, different versions of different compilers support different exception handling. The default compilers that come with mingw_get are 32-bit only compilers and support DW2. The TDM compilers come in 3 flavors: a 32-bit only version with SJLJ support, a 32-bit only version with DW2 support and a "multilib" compiler which supports only SJLJ in 32-bit mode but can produce 64-bit SEH code. The standard library support varies drastically between these various compiler flavors (even within the same version). In msys2, you can install a mingw-w64 based compilers for either 32-bit DW2 support or 64-bit SEH support. If all this hurts your brain, I can only apologize.



  • ':install' - Installs an msys2 package using pacman.
  • ':remove' - Uninstalls any existing msys2 package.
  • ':upgrade' - Upgrades the specified package using pacman.

All options also automatically attempt to install a 64-bit based msys2 base file system at the root path specified. Note that you probably won't need a "32-bit" msys2 unless you are actually on a 32-bit only platform. You can still install both 32 and 64-bit compilers and libraries in a 64-bit msys2 base file system.


  • node['msys2']['url'] - overrides the url from which to download the package.
  • node['msys2']['checksum'] - overrides the checksum used to verify the downloaded package.


  • package - An msys2 pacman package (or meta-package) to fetch and install. You may use a legal package wild-card pattern here if you are installing. This is the name attribute.
  • root - The root directory where msys2 tools will be installed. This directory must not contain any spaces in order to pacify old posix tools and most Makefiles.


To get the core msys2 developer tools in C:\msys2

msys2_package 'base-devel' do
  root 'C:\msys2'



  • :install - Installs a mingw package from sourceforge using mingw-get.exe.
  • :remove - Uninstalls a mingw package.
  • :upgrade - Upgrades a mingw package (even to a lower version).


  • package - A mingw-get package (or meta-package) to fetch and install. You may use a legal package wild-card pattern here if you are installing. This is the name attribute.
  • root - The root directory where msys and mingw tools will be installed. This directory must not contain any spaces in order to pacify old posix tools and most Makefiles.


To get the core msys developer tools in C:\mingw32

mingw_get 'msys-base=2013072300-msys-bin.meta' do
  root 'C:\mingw32'



  • :install - Installs the TDM compiler toolchain at the given path. This only gives you a compiler. If you need any support tooling such as make/grep/awk/bash etc., see mingw_get.


  • flavor - Either :sjlj_32 or :seh_sjlj_64. TDM-64 is a 32/64-bit multi-lib "cross-compiler" toolchain that builds 64-bit by default. It uses structured exception handling (SEH) in 64-bit code and setjump-longjump exception handling (SJLJ) in 32-bit code. TDM-32 only builds 32-bit binaries and uses SJLJ.
  • root - The root directory where compiler tools and runtime will be installed. This directory must not contain any spaces in order to pacify old posix tools and most Makefiles.
  • version - The version of the compiler to fetch and install. This is the name attribute. Currently, '5.1.0' is supported.


To get the 32-bit TDM GCC compiler in C:\mingw32

mingw_tdm_gcc '5.1.0' do
  flavor :sjlj_32
  root 'C:\mingw32'

License & Authors

Author: Cookbook Engineering Team (

Copyright: 2009-2016, Chef Software, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

mingw Cookbook CHANGELOG

This file is used to list changes made in each version of the mingw cookbook.

2.1.0 (2018-07-24)

  • refactor msys2 package source and checksum to attributes

2.0.2 (2018-02-15)

  • Remove kind_of usage in the custom resources (FC117)

2.0.1 (2017-04-26)

  • Test with Local Delivery instead of Rake
  • Add chef_version to the metadata
  • Use standardize Apache 2 license string

2.0.0 (2017-02-27)

  • Require Chef 12.5 and remove compat_resource dependency

1.2.5 (2017-01-18)

  • Require a working compat_resource

v1.2.4 (2016-07-26)

  • New msys2 shells do not inherit PATH from windows. Provide a way for clients to do this.

v1.2.3 (2016-07-25)

  • If PKG_CONFIG_PATH is already defined, honor it in the msys2 shell.

v1.2.2 (2016-06-24)

  • Download msys2 from the primary download url (instead of a specific mirror).

v1.2.1 (2016-06-23)

  • Fix msys2 initial install/upgrade steps that dependended on file modification time.
  • Make msys2_package :install idempotent - it should not reinstall packages.
  • Do not allow bash.exe to be called if MSYSTEM is undefined.

v1.2.0 (2016-06-03)

  • Updating to fix the issue where msys2 bash does not inherit the cwd correctly

v1.1.0 (2016-06-03)

  • Add msys2 based compiler support using the new msys2_package resource

v1.0.0 (2016-05-11)

  • Remove unnecessary default_action from the resources
  • Depend on compat_resource cookbook to add Chef 12.1 - 12.4 compatbility
  • Add this changelog file
  • Fix license metadata in metadata.rb
  • Disable FC016 check

Collaborator Number Metric

2.1.0 passed this metric

Contributing File Metric

2.1.0 passed this metric

Foodcritic Metric

2.1.0 passed this metric

No Binaries Metric

2.1.0 passed this metric

Testing File Metric

2.1.0 passed this metric

Version Tag Metric

2.1.0 passed this metric