silk.build.request.
Complete compilation inputs for the compiler and development tools.
When to use#
Use Request to describe one compilation independently of a package manifest or task program.
Read and write it with silk.schema.toml.SchemaToml or silk.schema.json.SchemaJson.
Generate its JSON Schema with silk.schema.json_schema.JsonSchemas.
Details#
All filesystem paths are absolute. Packages and their import edges are explicit.
Compilation requests contain resolved values and never execute a task or fetch a dependency.
Every record rejects unknown fields. The version field identifies this wire format.
Import as Request with import silk.build.request { Request }.
Public declarations: 25.
Request#
pub struct RequestOne complete compilation, with no manifest discovery.
Field version#
pub version: u32The request format version; currently 1.
Field name#
pub name: StringThe artifact name, without a directory.
Field artifact#
pub artifact: StringThe artifact kind: executable, loadable-module, static-archive, object, or test.
Field root#
pub root: StringThe absolute path of the root Silk module.
Field rootModule#
pub rootModule: StringThe root module identity within the root package, independent of its physical file.
Field output#
pub output: StringThe absolute path at which the compiler writes the artifact.
Field stdlib#
pub stdlib: StringThe absolute path of the standard library.
Field profile#
pub profile: ProfileThe program-wide compilation settings.
Field packages#
pub packages: List<Package>Every package used by this compilation, with the root package first.
Field composition#
pub composition: CompositionThe selected runtime, support modules, and execution-storage bindings.
Field native#
pub native: NativeThe ordered native inputs of the whole compilation.
Field emit#
pub emit: StringThe emitted form: final, llvm-ir, llvm-bitcode, assembly, object, or wasm-text.
Field platform#
pub platform: Option<Platform>An explicit sysroot and linker supply, when the target needs one.
Field windows#
pub windows: Option<Windows>Windows-specific link options.
Field macos#
pub macos: Option<MacOS>macOS-specific link and signing options.
Field wasm#
pub wasm: Option<Wasm>WebAssembly memory and execution options.
Field header#
pub header: Option<String>The absolute path of an emitted C header, when requested.
Field importLibrary#
pub importLibrary: Option<String>The absolute path of an emitted import library, when requested.
Field runner#
pub runner: Option<Runner>The program used to run a foreign artifact or its tests.
Implementation Schema for Request#
impl Schema for RequestOperation spec#
static fn spec() -> Spec<Request>Operation check#
fn check(self: &Self, checks: &mut Checks<Self>) -> ()Requires unique package identities and import aliases, with every dependency resolved in the request.
Profile#
pub struct ProfileProgram-wide source facts and default backend settings.
Field target#
pub target: StringThe canonical target triple.
Field cpu#
pub cpu: Option<String>The CPU model.
Field cpuFeatures#
pub cpuFeatures: List<String>The enabled CPU features.
Field deployment#
pub deployment: Option<String>The minimum operating-system version.
Field libc#
pub libc: StringThe selected C library.
Field entry#
pub entry: StringThe entry selection: default, none, or a declared name.
Field runtime#
pub runtime: StringThe runtime selection: default, none, or a declared name.
Field link#
pub link: StringThe link mode.
Field codeModel#
pub codeModel: StringThe target code model.
Field relocation#
pub relocation: StringThe relocation model.
Field optimization#
pub optimization: StringThe program-wide optimization: none, speed, or size.
Field debug#
pub debug: boolWhether the program emits debug information by default.
Field safety#
pub safety: StringThe program-wide safety policy.
Field threading#
pub threading: StringThe program-wide threading policy.
Field sanitizers#
pub sanitizers: List<String>The enabled sanitizers.
Field unwind#
pub unwind: StringThe unwind policy.
Field backend#
pub backend: StringThe code generator: llvm or direct.
Field codegenUnits#
pub codegenUnits: Option<u64>The number of code generation units for an optimized build.
Field maxMemory#
pub maxMemory: Option<u64>The maximum WebAssembly memory, in bytes.
Field stackSize#
pub stackSize: Option<u64>The main stack size, in bytes.
Implementation Schema for Profile#
impl Schema for ProfileOperation spec#
static fn spec() -> Spec<Profile>profileSpec#
pub static fn profileSpec<T>() -> Spec<T>Describes the shared profile field names and domains for resolved and optional settings.
Package#
pub struct PackageA resolved source package and the settings its consumer supplied.
Field name#
pub name: StringThe package name.
Field version#
pub version: StringThe package version.
Field directory#
pub directory: StringThe absolute package directory used for relative embedded files.
Field source#
pub source: StringThe absolute root directory of its Silk modules.
Field dependencies#
pub dependencies: List<Dependency>The import aliases and exact package identities they select.
Field exports#
pub exports: List<String>The canonical module paths other packages may import.
Field parameters#
pub parameters: List<Parameter>The declared parameters and their resolved values.
Field modules#
pub modules: List<Module>Generated modules, with their absolute source paths.
Field optimization#
pub optimization: Option<String>The backend optimization override; source-visible optimization stays program-wide.
Field debug#
pub debug: Option<bool>The backend debug-information override.
Implementation Schema for Package#
impl Schema for PackageOperation spec#
static fn spec() -> Spec<Package>Dependency#
pub struct DependencyAn import alias bound to an exact package identity.
Field name#
pub name: StringThe import alias.
Field package#
pub package: StringThe selected package identity, as name@version.
Implementation Schema for Dependency#
impl Schema for DependencyOperation spec#
static fn spec() -> Spec<Dependency>Parameter#
pub struct ParameterA declared package parameter, including its documentation and bound value.
Field name#
pub name: StringThe public parameter name.
Field module#
pub module: StringThe module that declares the parameter, relative to its package.
Field typeName#
pub typeName: StringThe admitted Silk type of the parameter.
Field description#
pub description: StringThe declaration documentation.
Field required#
pub required: boolWhether the declaration has no default.
Field default#
pub default: Option<ParameterValue>The declared default, when present.
Field value#
pub value: ParameterValueThe value bound for this compilation.
Field suppliedPath#
pub suppliedPath: boolWhether the root supplied this value as a path capability.
Implementation Schema for Parameter#
impl Schema for ParameterOperation spec#
static fn spec() -> Spec<Parameter>ParameterValue#
pub union ParameterValueA resolved parameter value. Lists and records preserve their declared element and field types.
Text#
TextA text parameter.
Field value#
pub value: StringBoolean#
BooleanA boolean parameter.
Field value#
pub value: boolInteger#
IntegerAn exact decimal integer; its declared type supplies width and signedness.
Field decimal#
pub decimal: StringEnum#
EnumA member of a named enum.
Field nominal#
pub nominal: StringField member#
pub member: StringNone#
NoneAn absent optional value.
Some#
SomeA present optional value.
Field value#
pub value: Box<ParameterValue>Sequence#
SequenceAn ordered sequence of parameter values.
Field values#
pub values: List<ParameterValue>Record#
RecordA record's named parameter values.
Field fields#
pub fields: List<ParameterField>Implementation Schema for ParameterValue#
impl Schema for ParameterValueOperation spec#
static fn spec() -> Spec<ParameterValue>ParameterField#
pub struct ParameterFieldOne named field of a structured parameter.
Field name#
pub name: StringThe declared field name.
Field value#
pub value: ParameterValueThe field value.
Implementation Schema for ParameterField#
impl Schema for ParameterFieldOperation spec#
static fn spec() -> Spec<ParameterField>Module#
pub struct ModuleA generated module whose source is stored at an explicit path.
Field name#
pub name: StringThe canonical module path inside its package.
Field source#
pub source: StringThe absolute path of its generated source.
Field producer#
pub producer: Option<String>The step key that produces the file, for editor diagnostics.
Implementation Schema for Module#
impl Schema for ModuleOperation spec#
static fn spec() -> Spec<Module>Operation check#
fn check(self: &Self, checks: &mut Checks<Self>) -> ()Selector#
pub struct SelectorA declaration rooted by the runtime composition.
Field package#
pub package: StringThe defining package identity, or silk for the standard library.
Field module#
pub module: StringThe canonical module path.
Field declaration#
pub declaration: StringThe declaration name.
Implementation Schema for Selector#
impl Schema for SelectorOperation spec#
static fn spec() -> Spec<Selector>Composition#
pub struct CompositionThe resolved runtime composition and exported support modules.
Field runtime#
pub runtime: Option<ModuleRef>The selected startup module, absent for artifacts without a runtime.
Field support#
pub support: List<Support>The target support modules rooted by this compilation.
Field retention#
pub retention: List<Selector>Declarations retained regardless of import reachability.
Field storage#
pub storage: Option<Storage>The execution-storage operations selected by the runtime.
Implementation Schema for Composition#
impl Schema for CompositionOperation spec#
static fn spec() -> Spec<Composition>ModuleRef#
pub struct ModuleRefA module identified without a filesystem path.
Field package#
pub package: StringThe package identity.
Field module#
pub module: StringThe canonical module path.
Implementation Schema for ModuleRef#
impl Schema for ModuleRefOperation spec#
static fn spec() -> Spec<ModuleRef>Support#
pub struct SupportA target support module and its export policy.
Field module#
pub module: ModuleRefThe support module.
Field hosted#
pub hosted: boolWhether its C exports are also host exports.
Implementation Schema for Support#
impl Schema for SupportOperation spec#
static fn spec() -> Spec<Support>Storage#
pub struct StorageThe four runtime execution-storage bindings.
Field create#
pub create: SelectorThe declaration that implements create.
Field acquire#
pub acquire: SelectorThe declaration that implements acquire.
Field release#
pub release: SelectorThe declaration that implements release.
Field destroy#
pub destroy: SelectorThe declaration that implements destroy.
Implementation Schema for Storage#
impl Schema for StorageOperation spec#
static fn spec() -> Spec<Storage>Native#
pub struct NativeOrdered native compilation and link inputs.
Field sources#
pub sources: List<NativeSource>Native translation units and their compiler arguments.
Field link#
pub link: List<LinkInput>Inputs in linker order.
Field functionOrder#
pub functionOrder: Option<String>The absolute path of a function-order file.
Implementation Schema for Native#
impl Schema for NativeOperation spec#
static fn spec() -> Spec<Native>NativeSource#
pub struct NativeSourceOne native translation unit with explicit flags and include paths.
Field path#
pub path: StringThe absolute path of the source file.
Field language#
pub language: StringThe source language: c, cpp, objc, or objcpp.
Field flags#
pub flags: List<String>The compiler flags, in argument order.
Field include#
pub include: List<String>Absolute include directory paths.
Implementation Schema for NativeSource#
impl Schema for NativeSourceOperation spec#
static fn spec() -> Spec<NativeSource>LinkInput#
pub struct LinkInputOne ordered native linker input.
Field kind#
pub kind: StringThe input kind: object, archive, library, framework, search-path, framework-search-path, rpath, or linker-script.
Field value#
pub value: StringThe library or framework name, or an absolute path for a file or directory input.
Field mode#
pub mode: Option<String>The library search mode, static or dynamic.
Field weak#
pub weak: boolWhether the platform may leave this library or framework absent.
Field needed#
pub needed: boolWhether to retain the library even when no symbol references it.
Implementation Schema for LinkInput#
impl Schema for LinkInputOperation spec#
static fn spec() -> Spec<LinkInput>Operation check#
fn check(self: &Self, checks: &mut Checks<Self>) -> ()Platform#
pub struct PlatformAn explicit platform toolchain supply.
Field sysroot#
pub sysroot: StringThe absolute sysroot directory.
Field linker#
pub linker: StringThe absolute linker executable path.
Field support#
pub support: List<Installation>Compiler-support installations, each selected by its canonical target triple.
Implementation Schema for Platform#
impl Schema for PlatformOperation spec#
static fn spec() -> Spec<Platform>Installation#
pub struct InstallationAn installed compiler-support directory for one target.
Field target#
pub target: StringThe canonical target triple served by the installation.
Field root#
pub root: StringThe absolute installation directory.
Implementation Schema for Installation#
impl Schema for InstallationOperation spec#
static fn spec() -> Spec<Installation>Windows#
pub struct WindowsWindows executable and resource settings.
Field subsystem#
pub subsystem: Option<String>The subsystem, console or windows.
Field manifest#
pub manifest: Option<String>The absolute path of the Windows application manifest.
Field resources#
pub resources: List<String>The absolute paths of resource files.
Implementation Schema for Windows#
impl Schema for WindowsOperation spec#
static fn spec() -> Spec<Windows>MacOS#
pub struct MacOSmacOS signing and dynamic-library settings.
Field entitlements#
pub entitlements: Option<String>The absolute path of the signing entitlements.
Field installName#
pub installName: Option<String>The dynamic-library install name.
Implementation Schema for MacOS#
impl Schema for MacOSOperation spec#
static fn spec() -> Spec<MacOS>Wasm#
pub struct WasmWebAssembly memory, table, and execution settings.
Field importMemory#
pub importMemory: boolWhether memory is supplied by the host.
Field sharedMemory#
pub sharedMemory: boolWhether the linear memory is shared.
Field exportTable#
pub exportTable: boolWhether to export the function table.
Field executionModel#
pub executionModel: StringThe WASI execution model, command or reactor.
Field wit#
pub wit: Option<String>The absolute WIT directory for a component build.
Field world#
pub world: Option<String>The WIT world name for a component build.
Implementation Schema for Wasm#
impl Schema for WasmOperation spec#
static fn spec() -> Spec<Wasm>Runner#
pub struct RunnerA command used to launch a foreign artifact.
Field program#
pub program: StringThe runner executable name or absolute path.
Field arguments#
pub arguments: List<String>Arguments placed before the artifact path.
Implementation Schema for Runner#
impl Schema for RunnerOperation spec#
static fn spec() -> Spec<Runner>Implementation Request#
impl RequestMethod fileName#
pub effect fn fileName(self: &Self) -> String
! OutOfMemoryError
? &mut AllocatorReturns the stable publication filename for this artifact, target, and optimization mode.
Associated function requestFileName#
pub effect fn requestFileName(name: string, target: string, optimization: string) -> String
! OutOfMemoryError
? &mut AllocatorNames a published request using its compilation name, canonical target, and optimization.
artifactName#
pub effect fn artifactName(name: string, artifact: string, emit: string, target: string) -> String
! OutOfMemoryError
? &mut AllocatorReturns the artifact filename selected by the resolved request.
RequestSet#
pub struct RequestSetThe complete request set most recently published by Build.write or the built-in plan command.
Readers select only these files when this index exists; other commands may publish additional requests.
Field version#
pub version: u32The request-set format version, currently 1.
Field files#
pub files: List<String>Request filenames relative to the directory holding plan.json.
Implementation Schema for RequestSet#
impl Schema for RequestSetOperation spec#
static fn spec() -> Spec<RequestSet>Operation check#
fn check(self: &Self, checks: &mut Checks<Self>) -> ()Category: Core.
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.