denoland/deno · error · AnyError

Unsupported platform for PR builds: {}

Error message

Unsupported platform for PR builds: {}

What it means

When installing Deno from a PR or branch (`deno upgrade --pr` / branch flow), Deno maps the current Rust target triple to a CI artifact name. Only linux/macOS/windows on x86_64/aarch64 are recognized; anything else falls through to this bail. The artifact name is used to find the GitHub Actions build to download.

Source

Thrown at cli/tools/upgrade.rs:597

/// Get the artifact name for the current platform.
/// CI artifacts are named like `{profile}-{os}-{arch}-deno`.
fn get_pr_artifact_name() -> Result<String, AnyError> {
  let target = env!("TARGET");

  let (os, arch) = if target.contains("linux") && target.contains("x86_64") {
    ("linux", "x86_64")
  } else if target.contains("linux") && target.contains("aarch64") {
    ("linux", "aarch64")
  } else if target.contains("apple") && target.contains("x86_64") {
    ("macos", "x86_64")
  } else if target.contains("apple") && target.contains("aarch64") {
    ("macos", "aarch64")
  } else if target.contains("windows") && target.contains("x86_64") {
    ("windows", "x86_64")
  } else if target.contains("windows") && target.contains("aarch64") {
    ("windows", "aarch64")
  } else {
    bail!("Unsupported platform for PR builds: {}", target)
  };

  // Prefer release builds, fall back to debug
  Ok(format!("release-{os}-{arch}-deno"))
}

fn get_pr_debug_artifact_name() -> Result<String, AnyError> {
  let release_name = get_pr_artifact_name()?;
  Ok(release_name.replacen("release-", "debug-", 1))
}

fn upgrade_from_pr(
  pr_number: u64,
  upgrade_flags: &UpgradeFlags,
) -> Result<(), AnyError> {
  // Check that `gh` CLI is available
  let gh_version = Command::new("gh").arg("--version").output();
  if gh_version.is_err() {

View on GitHub (pinned to 9ad36f7a2c)

Solutions

  1. Run the upgrade on one of the supported platforms: linux or macOS (x86_64/aarch64), or windows x86_64/aarch64.
  2. If you are on an unsupported platform, download and build from source for that target instead of using PR artifacts.
  3. Check what target your environment reports (e.g. `rustc -vV` / `deno -V` build info) and rule out a misdetected triple.
  4. For linux non-x86_64, note PR release artifacts are typically only published for linux-x86_64; use the debug artifact or build locally.
Defensive patterns

Strategy: fallback

Validate before calling

case "$(uname -s)/$(uname -m)" in
  Linux/x86_64|Linux/aarch64|Darwin/x86_64|Darwin/arm64|MINGW*/x86_64) echo ok ;;
  *) echo "unsupported for PR artifacts; build from source"; exit 1 ;;
esac

Prevention

When it happens

Trigger: Running `deno upgrade --pr <n>` (or the branch equivalent) on a host whose target triple matches none of the six supported combinations, e.g. linux riscv64, windows arm32, or an unusual/renamed triple string that does not contain the expected os/arch substrings checked in get_pr_artifact_name.

Common situations: Building/running Deno on niche architectures or musl variants that report unexpected triples; cross-compilation environments where the detected target differs from the real host; CI containers with custom toolchain targets.

Related errors


AI-assisted analysis of denoland/deno@9ad36f7a2c (2026-08-20). Data as JSON: /api/errors/d1617388df7065d8. Report an issue: GitHub.