silk.build.delegate.
A build graph as a task program hands it to the compiler, and the compiler's answer.
A task program describes its standard steps instead of running them. The compiler restores the description, runs the steps and answers where each left its outputs.
Import as Delegate with import silk.build.delegate as Delegate.
Public declarations: 9.
RootDescription#
pub struct RootDescriptionOne requested root of a described graph.
Field node#
pub node: u64The step's identity within the description.
Field name#
pub name: StringThe output that becomes the root's artifact.
Field compilation#
pub compilation: boolWhether the root is a compilation, which publishes its request.
Implementation Schema for RootDescription#
impl Schema for RootDescriptionOperation spec#
static fn spec() -> Spec<RootDescription>GraphDescription#
pub struct GraphDescriptionA build graph as the task program hands it to the compiler.
Field version#
pub version: u64The description format.
Field root#
pub root: StringThe package directory.
Field program#
pub program: Option<String>The executable that constructed the graph, whose contents enter every step key.
Field identity#
pub identity: Option<String>An explicit hexadecimal identity in place of the program's contents.
Field cache#
pub cache: Option<String>The step cache directory, when the caller chose one.
Field compile#
pub compile: boolWhether requested compilations run, or only publish their requests.
Field publish#
pub publish: boolWhether the roots publish their requests and artifacts, or only run.
Field memory#
pub memory: u64The bound on the sum of running steps' memory estimates, in bytes.
Field workers#
pub workers: u64The maximum number of workers.
Field steps#
pub steps: List<StepDescription>Every step of the graph, each after the steps it reads.
Field roots#
pub roots: List<RootDescription>The requested roots, in the order they were added.
Implementation Schema for GraphDescription#
impl Schema for GraphDescriptionOperation spec#
static fn spec() -> Spec<GraphDescription>ArtifactDescription#
pub struct ArtifactDescriptionOne completed artifact of a described graph.
Field name#
pub name: StringThe artifact's name.
Field path#
pub path: StringThe artifact's path.
Field request#
pub request: Option<String>The published request file of a compilation.
Implementation Schema for ArtifactDescription#
impl Schema for ArtifactDescriptionOperation spec#
static fn spec() -> Spec<ArtifactDescription>OutputDescription#
pub struct OutputDescriptionWhere one described step left its outputs.
Field node#
pub node: u64The step's identity within the description.
Field directory#
pub directory: StringThe step's cache directory.
Field volatile#
pub volatile: boolWhether the step runs every time.
Field compilation#
pub compilation: boolWhether the step is a compilation.
Field compiled#
pub compiled: boolWhether a compilation built its artifact, or only wrote its request.
Implementation Schema for OutputDescription#
impl Schema for OutputDescriptionOperation spec#
static fn spec() -> Spec<OutputDescription>CompiledDescription#
pub struct CompiledDescriptionOne compilation the compiler reached while running a described graph.
Field directory#
pub directory: StringThe compilation's cache directory.
Field compiled#
pub compiled: boolWhether it built its artifact, or only wrote its request.
Implementation Schema for CompiledDescription#
impl Schema for CompiledDescriptionOperation spec#
static fn spec() -> Spec<CompiledDescription>Outcome#
pub struct OutcomeWhat the compiler answers after running a described graph.
Field error#
pub error: Option<String>The failure to report, when the graph did not complete.
Field artifacts#
pub artifacts: List<ArtifactDescription>The completed artifacts of a published graph, in the order their roots were added.
Field outputs#
pub outputs: List<OutputDescription>The steps of a graph that was only run.
Field compilations#
pub compilations: List<CompiledDescription>The compilations reached by a graph that was only run.
Implementation Schema for Outcome#
impl Schema for OutcomeOperation spec#
static fn spec() -> Spec<Outcome>hexadecimal#
pub effect fn hexadecimal(bytes: &[u8]) -> String
! OutOfMemoryError
? &mut AllocatorWrites bytes as lowercase hexadecimal text.
binary#
pub effect fn binary(text: string) -> Bytes
! OutOfMemoryError
? &mut AllocatorReads the bytes that hexadecimal wrote.
submit#
pub effect fn submit(description: &GraphDescription, directory: &Path) -> Outcome
! StepFailure
? &mut Allocator | &mut FileSystem | &mut HostInputHands a described graph to the compiler and reads its answer. The description and the answer
are files in directory, named by the description's contents, and removed afterwards.
Errors#
StepError with the compiler's report when the graph fails, or when the compiler cannot run.
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.