src/ledger/manifest.bend checks
raw source on the hub · import 0x886223f5c47e4983fe57d887c034bc7f/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 19 · 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.
Hub@named:String -> Source
Git@url:String -> @rev:String -> @tag:String -> @root:String -> @nar:String -> @vend:Bool -> Source
type Dep source · line 24 · raw
Data
one tracked dependency
Dep@name:String -> @hash:String -> @entry:String -> @source:Source -> Dep
type Tool source · line 31 · 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.
Tool@name:String -> @entry:String -> @bin:String -> @source:Source -> Tool
type Manifest source · line 39 · 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, Tool> -> Manifest
type Read source · line 45 · raw
Data
a manifest, or why it could not be read
Bad@why:String -> Read
Good@m:Manifest -> Read
Definitions
def value source · line 50 · raw
@pairs:List<&2, 0x886223f5c47e4983fe57d887c034bc7f/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 54 · raw
@sect:0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Sect -> @rest:List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Kv> -> @name:String -> List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Kv>
this section's pairs when its name matches, otherwise the rest's
def pairs_of source · line 59 · raw
@ss:List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Sect> -> @+name:String -> List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Kv>
the pairs of the section with this name, or none
def flag source · line 67 · raw
@+word:String -> Bool
vendor = true, bare or quoted, is the only spelling that commits the tree
def source.go source · line 71 · 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 81 · 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 91 · 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_of source · line 95 · raw
@+pairs:List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Kv> -> Source
where a dependency's section says its bytes come from
def dep_of source · line 103 · raw
@+full:String -> @+pairs:List<&2, 0x886223f5c47e4983fe57d887c034bc7f/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 108 · raw
@dependency:Dep -> String
a dependency's own name, for finding or replacing it
def dep.hash source · line 113 · raw
@dependency:Dep -> String
a dependency's hash, which is the 0x name its import line carries
def dep.entry source · line 119 · 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 124 · raw
@is_dep:Bool -> @sect:0x886223f5c47e4983fe57d887c034bc7f/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 133 · raw
@sect:0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Sect -> String
a section's name, for deciding what it is
def deps source · line 138 · raw
@ss:List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Sect> -> List<&2, Dep>
every [deps.<name>] section, as dependencies, in the order written
def tool_of source · line 146 · raw
@+full:String -> @+pairs:List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Kv> -> Tool
a [tools.<name>] section as a pinned CLI. The prefix is tools.
def tool.name source · line 151 · raw
@pin:Tool -> String
a tool's own name
def tool.entry source · line 156 · raw
@pin:Tool -> String
the file a pin names as its entry, or "" when the tool's ledger names it
def tool.bin source · line 161 · raw
@pin:Tool -> String
the file a pin names as its binary, or "" when the tool's ledger names it
def tool.source source · line 166 · raw
@pin:Tool -> Source
where a pinned CLI's bytes come from
def tools.put source · line 171 · raw
@is_tool:Bool -> @sect:0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Sect -> @rest:List<&2, Tool> -> List<&2, Tool>
a section joins the tools only when it is a [tools.<name>]
def tools source · line 180 · raw
@ss:List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Sect> -> List<&2, Tool>
every [tools.<name>] section, as pinned CLIs, in the order written
def missing.at source · line 188 · 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 196 · raw
@sect:0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Sect -> Bool
a [deps.<name>] section is missing its hash when the key is absent
def missing source · line 201 · raw
@ss:List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Sect> -> String
the first dependency section with no hash, or "" when every one has one
def problem source · line 210 · 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 216 · raw
@+ss:List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Sect> -> Read
the ledger, once the document is known to be sound
def read.go source · line 225 · raw
@ok:Bool -> @why:String -> @ss:List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Sect> -> Read
the ledger, or the problem that stopped it
def read source · line 233 · raw
@+bad:String -> @+ss:List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Sect> -> Read
the sections judged, then read
def parse.go source · line 238 · raw
@toml:0x886223f5c47e4983fe57d887c034bc7f/src/toml/toml.Toml -> Read
the parsed document, taken apart
def parse source · line 243 · raw
@text:String -> Read
the ledger written in an ez.toml
def show.source source · line 247 · raw
@src:Source -> String
how a dependency reads on one line
def show.dep source · line 255 · raw
@dependency:Dep -> String
<name>=<hash>@<hub|git>
def show.deps source · line 261 · 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 269 · raw
@manifest:Manifest -> String
the ledger on one line, for a test or a report
def show source · line 274 · raw
@ledger:Read -> String
the ledger, or the error, on one line
def find.pick source · line 282 · raw
@hit:Bool -> @dependency:Dep -> @rest:Dep -> Dep
this dependency when its name matches, otherwise whatever the rest gave
def find.at source · line 290 · raw
@+dependency:Dep -> @rest:Dep -> @name:String -> Dep
the dependency of this name, or a blank one
def find source · line 295 · raw
@ds:List<&2, Dep> -> @+name:String -> Dep
the dependency of this name, or one with empty fields
def dep source · line 303 · raw
@ledger:Read -> @name:String -> Dep
the named dependency of a ledger that was read
def source.rev source · line 312 · raw
@src:Source -> String
the commit a dependency is pinned to, or "" when it is a hub package
def source.tag source · line 320 · raw
@src:Source -> String
the tag a dependency was asked for, or "" when it was pinned by commit
def source.url source · line 328 · raw
@src:Source -> String
the repo a dependency was vendored from, or "" when it is a hub package
def source.root source · line 336 · raw
@src:Source -> String
the directory inside the checkout a dependency's paths are written from
def source.nar source · line 344 · raw
@src:Source -> String
the NAR hash nix rebuilds a dependency's checkout by
def source.nv source · line 353 · 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 361 · raw
@src:Source -> Bool
whether a dependency names a repo rather than the hub
def source.vendor source · line 369 · raw
@src:Source -> Bool
whether an upgrade that moves this dependency also commits the new tree
def source.dep source · line 377 · raw
@dependency:Dep -> Source
the source of a dependency that was found
def rev_of source · line 382 · raw
@ledger:Read -> @name:String -> String
the commit the named dependency is pinned to
def tag_of source · line 386 · raw
@ledger:Read -> @name:String -> String
the tag the named dependency was asked for
def hub.or source · line 393 · 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 398 · 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 407 · raw
@ledger:Read -> List<&2, Tool>
the pinned CLIs of a ledger that was read; one that would not parse has none
def tool.find.pick source · line 416 · raw
@hit:Bool -> @pin:Tool -> @rest:Tool -> Tool
this tool when its name matches, otherwise whatever the rest gave
def tool.find.at source · line 424 · raw
@+pin:Tool -> @rest:Tool -> @+name:String -> Tool
the tool of this name, or a blank one
def tool.find source · line 428 · raw
@ts:List<&2, Tool> -> @+name:String -> Tool
the tool of this name, or one with empty fields
def tool.step source · line 436 · raw
@hit:Bool -> @rest:(@_:Unit -> Bool) -> Bool
the rest of the scan only when this one was not it
def tool.has source · line 444 · raw
@ts:List<&2, Tool> -> @+name:String -> Bool
whether the ledger pins a CLI of this name
def tool.known.go source · line 452 · raw
@all:Bool -> @ts:List<&2, Tool> -> @+name:String -> Bool
an empty --package is every tool; a name is that one
def tool.known source · line 460 · raw
@+only:String -> @ts:List<&2, Tool> -> Bool
whether --package names a pinned CLI, or names nothing and so names all