Skip to main content

Module resolve

Module resolve 

Source
Expand description

Which version of which source, for a whole dependency graph.

resolve is a pure function over Answers: it asks for the tags of a repository, what a ref points at, the files of a commit, and never fetches. mars sync answers each question as it is asked (so no question stays open and the order of work is the CLI’s); Flow answers from a map and gets back the questions still open (Outcome::Needs).

A pass walks the graph from the root; a constraint that changes a version already chosen restarts the walk with that choice fixed, and diagnostics belong to the last pass only. Selection of items, hooks and installation are not here: the caller runs them on the graph this returns.

Modules§

wire
resolve as Flow calls it: JSON in, JSON out, answers from a list.

Structs§

BadVersion
A running engine version that is not a version.
Bounds
Dependency
One request for a source by name.
Engine
The versions requires-mars and requires-meridian are judged against.
EngineFailure
One unmet requires-*.
EngineFallback
A source that took an older version because a newer one needs a newer engine.
EngineFallbackSkipped
Failed
LockedContent
The tree a marketplace plugin was read from. A plugin in the marketplace’s own repository repeats the marketplace’s url and commit with its path as subpath; with a marketplace at a local path, a local plugin has only its subpath.
LockedDependency
One [dependencies.<name>] row of mars.lock: where a dependency came from and the commit it was resolved to. The serialized form is the lock file’s, so a field is added only with a default and never reordered.
Node
PathRequest
A path dependency asked for: path as written (relative to declared_in’s root, or absolute), narrowed to subpath.
PathSource
An answered path dependency: its canonical directory, and a tree rooted at subpath below it.
PluginRoot
A marketplace plugin as acquired: kept with the rooted package so that preparing it again (a restart pass) reads it through the same marketplace entry, never a fresh fetch.
Ref
A package’s resolved version: the tag it was selected at (version and tag), or a pinned ref (tag only), or neither for a default branch or a path.
Request
Requester
Resolved
Rooted
A package root: subpath below a checkout.
Step
Tag
A tag of a repository and the commit it points at, peeled for an annotated tag.
TagVersion
A tag that is a version.

Enums§

Answer
What a lookup found. Missing is a commit or ref that does not exist, and the only answer that drops a lock; Failed is any other error and always stops resolution.
BoundsLimit
Diagnostic
FailedFetch
Why a lookup failed.
Failure
Why resolution stopped. Each kind carries what its message needs, and Failure::message is the one formatter: mars sync prints that text, and so does Flow.
Identity
Level
Mode
How a run treats the lock.
Need
An answer the resolver is waiting for.
Origin
Where a package’s files are.
Outcome
PluginDetail
SourceId
The identity of a source: the same one under two names, or one name for two, is refused.
Spec
Where a dependency’s package comes from, as an entry spells it.
SubpathDetail

Traits§

Answers
Every lookup the resolver makes. A tree is read on demand and rooted at path (None is the whole repository); a lookup with no answer yet is an open need (Outcome::Needs).

Functions§

locked_dependency
The mars.lock row of a dependency resolved at commit (under tag, when it has one).
resolve
Resolve request, asking answers.
sort_tags
The tags that are versions, oldest first; equal versions sort by tag, so the order of a listing never changes the choice.