Silk

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 Libc

The admitted choices for the C library request.

None

None = 0

The none C library request.

System

System = 1

The system C library request.

Gnu

Gnu = 2

The gnu C library request.

Artifact

pub enum Artifact

The admitted choices for the artifact request.

Executable

Executable = 0

The executable artifact request.

LoadableModule

LoadableModule = 1

The loadable-module artifact request.

StaticArchive

StaticArchive = 2

The static-archive artifact request.

Object

Object = 3

The object artifact request.

pub enum Link

The admitted choices for the link request.

Static

Static = 0

The static link request.

Dynamic

Dynamic = 1

The dynamic link request.

CodeModel

pub enum CodeModel

The admitted choices for the code model.

Small

Small = 0

The small code model.

Large

Large = 1

The large code model.

Relocation

pub enum Relocation

The admitted choices for the relocation model.

Static

Static = 0

The static relocation model.

Pic

Pic = 1

The pic relocation model.

Optimization

pub enum Optimization

The admitted choices for the optimization request.

None

None = 0

The none optimization request.

Speed

Speed = 1

The speed optimization request.

Safety

pub enum Safety

The admitted choices for the library safety policy.

Checked

Checked = 0

The checked library safety policy.

Unchecked

Unchecked = 1

The unchecked library safety policy.

Threading

pub enum Threading

The admitted choices for the library threading policy.

Single

Single = 0

The single library threading policy.

Multi

Multi = 1

The multi library threading policy.

Unwind

pub enum Unwind

The admitted choices for the unwind request.

None

None = 0

The none unwind request.

Native

Native = 1

The native unwind request.

Selection

pub union Selection

A logical default, absent, or named entry/runtime request.

Default

Selection.Default: Selection

The platform's default request.

None

Selection.None: Selection

An explicit request for no composition or entry.

Named

Selection.Named { name: string<'static> }: Selection

A logical symbol or package identity, without a physical path.

Field name

pub name: string<'static>

The selected logical identity.

Sanitizer

pub enum Sanitizer

The sanitizer requests supported by a compilation profile.

Address

Address = 0

Address checks for instrumented memory operations.

Thread

Thread = 1

Data-race checks for instrumented concurrent operations.

Undefined

Undefined = 2

Checks for instrumented undefined behavior.

debug

pub const debug: bool

Whether the build requests debug information.

Compilation

pub struct Compilation

The 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() -> Libc

Returns the selected C library request during static evaluation.

Associated function Compilation.artifact

pub static fn artifact() -> Artifact

Returns the selected artifact request during static evaluation.

pub static fn link() -> Link

Returns the selected link request during static evaluation.

Associated function Compilation.codeModel

pub static fn codeModel() -> CodeModel

Returns the selected code model during static evaluation.

Associated function Compilation.relocation

pub static fn relocation() -> Relocation

Returns the selected relocation model during static evaluation.

Associated function Compilation.optimization

pub static fn optimization() -> Optimization

Returns the selected optimization request during static evaluation.

Associated function Compilation.safety

pub static fn safety() -> Safety

Returns the selected library safety policy during static evaluation.

Associated function Compilation.threading

pub static fn threading() -> Threading

Returns the selected library threading policy during static evaluation.

Associated function Compilation.unwind

pub static fn unwind() -> Unwind

Returns the selected unwind request during static evaluation.

Associated function Compilation.entry

pub static fn entry() -> Selection

Returns the logical entry request without resolving a startup symbol.

Associated function Compilation.runtime

pub static fn runtime() -> Selection

Returns the logical runtime request without loading a runtime package.

Associated function Compilation.hasSanitizer

pub static fn hasSanitizer(static value: Sanitizer) -> bool

Returns whether the build requests the selected sanitizer.

On this page