E1132: capability is not available for the target

View source

Each capability name describes a primitive that only some targets provide.

Each capability name describes a primitive that only some targets provide. The name windows.replace_file needs Windows, and posix.cloexec needs a POSIX target (ADR-0096). A verb that declares a capability that the build target does not have cannot be compiled for it. The error points at the declaration and names the capability and the target.

Example

actus
meta capability("windows.replace_file")
verb primitive() -> Int {
    return 0;
}

verb main() {
}
toml
[package]
name = "example"
version = "0.1.0"
edition = "alpha"
entry = "main"

[build]
target = "x86_64-unknown-linux-gnu"
profile = "debug"
runtime = "std"

Fix

Declare a capability that the target provides, or build for a target that has it. Both examples select the Linux target x86_64-unknown-linux-gnu, so their result does not depend on the machine that checks them.

actus
meta capability("posix.cloexec")
verb primitive() -> Int {
    return 0;
}

verb main() {
}
toml
[package]
name = "example"
version = "0.1.0"
edition = "alpha"
entry = "main"

[build]
target = "x86_64-unknown-linux-gnu"
profile = "debug"
runtime = "std"

Run actus explain E1132 in your terminal to read this entry offline. Browse Modules & rules or all error codes.