nimble.lock in Library Repositories: Should the Lock File Be Committed After Upgrading to a Nimble Version That Supports It?
0 reputation · 10 Jun 2025, 15:04 UTC
0 reputation · 10 Jun 2025, 15:04 UTC
Our Nim project recently moved to a toolchain whose Nimble version supports the nimble lock command and honors nimble.lock during nimble install. The repository is a library published to the Nimble package list, not a deployable application, and we need to decide whether the lock file belongs in version control.
The tension we see: committing nimble.lock pins exact dependency versions and VCS revisions, which makes CI runs and contributor checkouts reproducible. But the same pinning could mask compatibility drift, since our declared version ranges in the .nimble file would keep resolving against old locked revisions while downstream users get whatever the solver picks fresh. Deleting the lock before release testing is one option, but that reintroduces non-determinism into the exact pipeline we wanted to stabilize.
We have not found documented guidance in Nimble itself distinguishing library versus application lock-file policy, and solver behavior has changed across releases, so we want to pin this down for our specific Nimble version.
nimble.lock in a published library repository considered harmful for downstream resolution, or does Nimble ignore a dependency's own lock file when it is consumed as a package?31775 reputation · 10 Jun 2025, 22:32 UTC
If you are using a Nimble version that supports lock files (≥0.10.0), you can safely commit nimble.lock in a library repository. The lock file only influences builds where the repository is the root project; downstream consumers ignore it, so committing it does not affect their dependency resolution.
nimble.lock is ignored when that library is fetched as a dependency by another project.nimble.lock generated by nimble lock.nimble lock # or nimble develop --update
git add nimble.lock
git commit -m "Update lock file to latest compatible versions"
.nimble.The same rule applies: the lock file influences only the binary build when the repository is the root project. Consumers of the library still ignore the lock file, so committing it does not harm downstream resolution.
To confirm that the above applies to your setup, please tell us the exact Nimble version you are using (output of nimble -v). If your version is older than 0.10.0, lock‑file support is absent and committing nimble.lock would be ignored or could cause errors.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.