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
resolveas 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-marsandrequires-meridianare judged against. - Engine
Failure - One unmet
requires-*. - Engine
Fallback - A source that took an older version because a newer one needs a newer engine.
- Engine
Fallback Skipped - Failed
- Locked
Content - The tree a marketplace plugin was read from. A plugin in the marketplace’s own repository
repeats the marketplace’s
urlandcommitwith its path assubpath; with a marketplace at a local path, a local plugin has only itssubpath. - Locked
Dependency - One
[dependencies.<name>]row ofmars.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
- Path
Request - A path dependency asked for:
pathas written (relative todeclared_in’s root, or absolute), narrowed tosubpath. - Path
Source - An answered path dependency: its canonical directory, and a tree rooted at
subpathbelow it. - Plugin
Root - 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 (
versionandtag), or a pinned ref (tagonly), or neither for a default branch or a path. - Request
- Requester
- Resolved
- Rooted
- A package root:
subpathbelow 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.
Missingis a commit or ref that does not exist, and the only answer that drops a lock;Failedis any other error and always stops resolution. - Bounds
Limit - Diagnostic
- Failed
Fetch - Why a lookup failed.
- Failure
- Why resolution stopped. Each kind carries what its message needs, and
Failure::messageis the one formatter:mars syncprints 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
- Plugin
Detail - Source
Id - 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.
- Subpath
Detail
Traits§
- Answers
- Every lookup the resolver makes. A tree is read on demand and rooted at
path(Noneis the whole repository); a lookup with no answer yet is an open need (Outcome::Needs).
Functions§
- locked_
dependency - The
mars.lockrow of a dependency resolved atcommit(undertag, when it has one). - resolve
- Resolve
request, askinganswers. - sort_
tags - The tags that are versions, oldest first; equal versions sort by tag, so the order of a listing never changes the choice.