pub struct Target {
pub triple: &'static str,
pub os: &'static str,
pub cpu: &'static str,
pub libc: Option<&'static str>,
pub wheel_platform: &'static str,
pub exe_suffix: &'static str,
}Expand description
One cross-compilation target and how each ecosystem names it.
Fields§
§triple: &'static strRust target triple, as cargo build --target takes it.
os: &'static strnpm os field.
cpu: &'static strnpm cpu field.
libc: Option<&'static str>npm libc field; only Linux distinguishes.
wheel_platform: &'static strPython wheel platform tag.
A manylinux_* tag is a claim about the build environment, not
about this table: it holds only when the binary was linked against
a glibc at least that old. sdk build warns when it cannot tell
that it was.
exe_suffix: &'static strExecutable suffix on this target.
Implementations§
Source§impl Target
impl Target
Sourcepub const DEFAULT: &'static [&'static str]
pub const DEFAULT: &'static [&'static str]
The matrix used when an [[sdk]] entry names no targets: the
platforms a published package is expected to cover. musl is not in
it — it needs its own toolchain and most consumers never ask.
Sourcepub fn matrix(configured: &[String]) -> Result<Vec<&'static Target>, String>
pub fn matrix(configured: &[String]) -> Result<Vec<&'static Target>, String>
The configured targets, or the default matrix when none are named. Sorted and deduplicated, so emission stays deterministic.
Sourcepub fn npm_suffix(&self) -> String
pub fn npm_suffix(&self) -> String
The npm sub-package suffix: linux-x64, darwin-arm64,
linux-x64-musl. Mirrors what esbuild and swc publish under.