Lockfile Format
Status: š¢ Implemented ā generated, read, and verified on every build.
Kargo.lock records the exact resolution of your dependency graph: every
artifact, its version, its checksum, and where it came from. A build with a
current lockfile performs no version resolution.
You do not edit this file. kargo add, kargo remove, kargo update, and
kargo lock write it.
Shape
[[package]]
name = "kotlinx-coroutines-core"
group = "org.jetbrains.kotlinx"
version = "1.8.0"
checksum = "sha256:1a2b3cā¦"
source = "https://repo.maven.apache.org/maven2"
scope = "compile"
targets = ["jvm", "ios-arm64"]
[[package.dependencies]]
name = "kotlin-stdlib"
group = "org.jetbrains.kotlin"
version = "1.9.21"
[[package]]
name = "kotlin-stdlib"
group = "org.jetbrains.kotlin"
version = "1.9.21"
checksum = "sha256:4d5e6fā¦"
source = "https://repo.maven.apache.org/maven2"
scope = "compile"
targets = ["jvm", "ios-arm64"]
[[package]]
| Field | Type | Description |
|---|---|---|
name | string | Maven artifact id. |
group | string | Maven group id. |
version | string | The exact resolved version. |
checksum | string | sha256: or sha1: digest of the artifact. |
source | string | Repository URL the artifact came from. |
scope | string | Resolved scope: compile, runtime, provided, test, ksp, kapt. tool marks a jar Kargo provisions for itself, such as the test launcher. |
targets | list | Targets whose graph includes this package. |
packaging | string | What the package publishes, when that is not a jar: aar for an Android library. |
[[package.dependencies]]
The edges of the graph, as name, group, and version triples pointing at
other [[package]] entries. Storing edges rather than a flat list is what lets
kargo tree --why reconstruct the path to any artifact without re-resolving.
Properties
Deterministic. Packages are written in sorted order with sorted fields, so resolving the same manifest twice produces byte-identical output. A diff shows dependency changes, not reordering noise.
Complete. Every transitive artifact appears, not just your direct dependencies.
Verified. Checksums are checked on download and on cache reads. A corrupted or substituted artifact fails the build rather than reaching the compiler.
Atomic. The file is written to a temporary file in the same directory and then renamed, so an interrupted write cannot leave a truncated lockfile.
Per-target aware. The targets field records which targets include each
package, so a multiplatform project can resolve different artifacts per platform
within one lockfile.
Commands
kargo lock # resolve the manifest and rewrite the lockfile
kargo fetch # download everything the lockfile names
kargo fetch --verify # re-verify checksums of cached artifacts
kargo update # move to newer compatible versions
kargo update --dry-run # show what would change
Committing it
| Project | Commit | Reason |
|---|---|---|
| Application | Yes | Every machine and CI run builds an identical graph. |
| Library | Usually not | Consumers resolve their own graph; yours has no effect on them. |
For a library, committing the lockfile pins only what your own CI tests against. That is a defensible choice ā just know it does nothing for your users.
When it is regenerated
| Action | Effect |
|---|---|
kargo add / kargo remove | Incremental update for the changed dependency. |
kargo update | Versions re-resolved within the allowed range. |
kargo lock | Full re-resolution from the manifest. |
Editing Kargo.toml by hand | The next build detects the mismatch and re-resolves. |
kargo build with a current lockfile | No resolution at all. |
Merge conflicts
A conflict in Kargo.lock is not worth resolving by hand. Take either side and
regenerate:
git checkout --theirs Kargo.lock
kargo lock
The result is deterministic, so you will get the correct file regardless of which side you started from.