repo/toolchain-pinned/cpp
Toolchain version is pinned
Implements repo/toolchain-pinned for cpp.
| Severity | warning |
| Tiers | 1, 2 |
| Stacks | cpp |
| Scope | each |
| Kind | expr |
| Source | library v0.5.0 |
| Selected by | fleetlint-recommended@v0.5.0 |
Requirement
The compiler or build tool is pinned: .tool-versions/mise naming cmake, clang/llvm, gcc, conan, ninja or meson with a version, a Conan profile with compiler.version, or a dev container image pinned by digest. cmake_minimum_required is a floor, not a pin.
Why
Without a pin, every machine and every CI run builds with whatever compiler or runtime happens to be installed, and failures cannot be reproduced.
Check
["", "../", "../../", "../../../"].exists(d, file(d + ".tool-versions") && scan(d + ".tool-versions", r'^\s*(cmake|clang|llvm|gcc|conan|ninja|meson)\s+\S*\d').size() > 0) || ["", "../", "../../", "../../../"].exists(d, ["mise.toml", ".mise.toml", ".config/mise.toml", ".config/mise/config.toml", "mise/config.toml"].exists(n,
file(d + n) && scan(d + n, r'^\s*"?(cmake|clang|llvm|gcc|conan|ninja|meson)"?\s*=\s*[^#\n]*\d').size() > 0))
|| (glob(".conan/profiles/*") + glob("conan/profiles/*") + glob("profiles/*")).exists(f, text(f).matches(r'(?m)^\s*compiler\.version\s*=\s*\d')) || [".devcontainer/devcontainer.json", ".devcontainer.json"].exists(f, file(f) && text(f).matches(r'"image"\s*:\s*"[^"]+@sha256:'))Fix
Pin the toolchain with mise (mise use cmake@3.x clang@18) or build in a digest-pinned dev container image.
Agent instruction: Add the stack’s toolchain pin set to the version currently installed; do not upgrade the toolchain in the same change.
A finding of this rule points at mise.toml.
Sources
- https://fleetlint.org/baseline/#hygiene (convention)
- https://mise.jdx.dev/configuration.html (spec)
- https://fleetlint.org/stacks/
- https://fleetlint.org/stacks/#cc (convention)
Generated by fleetlint docs from catalog v0.5.0.