Skip to content

yaoxiang.lock Format ​

yaoxiang.lock records the exact version information after dependency resolution.

Overview ​

  • Automatically generated: maintained by yx install and yx update
  • Do not edit manually
  • Should be committed to version control: to ensure team members and CI use the same versions

File Structure ​

toml
# This file is automatically generated by yaoxiang, do not edit manually.

version = 1

[package.依赖名]
version = "版本号"
source = "来源"
checksum = "SHA-256"

version is at the top level, not in the [package] section version = 1 is a

top-level key for the file, describing the lock file format version. Each dependency forms its own [package.<dependency name>] table, with no version format version field inside the table.

Field Description ​

Top Level ​

FieldTypeDescription
versionintegerLock file format version, currently 1
packagetableOne [package.<name>] table per dependency

[package.<dependency name>] ​

FieldTypeDescription
versionstringResolved version number
sourcestringDependency source; the default value is registry, and the line is omitted when using the default
checksumstringSHA-256 checksum; not written for local sources

Source Values ​

source valueCorresponding declarationChecksum written
git{ git = "https://..." }✅
path{ path = "../lib" }❌
workspace{ workspace = "key" }❌
registrysome-lib = "1.0.0"Not yet implemented

Examples ​

Git source (with checksum):

toml
# This file is automatically generated by yaoxiang, do not edit manually.

version = 1

[package.some-lib]
version = "0.1.0"
source = "git"
checksum = "8a56047cbb1c706f4c1bcadbaaae610d466c698f7622adf03b0d749212207914"

Workspace source:

toml
# This file is automatically generated by yaoxiang, do not edit manually.

version = 1

[package.mylib]
version = "0.1.0"
source = "workspace"

Relationship with the Manifest ​

yaoxiang.toml                yaoxiang.lock
     │                             │
     │  yx install / yx update     │
     ├────────────────────────────►│
     │                             │
     │  declares "^0.1.0"          │  locks "0.1.0" + checksum
  • yaoxiang.toml: declares the desired range
  • yaoxiang.lock: records the actually resolved version

If the two are inconsistent at build time, an error is reported prompting you to run yx install — it does not silently auto-install.

vendor Consistency ​

yx run / yx check verifies that .yaoxiang/vendor/ is consistent with the lock file. When the manifest declares dependencies but install has never been run, the error message will suggest running yaoxiang install.