src/ledger/manifest.bend checks
raw source on the hub · import ezx@1.16.0.0/src/ledger/manifest.bend as Manifest
ledger/manifest: the dependency ledger, and ez's ledger library. Bend's
import lines carry a bare 0x<hash>, which says nothing about what the
package is or where it came from, and nothing in a repo lists them.
ez.toml is that list: every package the repo imports, by name, with its
hash and its origin.
2 imports
import Base import ../toml/toml.bend as T
Types
type Source source · line 29 · raw
Data
where a package's bytes come from. A hub package needs nothing else, though
one added by its <name>@<version> keeps it, which is what its import lines
say and what the hub named the hash by; a git one pins a commit, and
remembers the tag that was asked for so an upgrade knows what to
re-resolve. It also carries the two facts nothing can work out again
without the checkout: the directory inside it the package's paths are written
from, and the NAR hash nix rebuilds it by. They live here, in the file that is
committed, because a clone gets the ledger and not the vendoring cache.
vend is the committed tree: the package is allowlisted under .ez/lib and
an upgrade that moves it lays the new hash there. Absent, it is not.
A member of the same workspace is the third kind
(laws/WorkspaceMemberDependency.bend): a section with workspace = true
names the member whose [package] name is its key, and records no hash
and no source, because the member's package is a fact about the committed
tree. A member's own ledger reads it with an empty path and named; the
workspace's joint ledger (ws/joint.bend) fills in the member's directory
from the root, written as path, its hash, and, when the member publishes
under a name, the <name>@<version> it is imported by, written as hub.
No command writes those to a ledger a person keeps.
Hub@named:String -> Source
Git@url:String -> @rev:String -> @tag:String -> @root:String -> @nar:String -> @vend:Bool -> Source
Member@path:String -> @named:String -> Source
type Dep source · line 35 · raw
Data
one tracked dependency
Dep@name:String -> @hash:String -> @entry:String -> @source:Source -> Dep
type Cli source · line 42 · raw
Data
one pinned CLI. The git fields are a dependency's. It is not a package:
it has no 0x name, it is not imported, and it is not put on BEND_LIB.
entry and bin name the file to build when the tool's own ledger should
not be the one.
Cli@name:String -> @entry:String -> @bin:String -> @source:Source -> Cli
type Manifest source · line 50 · raw
Data
the ledger: this package, the file ez build and ez run take, the file
ez tool run, install and upgrade build when one is named, the hub its
packages come from ("" for bend's own), the hub name and the version ez
publish names the package by ("" for none, which publishes it by its hash
alone), everything the package depends on, and every CLI it pins
Manifest@name:String -> @entry:String -> @bin:String -> @hub:String -> @publish:String -> @version:String -> @deps:List<&2, Dep> -> @tools:List<&2, Cli> -> Manifest
type Read source · line 56 · raw
Data
a manifest, or why it could not be read
Bad@why:String -> Read
Good@m:Manifest -> Read
Definitions
def value source · line 61 · raw
@pairs:List<&2, 0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Kv> -> @key:String -> String
the value written for a key in a section, or "" when it is absent
def pairs.at source · line 65 · raw
@sect:0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Sect -> @rest:List<&2, 0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Kv> -> @name:String -> List<&2, 0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Kv>
this section's pairs when its name matches, otherwise the rest's
def pairs_of source · line 70 · raw
@ss:List<&2, 0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Sect> -> @+name:String -> List<&2, 0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Kv>
the pairs of the section with this name, or none
def flag source · line 78 · raw
@+word:String -> Bool
vendor = true, bare or quoted, is the only spelling that commits the tree
def source.go source · line 82 · raw
@hub:Bool -> @url:String -> @rev:String -> @tag:String -> @root:String -> @nar:String -> @vend:Bool -> Source
no git key means the package lives on the hub
def source.named source · line 92 · raw
@named:String -> @src:Source -> Source
a hub source, with the <name>@<version> a dependency's section records
under hub, "" for none. A git source keeps no name, and neither does a
tool: a tool is not imported, so nothing names it.
def root.or source · line 104 · raw
@+dir:String -> String
a git section that names no root was written from the top of its checkout, which is the root a lock already spells out as "." and the only one a ledger written before this key existed can have meant
def source.ws source · line 109 · raw
@member:Bool -> @path:String -> @named:String -> @other:Source -> Source
a dependency section's source, once it is known whether it names a workspace member, which only a dependency can be
def source_of source · line 117 · raw
@+pairs:List<&2, 0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Kv> -> Source
where a dependency's section says its bytes come from
def dep_of source · line 125 · raw
@+full:String -> @+pairs:List<&2, 0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Kv> -> Dep
a [deps.<name>] section as a dependency. A hub dependency added by its
<name>@<version> records it as hub, beside the hash it named when it
was added, as a git dependency records its tag beside its rev.
def dep.name source · line 131 · raw
@dependency:Dep -> String
a dependency's own name, for finding or replacing it
def dep.hash source · line 136 · raw
@dependency:Dep -> String
a dependency's hash, which is the 0x name its import line carries
def dep.entry source · line 142 · raw
@dependency:Dep -> String
the file inside the package a dependency was added by, which is the file its hash was computed from
def deps.put source · line 147 · raw
@is_dep:Bool -> @sect:0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Sect -> @rest:List<&2, Dep> -> List<&2, Dep>
a section joins the dependencies only when it is a [deps.<name>]
def name_of source · line 156 · raw
@sect:0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Sect -> String
a section's name, for deciding what it is
def deps source · line 161 · raw
@ss:List<&2, 0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Sect> -> List<&2, Dep>
every [deps.<name>] section, as dependencies, in the order written
def tool_of source · line 169 · raw
@+full:String -> @+pairs:List<&2, 0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Kv> -> Cli
a [tools.<name>] section as a pinned CLI. The prefix is tools.
def tool.name source · line 174 · raw
@pin:Cli -> String
a tool's own name
def tool.entry source · line 179 · raw
@pin:Cli -> String
the file a pin names as its entry, or "" when the tool's ledger names it
def tool.bin source · line 184 · raw
@pin:Cli -> String
the file a pin names as its binary, or "" when the tool's ledger names it
def tool.source source · line 189 · raw
@pin:Cli -> Source
where a pinned CLI's bytes come from
def tools.put source · line 194 · raw
@is_tool:Bool -> @sect:0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Sect -> @rest:List<&2, Cli> -> List<&2, Cli>
a section joins the tools only when it is a [tools.<name>]
def tools source · line 203 · raw
@ss:List<&2, 0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Sect> -> List<&2, Cli>
every [tools.<name>] section, as pinned CLIs, in the order written
def missing.at source · line 211 · raw
@bad:Bool -> @name:String -> @rest:String -> String
a dependency with no hash cannot be resolved, so it is reported by name
def missing.is source · line 219 · raw
@sect:0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Sect -> Bool
a [deps.<name>] section is missing its hash when the key is absent
def missing source · line 225 · raw
@ss:List<&2, 0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Sect> -> String
the first dependency section with no hash, or "" when every one has one
def problem source · line 234 · raw
@+bad:String -> @+miss:String -> String
the first problem with the document, or "" when there is none. A syntax error comes first, since a section that did not parse cannot be judged.
def build source · line 240 · raw
@+ss:List<&2, 0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Sect> -> Read
the ledger, once the document is known to be sound
def read.go source · line 249 · raw
@ok:Bool -> @why:String -> @ss:List<&2, 0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Sect> -> Read
the ledger, or the problem that stopped it
def read source · line 257 · raw
@+bad:String -> @+ss:List<&2, 0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Sect> -> Read
the sections judged, then read
def parse.go source · line 262 · raw
@toml:0x71927e9fe3c5d91fa7a64d2340a0fdac/src/toml/toml.Toml -> Read
the parsed document, taken apart
def parse source · line 267 · raw
@text:String -> Read
the ledger written in an ez.toml
def show.source source · line 271 · raw
@src:Source -> String
how a dependency reads on one line
def show.dep source · line 281 · raw
@dependency:Dep -> String
<name>=<hash>@<hub|git>
def show.deps source · line 287 · raw
@ds:List<&2, Dep> -> List<&2, String>
every dependency shown, in the order written. Base's List.map is over a one-use list, and these are two-use, so the walk is written out.
def show.m source · line 295 · raw
@manifest:Manifest -> String
the ledger on one line, for a test or a report
def show source · line 300 · raw
@ledger:Read -> String
the ledger, or the error, on one line
def find.pick source · line 308 · raw
@hit:Bool -> @dependency:Dep -> @rest:Dep -> Dep
this dependency when its name matches, otherwise whatever the rest gave
def find.at source · line 316 · raw
@+dependency:Dep -> @rest:Dep -> @name:String -> Dep
the dependency of this name, or a blank one
def find source · line 321 · raw
@ds:List<&2, Dep> -> @+name:String -> Dep
the dependency of this name, or one with empty fields
def dep source · line 329 · raw
@ledger:Read -> @name:String -> Dep
the named dependency of a ledger that was read
def source.rev source · line 338 · raw
@src:Source -> String
the commit a dependency is pinned to, or "" when it is a hub package
def source.tag source · line 348 · raw
@src:Source -> String
the tag a dependency was asked for, or "" when it was pinned by commit
def source.url source · line 358 · raw
@src:Source -> String
the repo a dependency was vendored from, or "" when it is a hub package
def source.root source · line 368 · raw
@src:Source -> String
the directory inside the checkout a dependency's paths are written from
def source.nar source · line 378 · raw
@src:Source -> String
the NAR hash nix rebuilds a dependency's checkout by
def source.nv source · line 389 · raw
@src:Source -> String
the <name>@<version> a hub dependency was added by, or "" for one added
by its hash, and for a git one
def source.is_git source · line 399 · raw
@src:Source -> Bool
whether a dependency names a repo rather than the hub
def source.vendor source · line 409 · raw
@src:Source -> Bool
whether an upgrade that moves this dependency also commits the new tree
def source.dep source · line 419 · raw
@dependency:Dep -> Source
the source of a dependency that was found
def rev_of source · line 424 · raw
@ledger:Read -> @name:String -> String
the commit the named dependency is pinned to
def tag_of source · line 428 · raw
@ledger:Read -> @name:String -> String
the tag the named dependency was asked for
def hub.or source · line 435 · raw
@+url:String -> String
the hub a ledger's packages come from: the hub its [package] table
names, or bend's own when it names none. It is read from the committed
ledger and not from the environment, so two checkouts of one commit lock
against the same hub whatever their shells say.
def hub_of source · line 440 · raw
@ledger:Read -> String
the hub of a ledger that was read. One that would not parse names none, and so names bend's.
def tools_of source · line 449 · raw
@ledger:Read -> List<&2, Cli>
the pinned CLIs of a ledger that was read; one that would not parse has none
def tool.find.pick source · line 458 · raw
@hit:Bool -> @pin:Cli -> @rest:Cli -> Cli
this tool when its name matches, otherwise whatever the rest gave
def tool.find.at source · line 466 · raw
@+pin:Cli -> @rest:Cli -> @+name:String -> Cli
the tool of this name, or a blank one
def tool.find source · line 470 · raw
@ts:List<&2, Cli> -> @+name:String -> Cli
the tool of this name, or one with empty fields
def tool.step source · line 478 · raw
@hit:Bool -> @rest:(@_:Unit -> Bool) -> Bool
the rest of the scan only when this one was not it
def tool.has source · line 486 · raw
@ts:List<&2, Cli> -> @+name:String -> Bool
whether the ledger pins a CLI of this name
def tool.known.go source · line 494 · raw
@all:Bool -> @ts:List<&2, Cli> -> @+name:String -> Bool
an empty --package is every tool; a name is that one
def tool.known source · line 502 · raw
@+only:String -> @ts:List<&2, Cli> -> Bool
whether --package names a pinned CLI, or names nothing and so names all