Platform Details
This action installs the Nim compiler so cibuildwheel can compile your extension. See the support matrix for what is tested.
Linux
Wheels are built inside manylinux Docker containers.
The action:
- Appends
*-musllinux*toCIBW_SKIPunless you already skipped musllinux (official Nim binaries are glibc). - Selects
linux_x64orlinux_arm64from the native runner architecture. - Prepends installation commands to
CIBW_BEFORE_ALL_LINUXto installxz,curl, andgcc, download Nim, and verify its.sha256file. - Runs any caller-provided
CIBW_BEFORE_ALL_LINUXcommands after Nim is available.
Linux aarch64 is tested on the native ubuntu-24.04-arm runner. Use a native
runner matching the requested wheel architecture.
Container images
cibuildwheel chooses the manylinux image. You can override image names with the
usual CIBW_MANYLINUX_* variables; the Nim archive continues to match the
runner architecture.
Customizing Linux builds
The action preserves CIBW_BEFORE_ALL_LINUX and runs it after installing Nim:
env:
CIBW_BEFORE_ALL_LINUX: "nimble install cligen -y"
macOS
The action downloads the official archive for the runner CPU:
nim-<version>-macosx_arm64.tar.xzon Apple Siliconnim-<version>-macosx_x64.tar.xzon Intel
Checksums are verified with shasum -a 256 -c. Cross-compiling a macOS wheel for the other architecture is not in the tested matrix.
steps:
- name: Build wheels (Apple Silicon runner)
runs-on: macos-14
# Native arm64 Nim
Windows
- Installs the requested Nim version with Chocolatey
- Uses the MinGW dependency installed by the Chocolatey Nim package
- Adds
C:\tools\Nim\nim-<version>\bintoPATH; Chocolatey supplies the compiler path
Default generated projects statically link MinGW runtimes via nuwa-build (windows-static-linking = true).
Environment variables
Use the standard cibuildwheel hooks for extra setup. On Linux, a supplied
CIBW_BEFORE_ALL_LINUX hook is appended after Nim installation.
See cibuildwheel settings for CIBW_BUILD, CIBW_SKIP, and architecture flags.