silk.build.run.

Process steps with declared arguments, files, environment, and captured values.

Import as Run with import silk.build.run { Run }.

Public declarations: 2.

Run#

silk
pub union Run

A process step, described statically or constructed from runtime deferred values.

Static#

silk
Static

Dynamic#

silk
Dynamic

Implementation Run#

silk
impl Run

Associated function fromDescription#

silk
pub fn fromDescription(description: Invocation) -> Self

Wraps a standard invocation description for registration in a runtime graph.

Associated function command#

silk
pub static fn command(path: string<'static>) -> Self

Describes a package-relative executable without reading the filesystem or running it.

Associated function executable#

silk
pub static fn executable(path: Deferred<Path>) -> Self

Describes an executable supplied by another standard step or a path parameter.

Method arg#

silk
pub static fn arg(self: Self, value: string<'static>) -> Self

Appends a literal argument to a static invocation.

Method input#

silk
pub static fn input(self: Self, value: Deferred<Path>) -> Self

Appends a deferred input path to a static invocation's arguments.

Method output#

silk
pub static fn output(self: Self, name: string<'static>) -> Self

Appends a required output path to a static invocation's arguments.

Method reads#

silk
pub static fn reads(self: Self, value: Deferred<Path>) -> Self

Declares a static invocation's file dependency without adding an argument.

Method readsTree#

silk
pub static fn readsTree(self: Self, value: Deferred<Path>) -> Self

Declares a static invocation's directory dependency without adding an argument.

Method description#

silk
pub static fn description(self: &Self) -> Invocation

Returns this invocation's immutable description; runtime inputs cannot enter a static plan.

Method result#

silk
pub static fn result(self: &Self, name: string<'static>) -> Deferred<Path>

Names a declared output without registering or executing the producing process.

Method when#

silk
pub effect fn when<'env, E, ?R>(self: Self, condition: bool,
    transform: once effect fn<'env>(Self) -> Self ! E ? R) -> Self ! E ? R

Applies a graph transformation only when the condition is true.

Associated function program#

silk
pub effect fn program(name: string) -> Self ! StepFailure ? &mut Allocator | &mut FileSystem | &mut HostInput

Resolves an installed program now, including the executable's contents in the step key.

Associated function artifact#

silk
pub fn artifact(program: Deferred<Path>) -> Self

Runs a deferred executable, depending on its producer.

Method register#

silk
pub effect fn register(self: Self) -> StepHandle ! StepFailure ? &mut Allocator

Registers the invocation and returns a handle to its declared outputs.

Method registerHere#

silk
pub effect fn registerHere(self: Self) -> StepHandle ! StepFailure ? &mut Allocator

Registers the invocation as work this process runs itself, without describing it to the compiler.

Method confined#

silk
pub effect fn confined(self: Self) -> Self ! StepFailure ? &mut Allocator | &mut FileSystem | &mut HostInput

Confines the process to declared inputs, its output directory, and no network.

Method confinedBy#

silk
pub effect fn confinedBy(self: Self, launcher: Deferred<Path>) -> Self ! StepFailure ? &mut Allocator

Uses an explicitly selected sandbox launcher and includes its contents in the step key.

Method argument#

silk
pub effect fn argument(self: Self, value: Deferred<String>) -> Self ! StepFailure ? &mut Allocator

Appends a deferred text argument.

Method inputFile#

silk
pub effect fn inputFile(self: Self, path: Deferred<Path>) -> Self ! StepFailure ? &mut Allocator

Appends and keys a deferred file argument.

Method outputFile#

silk
pub effect fn outputFile(self: Self, name: string) -> Self ! StepFailure ? &mut Allocator

Appends and requires a file below the output directory.

Method keyFile#

silk
pub effect fn keyFile(self: Self, path: Deferred<Path>) -> Self ! StepFailure ? &mut Allocator

Keys an additional file without adding an argument.

Method keyTree#

silk
pub effect fn keyTree(self: Self, path: Deferred<Path>) -> Self ! StepFailure ? &mut Allocator

Keys an additional directory without adding an argument.

Method keyEnvironment#

silk
pub effect fn keyEnvironment(self: Self, name: string) -> Self ! StepFailure ? &mut Allocator

Keys and forwards one named environment variable.

Method always#

silk
pub effect fn always(self: Self) -> Self ! StepFailure ? &mut Allocator

Makes the process and its consumers run on every invocation.

Method captureText#

silk
pub effect fn captureText(self: Self) -> Deferred<String> ! StepFailure ? &mut Allocator

Captures UTF-8 standard output as a deferred value.

Method captureLines#

silk
pub effect fn captureLines(self: Self) -> Deferred<List<String>> ! StepFailure ? &mut Allocator

Captures UTF-8 standard output split into lines.

restore#

silk
pub effect fn restore(step: &[u8]) -> StepHandle ! StepFailure ? &mut Allocator

Restores a described process as a step this process can run.

Implementation Step for Run#

silk
impl Step for Run

Operation prepare#

silk
effect fn prepare(self: Self) -> Self ! StepFailure ? &mut Allocator

Operation key#

silk
effect fn key(self: &Self, key: &mut Key) -> () ! StepFailure ? &mut Allocator

Operation make#

silk
effect fn make(self: &Self, make: &mut Make) -> () ! StepFailure ? &mut Allocator

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.

View the source of this page