src/ws/run.bend relies on unsafe/foreign
raw source on the hub · import ezx@1.18.0.0/src/ws/run.bend as Run
ws/run: the interpreter's half of workspaces. It reads what the root search
asks for (ws/root.bend) and runs the hop ws/hop.bend decides, and for ez
lock it reads every ez.toml git lists under a workspace root so that
ws/joint.bend can join them. It decides nothing: where the root is, whether
to run again there, which ledgers are members and what the lock is planned
from are the pure modules'. That it reads and runs faithfully is
trusted in ez/app.bend. It runs programs, so no law imports it.
18 imports
import Base import snap@1.6.0.0/main.bend as Sn import ../io/file.bend as F import ../share/args.bend as Args import ../share/pass.bend as Pass import ../ledger/render.bend as Rend import ./workspace.bend as W import ./root.bend as R import ./hop.bend as H import ./joint.bend as J import ./up.bend as U import ./pin.bend as Pin import ../ledger/manifest.bend as M import ../pkg/path.bend as P import ../pkg/pkg.bend as K import ../lock/world.bend as LW import ./doctor.bend as Doc import ./relock.bend as Rel
Types
type Searched source · line 28 · raw
Data
what the search found, and the top of the checkout it searched from
Searched@top:String -> @found:0x2414c9622cab2353684d02a392804eb1/src/ws/root.Found -> Searched
type Planned source · line 141 · raw
Data
the ledger ez lock is planned from, what an upgrade needs to write its
pins back, and the answers the lock reads the workspace's members from
Planned@ledger:Maybe<&2, String> -> @back:0x2414c9622cab2353684d02a392804eb1/src/ws/up.Back -> @seeds:List<&2, 0x2414c9622cab2353684d02a392804eb1/src/lock/world.Reply> -> Planned
Definitions
def ledger.path source · line 32 · raw
@+top:String -> @ds:List<&2, String> -> String
a directory's ez.toml, from the top of the checkout
def read.ups source · line 36 · raw
@+top:String -> @asks:List<&2, 0x2414c9622cab2353684d02a392804eb1/src/ws/root.Ask> -> IO(List<&2, 0x2414c9622cab2353684d02a392804eb1/src/ws/root.Up>)
the ez.toml of every directory the search asks about, nearest first
def search.at source · line 48 · raw
@here:Maybe<&2, List<&2, String>> -> @+top:String -> IO(Searched)
the search, once git said where ez runs. Outside a checkout there is no committed ledger above, so no workspace: the directory is its own project.
def here.git source · line 58 · raw
@ok:Bool -> @+text:String -> Maybe<&2, List<&2, String>>
where ez runs, from what git printed, or nothing when git could not say
def search source · line 66 · raw
IO(Searched)
the search for the root, from where ez runs up to the top of its checkout
def argv source · line 73 · raw
IO(List<&2, String>)
the program's own name, and every word after it
def hop.go source · line 79 · raw
@+dir:String -> @+pwd:String -> @xs:List<&2, String> -> IO(U32)
the same words run again at the root
def hop.end source · line 87 · raw
@zero:Bool -> @+code:U32 -> IO(Unit)
the hop's status, as this command's
def hop.run source · line 95 · raw
@+dir:String -> IO(Unit)
a run at the root, which ends as that run ended
def hop.at source · line 103 · raw
@hop:0x2414c9622cab2353684d02a392804eb1/src/ws/hop.Hop -> @go:(@_:Unit -> IO(Unit)) -> IO(Unit)
a command acted on as its hop says
def at.searched source · line 113 · raw
@st:Searched -> @go:(@_:Unit -> IO(Unit)) -> IO(Unit)
what the search found, acted on
def at.root source · line 120 · raw
@go:(@_:Unit -> IO(Unit)) -> IO(Unit)
a whole-workspace command, ez lock, ez fetch or ez doctor: run where
it is when that is its project's root, and again at the root when it is run
in a member
def read.found source · line 129 · raw
@ps:List<&2, String> -> IO(List<&2, 0x2414c9622cab2353684d02a392804eb1/src/ws/joint.Found>)
every listed ez.toml, read
def joint.at source · line 145 · raw
@jj:0x2414c9622cab2353684d02a392804eb1/src/ws/joint.Joint -> @+text:String -> @+spec:0x2414c9622cab2353684d02a392804eb1/src/ws/workspace.Spec -> @+fs:List<&2, 0x2414c9622cab2353684d02a392804eb1/src/ws/joint.Found> -> @+files:List<&2, 0x2414c9622cab2353684d02a392804eb1/src/pkg/pkg.Source> -> @+lock:String -> IO(Planned)
the joint ledger, as the lock reads it, or the refusal that leaves none
def joint.listed source · line 163 · raw
@ok:Bool -> @+text:String -> @+spec:0x2414c9622cab2353684d02a392804eb1/src/ws/workspace.Spec -> @+out:String -> @+files:List<&2, 0x2414c9622cab2353684d02a392804eb1/src/pkg/pkg.Source> -> IO(Planned)
a workspace root's ledger joined with every member's, once git listed them
def joint.go source · line 182 · raw
@+text:String -> @+spec:0x2414c9622cab2353684d02a392804eb1/src/ws/workspace.Spec -> @+files:List<&2, 0x2414c9622cab2353684d02a392804eb1/src/pkg/pkg.Source> -> IO(Planned)
a workspace root's ledger joined with every member's
def joint.read source · line 190 · raw
@rd:0x2414c9622cab2353684d02a392804eb1/src/ws/workspace.Read -> @+text:String -> @+files:List<&2, 0x2414c9622cab2353684d02a392804eb1/src/pkg/pkg.Source> -> IO(Planned)
what one ledger's text says: no workspace, read as it is; a workspace root, whose members are read and joined; or a table that cannot be read, which the joint ledger refuses
def ledger source · line 202 · raw
@led:Maybe<&2, String> -> @+files:List<&2, 0x2414c9622cab2353684d02a392804eb1/src/pkg/pkg.Source> -> IO(Planned)
the ledger ez lock is planned from: ez.toml as it is, or, at a workspace
root, the joint ledger of the root and every member. files are the
committed .bend files, which a member's package is walked over.
def env.text source · line 216 · raw
@rr:Result<&1, &1, Pair(U32, String), String> -> String
an environment variable's text; unset, ""
def env.lib source · line 224 · raw
IO(String)
BEND_LIB as the environment has it, "" for unset
def lib.go source · line 230 · raw
@+at:String -> @+pwd:String -> @xs:List<&2, String> -> IO(U32)
the same words run again where they are, with BEND_LIB set
def lib.at source · line 239 · raw
@lib:0x2414c9622cab2353684d02a392804eb1/src/ws/hop.Lib -> @go:(@_:Unit -> IO(Unit)) -> IO(Unit)
a command acted on as the library decision says: where it is, or again where it is with BEND_LIB set to the root's
def in.searched source · line 251 · raw
@st:Searched -> @+env:String -> @go:(@_:Unit -> IO(Unit)) -> IO(Unit)
what the search found, acted on for a member's own command
def in.member source · line 258 · raw
@go:(@_:Unit -> IO(Unit)) -> IO(Unit)
a command that acts on a member's own ledger and entry, ez add, ez
remove, ez check, ez build, ez run and ez publish: run where it is,
with the root's library when it is run in a member
def read.under source · line 265 · raw
@+dir:String -> @ps:List<&2, String> -> IO(List<&2, 0x2414c9622cab2353684d02a392804eb1/src/ws/joint.Found>)
every listed ez.toml under a directory, read
def pins.joint source · line 276 · raw
@jj:0x2414c9622cab2353684d02a392804eb1/src/ws/joint.Joint -> List<&2, 0x2414c9622cab2353684d02a392804eb1/src/ledger/manifest.Dep>
the joint ledger's dependencies, or none when it has none
def files.under source · line 285 · raw
@+dir:String -> @ps:List<&2, String> -> IO(List<&2, 0x2414c9622cab2353684d02a392804eb1/src/pkg/pkg.Source>)
every listed file under a directory, read, as the walk takes it
def pins.at source · line 296 · raw
@+dir:String -> IO(List<&2, 0x2414c9622cab2353684d02a392804eb1/src/ledger/manifest.Dep>)
every dependency of the workspace a directory is in, as its root reads them
def ref.held source · line 307 · raw
@rr:0x2414c9622cab2353684d02a392804eb1/src/ws/pin.Ref -> IO(String)
the ref, once the workspace's pins are known
def ref.found source · line 315 · raw
@+top:String -> @found:0x2414c9622cab2353684d02a392804eb1/src/ws/root.Found -> @+home:String -> @+target:String -> @+ref:String -> IO(String)
the ref an add goes on with, in what the search found
def add.searched source · line 325 · raw
@st:Searched -> @+home:String -> @+target:String -> @+ref:String -> IO(String)
and once the search was made
def add.ref source · line 330 · raw
@+home:String -> @+target:String -> @+ref:String -> IO(String)
the ref ez add <target> [ref] goes on with: in a workspace, the pin the
workspace already records for the source (laws/WorkspaceOnePinPerSource.bend)
def sources.under source · line 340 · raw
@+dir:String -> @ps:List<&2, String> -> IO(List<&2, 0x2414c9622cab2353684d02a392804eb1/src/lock/world.Source>)
every listed file under a directory, read, as the lock takes it
def listing.listed source · line 351 · raw
@ok:Bool -> @+dir:String -> @+out:String -> IO(0x2414c9622cab2353684d02a392804eb1/src/lock/world.Listing)
the .bend files git lists under a directory, once it listed them
def listing.at source · line 363 · raw
@+dir:String -> IO(0x2414c9622cab2353684d02a392804eb1/src/lock/world.Listing)
every .bend file git tracks under a directory, with its text, each path
from it, as ez lock run there lists them
def rooted source · line 370 · raw
@+at:String -> @rel:List<&2, String> -> IO(0x2414c9622cab2353684d02a392804eb1/src/ws/relock.Rooted)
what a command run at rel from the root at at reads of the root: its
ledger, every ez.toml and .bend file git lists under it, and its lock
def ws.found source · line 381 · raw
@+top:String -> @found:0x2414c9622cab2353684d02a392804eb1/src/ws/root.Found -> IO(0x2414c9622cab2353684d02a392804eb1/src/ws/relock.Ws)
where ez add or ez remove runs, in what the search found
def ws.searched source · line 391 · raw
@st:Searched -> IO(0x2414c9622cab2353684d02a392804eb1/src/ws/relock.Ws)
and once the search was made
def relock.ws source · line 398 · raw
IO(0x2414c9622cab2353684d02a392804eb1/src/ws/relock.Ws)
where ez add or ez remove runs: in a project of its own, or in a
workspace, with what it reads of the root
(laws/WorkspaceAddRemoveRelock.bend)
def lock.searched source · line 404 · raw
@st:Searched -> String
the lock, once the search was made
def lock.path source · line 409 · raw
IO(String)
the lock a member's own command reads: the root's, in a workspace
def doctor.root source · line 418 · raw
@+text:String -> IO(0x2414c9622cab2353684d02a392804eb1/src/ws/doctor.Doctored)
a workspace root's ledger and every member's, read for the doctor
def doctor.read source · line 427 · raw
@rd:0x2414c9622cab2353684d02a392804eb1/src/ws/workspace.Read -> @+text:String -> IO(0x2414c9622cab2353684d02a392804eb1/src/ws/doctor.Doctored)
what one ledger's text says, for the doctor
def doctor.ledger source · line 438 · raw
@led:Maybe<&2, String> -> IO(0x2414c9622cab2353684d02a392804eb1/src/ws/doctor.Doctored)
the ledger ez doctor judges: ez.toml as it is, or, at a workspace root,
the joint ledger of the root and every member