Skip to main content

Module sync

Module sync 

Source
Expand description

Package update & synchronization layer for the Soroban DevKit (sdkt), .

After sdkt package fetch materializes dependencies into .sdkt-cache and records them in sdkt.lock, sdkt package update reconciles the lock with what is currently available upstream and refreshes the on-disk checkouts.

Design goals (reuse, no duplication):

  • GitFetcher / git_cache_key / git_bin do all git I/O — this module only decides what to fetch and what to write.
  • lock_dependencies_resolved (in lock.rs) is the single writer of DependencyLock entries, shared with sdkt package fetch.
  • read_lock / write_lock keep sdkt.lock stable; contract artifacts and deploy order are never touched.
  • validate_manifest is reused for manifest sanity before any work.

Reference semantics:

  • rev — immutable, already pinned; never updated.
  • tag — resolve the tag’s current commit; if it differs from the lock, update.
  • branch — fetch the latest branch head; if it differs from the lock, update.

Offline-first: available commits are resolved via git ls-remote against the declared git URL. For a local-path “remote” (used in tests and for local mirrors) this needs no network; reaching a real remote does, and a failure is reported as a clear network/git error rather than a panic.

Structs§

UpdateChange
One dependency’s update result.
UpdateReport
Aggregate report for sdkt package update (check / dry-run / apply).

Enums§

SyncError
Errors that abort an update before producing a partial result.
UpdateStatus
Outcome state for a single dependency during an update plan/apply.

Functions§

apply_updates
Apply updates: fetch/refresh every git dependency whose available commit differs from the lock (tag/branch only; rev is skipped as pinned), then rewrite sdkt.lock with the new commit, cache location, and integrity — preserving contract artifacts and deploy order.
plan_updates
Compute the read-only update plan: what would change, without touching the cache or the lock. This powers both --check and --dry-run.