In the runtime package, x.macos.auk, x.linux.auk, x.linux-arm64.auk and x.auk are
variants of the module x: each target compiles the most specific one (docs/lowlevel.md §11).
Whatever the rest of the package uses from x must be declared pub in the variant of every
target that uses it, with the same signature in all of them. Every file is parsed, so this is
checked on any machine, for every target. Items only one target's own files use may exist
only in that target's variant.
Wrong#
[package]
name = "auk_rt"
version = "0.1.0"
effects = ["raw"]fn main() { let _ = plat.page_size() }pub fn page_size(): i64 = 16384pub fn page_size(): i32 = 4096Fixed#
pub fn page_size(): i64 = 4096Common causes#
- A constant or function added to one platform's file only, then used from shared code.
- A type that differs by platform written into a signature: give it a
raw typealias per file (raw type ModeT = u16) and use the alias in the shared signature. - A typo in one variant's name.