dbt-labs/dbt-core · error · anyhow
unsupported target triple {:?}
Error message
unsupported target triple {:?} What it means
`pack_wheel` in crates/dbt-ci/src/pack.rs maps a Rust target triple to a PEP 425 wheel platform tag via `target_to_platform_tag`. If the triple is not in the mapping table, packing cannot proceed (the wheel filename would be wrong) and it bails with this error. Called by `run` for each binary being packaged into a `py3-none-<platform>` wheel.
Source
Thrown at crates/dbt-ci/src/pack.rs:127
dist_normalized: &str,
version_pep440: &str,
python_tag: &str,
abi_tag: &str,
platform_tag: &str,
) -> String {
format!("{dist_normalized}-{version_pep440}-{python_tag}-{abi_tag}-{platform_tag}.whl")
}
/// Packs one binary into a wheel under `out_dir`, returning the wheel path.
fn pack_wheel(
spec: &Spec,
version_pep440: &str,
bin_name: &str,
bin: &Binary,
out_dir: &Path,
) -> Result<PathBuf> {
let platform_tag = target_to_platform_tag(&bin.target_triple)
.ok_or_else(|| anyhow!("unsupported target triple {:?}", bin.target_triple))?;
let dist = normalize_wheel_name(&spec.wheel_name);
// The CLI wheel wraps a prebuilt binary — interpreter-agnostic, so `py3-none`.
let wheel_filename = wheel_filename(&dist, version_pep440, "py3", "none", &platform_tag);
let wheel_path = out_dir.join(&wheel_filename);
let dist_info = format!("{dist}-{version_pep440}.dist-info");
let data_scripts = format!("{dist}-{version_pep440}.data/scripts");
let bin_bytes = fs::read(&bin.path).with_context(|| format!("read {}", bin.path.display()))?;
let script_name = if bin.is_windows {
format!("{bin_name}.exe")
} else {
bin_name.to_string()
};
let mut entries: Vec<(String, Vec<u8>, u32)> = Vec::new();
entries.push((format!("{data_scripts}/{script_name}"), bin_bytes, 0o755));
entries.push((
format!("{dist_info}/METADATA"),View on GitHub (pinned to 0267ce9170)
Solutions
- Add the missing triple to the `target_to_platform_tag` mapping with its correct PEP 425 platform tag (e.g. `aarch64-apple-darwin` -> `macosx_11_0_arm64`).
- Use one of the already-supported triples in the build config.
- Fix typos in the target triple passed via the build/pack configuration.
Example fix
// before
fn target_to_platform_tag(triple: &str) -> Option<&'static str> {
match triple {
"x86_64-apple-darwin" => Some("macosx_10_12_x86_64"),
_ => None,
}
}
// after
fn target_to_platform_tag(triple: &str) -> Option<&'static str> {
match triple {
"x86_64-apple-darwin" => Some("macosx_10_12_x86_64"),
"aarch64-apple-darwin" => Some("macosx_11_0_arm64"),
_ => None,
}
} Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED: &[&str] = &[
"x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu",
"x86_64-apple-darwin", "aarch64-apple-darwin",
"x86_64-pc-windows-msvc",
];
if !SUPPORTED.contains(&bin.target_triple.as_str()) {
return Err(format!("unsupported target triple {}", bin.target_triple));
} Try / catch
match pack_wheel(&args) {
Err(e) if e.to_string().contains("unsupported target triple") => {
eprintln!("add the triple to target_to_platform_tag or fix --target")
}
Err(e) => return Err(e),
Ok(p) => p,
} Prevention
- Keep the release CI target matrix in sync with target_to_platform_tag entries.
- When adding a new arch/OS, extend the mapping and test pack locally first.
- Centralize the supported-triples list so build configs import it instead of duplicating strings.
When it happens
Trigger: Building/packing a wheel for a target triple not covered by `target_to_platform_tag`, e.g. `aarch64-apple-darwin` if only x86_64 macOS/Linux/Windows triples were mapped, a typo like `x86_64-pc-windows-msvc1`, or a custom/less-common triple such as `x86_64-unknown-freebsd`.
Common situations: Adding a new release target to CI without extending the triple-to-platform-tag table; retargeting the build (e.g. ARM64 Windows/Mac) for the first time; typos in the `--target` flag value.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
- no prebuilt {name} {ver} wheel for this platform; available
- {filename} has no *.dist-info/METADATA
- {filename} declares Requires-Python {actual:?} but the sdist
- {filename}'s Requires-Dist disagrees with the sdist: sdist d
- this backend does not build sdists; use `dbt-ci pypi pack --
AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07).
Data as JSON: /api/errors/7e281ef8087b3196.
Report an issue: GitHub.