~/bend-docscommunity

src/ws/run.bend relies on unsafe/foreign

raw source on the hub · import ezx@1.14.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 0x8e26a6f8c31689519e618374376ee3dd/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

type Planned source · line 150 · 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

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, 0xe21073738926f8a159714d5cdaf60edb/src/ws/root.Ask> -> IO(List<&2, 0xe21073738926f8a159714d5cdaf60edb/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 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:0xe21073738926f8a159714d5cdaf60edb/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, 0xe21073738926f8a159714d5cdaf60edb/src/ws/joint.Found>)

every listed ez.toml, read

def lines source · line 140 · raw

@ss:List<&2, String> -> List<&2, String>

the non-empty lines

def joint.at source · line 154 · raw

@jj:0xe21073738926f8a159714d5cdaf60edb/src/ws/joint.Joint -> @+text:String -> @+spec:0xe21073738926f8a159714d5cdaf60edb/src/ws/workspace.Spec -> @+fs:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ws/joint.Found> -> @+files:List<&2, 0xe21073738926f8a159714d5cdaf60edb/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 172 · raw

@ok:Bool -> @+text:String -> @+spec:0xe21073738926f8a159714d5cdaf60edb/src/ws/workspace.Spec -> @+out:String -> @+files:List<&2, 0xe21073738926f8a159714d5cdaf60edb/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 191 · raw

@+text:String -> @+spec:0xe21073738926f8a159714d5cdaf60edb/src/ws/workspace.Spec -> @+files:List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source> -> IO(Planned)

a workspace root's ledger joined with every member's

def joint.read source · line 199 · raw

@rd:0xe21073738926f8a159714d5cdaf60edb/src/ws/workspace.Read -> @+text:String -> @+files:List<&2, 0xe21073738926f8a159714d5cdaf60edb/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 211 · raw

@led:Maybe<&2, String> -> @+files:List<&2, 0xe21073738926f8a159714d5cdaf60edb/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 222 · raw

@rr:Result<&1, &1, Pair(U32, String), String> -> String

an environment variable's text; unset, ""

def env.lib source · line 230 · raw

IO(String)

BEND_LIB as the environment has it, "" for unset

def lib.go source · line 236 · 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 245 · raw

@lib:0xe21073738926f8a159714d5cdaf60edb/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 257 · 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 264 · 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 271 · raw

@+dir:String -> @ps:List<&2, String> -> IO(List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ws/joint.Found>)

every listed ez.toml under a directory, read

def pins.joint source · line 282 · raw

@jj:0xe21073738926f8a159714d5cdaf60edb/src/ws/joint.Joint -> List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Dep>

the joint ledger's dependencies, or none when it has none

def files.under source · line 291 · raw

@+dir:String -> @ps:List<&2, String> -> IO(List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/pkg/pkg.Source>)

every listed file under a directory, read, as the walk takes it

def pins.at source · line 302 · raw

@+dir:String -> IO(List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/ledger/manifest.Dep>)

every dependency of the workspace a directory is in, as its root reads them

def ref.held source · line 313 · raw

@rr:0xe21073738926f8a159714d5cdaf60edb/src/ws/pin.Ref -> IO(String)

the ref, once the workspace's pins are known

def ref.found source · line 321 · raw

@+top:String -> @found:0xe21073738926f8a159714d5cdaf60edb/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 331 · raw

@st:Searched -> @+home:String -> @+target:String -> @+ref:String -> IO(String)

and once the search was made

def add.ref source · line 336 · 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 346 · raw

@+dir:String -> @ps:List<&2, String> -> IO(List<&2, 0xe21073738926f8a159714d5cdaf60edb/src/lock/world.Source>)

every listed file under a directory, read, as the lock takes it

def listing.listed source · line 357 · raw

@ok:Bool -> @+dir:String -> @+out:String -> IO(0xe21073738926f8a159714d5cdaf60edb/src/lock/world.Listing)

the .bend files git lists under a directory, once it listed them

def listing.at source · line 369 · raw

@+dir:String -> IO(0xe21073738926f8a159714d5cdaf60edb/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 376 · raw

@+at:String -> @rel:List<&2, String> -> IO(0xe21073738926f8a159714d5cdaf60edb/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 387 · raw

@+top:String -> @found:0xe21073738926f8a159714d5cdaf60edb/src/ws/root.Found -> IO(0xe21073738926f8a159714d5cdaf60edb/src/ws/relock.Ws)

where ez add or ez remove runs, in what the search found

def ws.searched source · line 397 · raw

@st:Searched -> IO(0xe21073738926f8a159714d5cdaf60edb/src/ws/relock.Ws)

and once the search was made

def relock.ws source · line 404 · raw

IO(0xe21073738926f8a159714d5cdaf60edb/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 410 · raw

@st:Searched -> String

the lock, once the search was made

def lock.path source · line 415 · raw

IO(String)

the lock a member's own command reads: the root's, in a workspace

def doctor.root source · line 424 · raw

@+text:String -> IO(0xe21073738926f8a159714d5cdaf60edb/src/ws/doctor.Doctored)

a workspace root's ledger and every member's, read for the doctor

def doctor.read source · line 433 · raw

@rd:0xe21073738926f8a159714d5cdaf60edb/src/ws/workspace.Read -> @+text:String -> IO(0xe21073738926f8a159714d5cdaf60edb/src/ws/doctor.Doctored)

what one ledger's text says, for the doctor

def doctor.ledger source · line 444 · raw

@led:Maybe<&2, String> -> IO(0xe21073738926f8a159714d5cdaf60edb/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