silk/compilation
Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc.
Typed logical build choices fixed before source specialization.
When to use
Use artifact, safety, and threading to select source behavior from the build request.
Use silk.target for machine facts such as architecture and pointer width.
Details
These values describe logical requests. They do not discover SDKs, load runtime packages, or change ownership rules. All operations in this module run during static evaluation.
Import as Compilation with import silk.compilation { Compilation }.
Public declarations: 13.
Libc
pub enum LibcThe admitted choices for the C library request.
None
None = 0The none C library request.
System
System = 1The system C library request.
Gnu
Gnu = 2The gnu C library request.
Artifact
pub enum ArtifactThe admitted choices for the artifact request.
Executable
Executable = 0The executable artifact request.
LoadableModule
LoadableModule = 1The loadable-module artifact request.
StaticArchive
StaticArchive = 2The static-archive artifact request.
Object
Object = 3The object artifact request.
Link
pub enum LinkThe admitted choices for the link request.
Static
Static = 0The static link request.
Dynamic
Dynamic = 1The dynamic link request.
CodeModel
pub enum CodeModelThe admitted choices for the code model.
Small
Small = 0The small code model.
Large
Large = 1The large code model.
Relocation
pub enum RelocationThe admitted choices for the relocation model.
Static
Static = 0The static relocation model.
Pic
Pic = 1The pic relocation model.
Optimization
pub enum OptimizationThe admitted choices for the optimization request.
None
None = 0The none optimization request.
Speed
Speed = 1The speed optimization request.
Safety
pub enum SafetyThe admitted choices for the library safety policy.
Checked
Checked = 0The checked library safety policy.
Unchecked
Unchecked = 1The unchecked library safety policy.
Threading
pub enum ThreadingThe admitted choices for the library threading policy.
Single
Single = 0The single library threading policy.
Multi
Multi = 1The multi library threading policy.
Unwind
pub enum UnwindThe admitted choices for the unwind request.
None
None = 0The none unwind request.
Native
Native = 1The native unwind request.
Selection
pub union SelectionA logical default, absent, or named entry/runtime request.
Default
Selection.Default: SelectionThe platform's default request.
None
Selection.None: SelectionAn explicit request for no composition or entry.
Named
Selection.Named { name: string<'static> }: SelectionA logical symbol or package identity, without a physical path.
Field name
pub name: string<'static>The selected logical identity.
Sanitizer
pub enum SanitizerThe sanitizer requests supported by a compilation profile.
Address
Address = 0Address checks for instrumented memory operations.
Thread
Thread = 1Data-race checks for instrumented concurrent operations.
Undefined
Undefined = 2Checks for instrumented undefined behavior.
debug
pub const debug: boolWhether the build requests debug information.
Compilation
pub struct CompilationThe scope for Compilation operations.
Details
This owner carries no data. Select it with import silk.compilation { Compilation }
to access its inherent operations.
Associated function Compilation.libc
pub static fn libc() -> LibcReturns the selected C library request during static evaluation.
Associated function Compilation.artifact
pub static fn artifact() -> ArtifactReturns the selected artifact request during static evaluation.
Associated function Compilation.link
pub static fn link() -> LinkReturns the selected link request during static evaluation.
Associated function Compilation.codeModel
pub static fn codeModel() -> CodeModelReturns the selected code model during static evaluation.
Associated function Compilation.relocation
pub static fn relocation() -> RelocationReturns the selected relocation model during static evaluation.
Associated function Compilation.optimization
pub static fn optimization() -> OptimizationReturns the selected optimization request during static evaluation.
Associated function Compilation.safety
pub static fn safety() -> SafetyReturns the selected library safety policy during static evaluation.
Associated function Compilation.threading
pub static fn threading() -> ThreadingReturns the selected library threading policy during static evaluation.
Associated function Compilation.unwind
pub static fn unwind() -> UnwindReturns the selected unwind request during static evaluation.
Associated function Compilation.entry
pub static fn entry() -> SelectionReturns the logical entry request without resolving a startup symbol.
Associated function Compilation.runtime
pub static fn runtime() -> SelectionReturns the logical runtime request without loading a runtime package.
Associated function Compilation.hasSanitizer
pub static fn hasSanitizer(static value: Sanitizer) -> boolReturns whether the build requests the selected sanitizer.