dbt-labs/dbt-core · error · anyhow

two binaries map to platform tag {:?}; the sdist manifest ca

Error message

two binaries map to platform tag {:?}; the sdist manifest can only reference one wheel per platform

What it means

render_assets_json builds a map from platform tag to a single wheel asset for the sdist manifest. Because the manifest can reference only one wheel per platform tag, a second wheel with the same platform tag causes this bail — an internal consistency check on the release inputs.

Source

Thrown at crates/dbt-ci/src/sdist.rs:330

    let major = release.split('.').next()?.parse().ok()?;
    Some((major, release_end != version_pep440.len()))
}

fn render_assets_json(
    spec: &Spec,
    version_pep440: &str,
    base_url: &str,
    wheels: &[WheelAsset],
    notice: Option<&str>,
) -> Result<String> {
    let mut map: BTreeMap<&str, AssetEntry> = BTreeMap::new();
    for w in wheels {
        let entry = AssetEntry {
            filename: &w.filename,
            sha256: &w.sha256_hex,
        };
        if map.insert(w.platform_tag.as_str(), entry).is_some() {
            bail!(
                "two binaries map to platform tag {:?}; the sdist manifest can only \
                 reference one wheel per platform",
                w.platform_tag
            );
        }
    }
    let manifest = AssetsManifest {
        name: &spec.wheel_name,
        version: version_pep440,
        base_url,
        notice,
        wheels: map,
    };
    let mut json = serde_json::to_string_pretty(&manifest).context("serialize assets.json")?;
    json.push('\n');
    Ok(json)
}

View on GitHub (pinned to 0267ce9170)

Solutions

  1. Deduplicate the --target list so each platform tag appears at most once.
  2. If two binaries genuinely target the same platform, keep only the intended one in the release inputs.
  3. Check wheel naming/tag computation so distinct binaries produce distinct platform tags (e.g. manylinux vs musllinux).

Example fix

# before
--target x86_64-unknown-linux-gnu --target x86_64-unknown-linux-gnu
# after
--target x86_64-unknown-linux-gnu --target aarch64-unknown-linux-gnu
Defensive patterns

Strategy: validation

Validate before calling

# ensure every target maps to a unique platform tag
function assert_unique_targets() { printf '%s\n' "$@" | sort | uniq -d | grep . && { echo "duplicate targets" >&2; exit 1; } || true; }
assert_unique_targets "$TARGETS"

Try / catch

if let Err(e) = build_sdist(...) {
    if e.to_string().contains("platform tag") {
        eprintln!("duplicate platform in release inputs: {e:#}");
    }
    return Err(e);
}

Prevention

When it happens

Trigger: build_sdist -> render_assets_json receives a wheels list where two binaries/wheels share the same platform_tag, e.g. passing both a glibc and a musl build that normalize to the same tag, or duplicate target entries in --target.

Common situations: Duplicate --target flags, two python ABI variants mapping to the same platform tag, a copy-pasted target in CI matrix config, or a tag-normalization bug in normalize_wheel_name/spec.wheel_name.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07). Data as JSON: /api/errors/417ba4e27839da78. Report an issue: GitHub.