dbt-labs/dbt-core · error · anyhow
unsupported --target
Error message
unsupported --target {triple:?} What it means
When fetching published wheels, each `--target` triple is mapped to a Python platform tag via target_to_platform_tag; if the triple has no mapping this error is raised. The library cannot construct a wheel filename/URL for an unknown platform.
Solutions
- Use a supported --target triple (check the target_to_platform_tag mapping in sdist.rs).
- Remove the unsupported target from the targets list for this run.
- If the platform must be supported, add the triple-to-platform-tag mapping in target_to_platform_tag.
Example fix
// before run_publish(&["x86_64-unknown-freebsd"])?; // after run_publish(&["x86_64-unknown-linux-gnu"])?;
Defensive patterns
Strategy: validation
Validate before calling
SUPPORTED = {"x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-pc-windows-msvc"} # extend from target_to_platform_tag
assert all(t in SUPPORTED for t in targets), [t for t in targets if t not in SUPPORTED] Type guard
fn is_supported_target(t: &str) -> bool {
matches!(t, "x86_64-unknown-linux-gnu" | "aarch64-apple-darwin" | "x86_64-pc-windows-msvc")
} Try / catch
match build_release_sdist(&spec, &targets) {
Err(e) if e.to_string().starts_with("unsupported --target") => eprintln!("drop or map this target; see target_to_platform_tag"),
other => other?,
} Prevention
- Keep the --target list in sync with the platform-tag mapping
- Check new CI runner architectures against the mapping before enabling them
- Fail fast in CI by validating target triples before publishing
When it happens
Trigger: Calling build_release_sdist (via build_only_sdist or run_publish) with a targets list containing a triple like `aarch64-unknown-linux-gnu` or a Windows/macOS triple not in the mapping table.
Common situations: Adding new CI runner architectures (linux-arm64, musl/alpine) without updating the platform mapping; typos in the triple passed on the CLI; copying targets from another project with different platform support.
Understand the failure class
Background: "Unknown argument", "Invalid value", and "must be one of": invalid CLI argument errors explained — this error's family across 35 libraries.
Related errors
- --commit-author and --commit-email must be set together
- --download-base-url requires at least one --target
- formula file not found
- formula filename does not end in .rb
- formula path has no filename
AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07).
Data as JSON: /api/errors/c68c6a7554af2bd5.
Report an issue: GitHub.
Appendix: source
Thrown at crates/dbt-ci/src/sdist.rs:114
targets: &[String],
python_tag: &str,
abi_tag: &str,
out_dir: &Path,
) -> Result<PathBuf> {
if targets.is_empty() {
bail!("--download-base-url requires at least one --target");
}
// Reject a non-https base url before any fetch, so we never pull wheels over
// an insecure transport (the assembly-time check in `build_sdist` is too late).
require_https(base_url)?;
let version_pep440 = semver_to_pep440(version)?;
let dist = normalize_wheel_name(&spec.wheel_name);
let base = base_url.trim_end_matches('/');
let mut wheels = Vec::with_capacity(targets.len());
for triple in targets {
let platform_tag = target_to_platform_tag(triple)
.ok_or_else(|| anyhow!("unsupported --target {triple:?}"))?;
let filename = wheel_filename(&dist, &version_pep440, python_tag, abi_tag, &platform_tag);
let url = format!("{base}/{filename}");
eprintln!("→ GET {url}");
let bytes = download(http, &url).await?;
let digest = sha256_hex(bytes.as_ref());
eprintln!("✓ {filename} ({} bytes, sha256={digest})", bytes.len());
check_wheel_metadata_agrees(spec, &filename, bytes.as_ref())?;
wheels.push(WheelAsset {
platform_tag,
filename,
sha256_hex: digest,
});
}
build_sdist(spec, &version_pep440, &wheels, base_url, out_dir)
}
/// Fails the release when the sdist's static metadata disagrees with a wheel itView on GitHub (pinned to 0267ce9170)