def build.go

ezx@1.11.0.0 · src/ez/cmd.bend:88

import ezx@1.11.0.0/src/ez/cmd.bend as Cmd
import Base
import ezx@1.11.0.0/src/share/env.bend as Env
import ezx@1.11.0.0/src/share/exec.bend as Exec
import ezx@1.11.0.0/src/share/cap.bend as Cap
import ezx@1.11.0.0/src/ez/start.bend as S

88# a native binary, named after the package (`S.build.out`), once the
89# directory it lands in is there. This is the one command that reaches bend's
90# C backend, so it is the one that runs under the memory cap.
91def build.go(start: S.Start, +out: String) -> IO(Unit):
92  match start:
93    case S.Refused{why}:
94      refused(why)
95    case S.Starts{line}:
96      do IO<Unit>:
97        Exec.make(Env.dirs("build", out))
98        +cap : Bool <- Cap.ok()
99        Cap.warn(cap)
100        +g : String <- Cap.gb()
101        +bin : String <- Cap.run(cap, line)
102        report.capped(Cap.why(bin, g), bin)

Uses (15)

Used by (1)