Home / Docs / Configure a package

Versions, resolution and cooldowns

What it does

A need of a registry package names the least version its author tested, such as json 2.1: at least 2.1.0, on the major line 2. There are no upper bounds and no ranges. Resolution, minimal version selection, takes for each package the highest of the least versions that the program's needs ask for, never a newer one. So a release published later changes nothing until a need asks for it, and the result is the same on every machine.

A selection is raised past a release that is yanked, named by a security advisory, or avoided by the package, to the least later release that is none of these. Every such raise, and every una ita update, waits a cooldown of 72 hours after the release was logged, measured by the registry's witnesses, never by a publisher's clock. So a release logged less than 72 hours ago is not taken by a raise, by una ita update, or by una ita add with no version, unless --now is given or update is given a shorter --cooldown; the fix that a threshold-signed advisory names by digest is exempt. A need that names such a version itself still selects it.

In release 0.4.0 no registry is served and no command builds one or a mirror, so resolution has no registry package to select yet. Path dependencies are the dependencies usable in this release (see path dependencies). This release resolves path dependencies and the packages of the sources that sources declares, each read from a mirror directory that Itaoca's mirrors.una lists for it and verified. A need of itaty, the planned public registry, is read and checked, then refused (U7008), so no import reaches a package that is not checked: its root is not built into this release, so nothing it serves can be verified. una ita lock, update and add do not resolve it either (U7013), and resolution never works from a partial view of a registry:

ita.unauna
-- fails with U7008
ita shop
  version 0.1.0
  edition 0.4

needs
  json 2.1
ita.lockuna
lock 1

solver
  encoding "una-smt-1"
  name "z3"
  version "5.1.0"
  logic "QF_UFLIA"
  steps 5000000
  seed 0

package json 2.1.0
  from itaty
  digest "sha256:0000000000000000000000000000000000000000000000000000000000000000"
src/shop.unauna
module shop

pub one() -> Int = 1

Forms

text
needs
  <name> <MAJOR.MINOR[.PATCH]> [as <local>] [from <source>]
    avoid <version>

Examples

A source read from a mirror is raised past the cooldown:

Terminal
$ una ita update acme/ledger
change acme/ledger 0.3.1 -> 0.3.2 (acme): digest sha256:… -> sha256:…; may nothing; uses nothing

A need of itaty, in this release:

Diagnostic
$ una ita update json
error[U7013]: `json` is a package of `itaty`, whose root metadata is not built into this release, so the per-name state of `itaty` at a resolution point cannot be verified; this release resolves path dependencies and the sources of `sources`

Edge cases

Diagnostics

Edition

Edition 0.4 and later, a preview.

Normative source