repo/lockfile-committed/cpp
Dependency lockfile is committed
Implements repo/lockfile-committed for cpp.
| Severity | error |
| Tiers | 1, 2 |
| Stacks | cpp |
| Scope | each |
| Kind | expr |
| Source | library v0.4.0 |
| Selected by | fleetlint-recommended@v0.4.0 |
Requirement
With Conan, conan.lock is tracked; with vcpkg, vcpkg.json sets a builtin-baseline (or vcpkg-configuration.json a registry baseline), which fixes every port version. A build without a package manager needs neither.
Why
Builds are reproducible only when dependency versions are pinned in git.
Check
((!file("conanfile.txt") && !file("conanfile.py")) || "conan.lock" in tracked()) && (!file("vcpkg.json") || text("vcpkg.json").contains("\"builtin-baseline\"")
|| (file("vcpkg-configuration.json") && text("vcpkg-configuration.json").contains("\"baseline\"")))Fix
Conan: conan lock create . and commit conan.lock; vcpkg: vcpkg x-update-baseline --add-initial-baseline.
Agent instruction: Run the package manager to produce the lockfile, remove any .gitignore entry for it, and commit it.
Sources
- https://github.com/ossf/package-manager-best-practices/blob/main/published/npm.md (guidance)
- https://fleetlint.org/baseline/#dependencies (convention)
- https://docs.conan.io/2/tutorial/versioning/lockfiles.html (spec)
- https://learn.microsoft.com/en-us/vcpkg/users/versioning (spec)
- https://fleetlint.org/stacks/#cc
Generated by fleetlint docs from catalog v0.4.0.