denoland/deno · error

failed to decompress startup order {}: {error}

Error message

failed to decompress startup order {}: {error}

What it means

Build-script panic in cli/build.rs. For .zst order files the raw bytes are passed through zstd::stream::decode_all. If the stream is not valid zstd data — corrupted download, partially written file, wrong extension on a non-compressed file, or an unsupported future zstd frame — decompression fails and the build aborts with the source path.

Source

Thrown at cli/build.rs:483

      panic!(
        "{ORDER_FILE_ENV} must point to an order generated from the baseline \
       release binary using the default linker layout"
      )
    }));
  let source = source.canonicalize().unwrap_or_else(|error| {
    panic!(
      "failed to resolve startup order {}: {error}",
      source.display()
    )
  });
  println!("cargo:rerun-if-changed={}", source.display());

  let contents = if source.extension().is_some_and(|ext| ext == "zst") {
    let compressed = std::fs::read(&source).unwrap_or_else(|error| {
      panic!("failed to read startup order {}: {error}", source.display())
    });
    zstd::stream::decode_all(compressed.as_slice()).unwrap_or_else(|error| {
      panic!(
        "failed to decompress startup order {}: {error}",
        source.display()
      )
    })
  } else {
    std::fs::read(&source).unwrap_or_else(|error| {
      panic!("failed to read startup order {}: {error}", source.display())
    })
  };

  // Always use the same linker path for generated orders. Full-LTO output can
  // change when only the order-file path changes.
  let order_file = out_dir.join(format!("startup-order-{target}.order"));
  std::fs::write(&order_file, contents).unwrap_or_else(|error| {
    panic!(
      "failed to write startup order {}: {error}",
      order_file.display()
    )

View on GitHub (pinned to 9ad36f7a2c)

Solutions

  1. Test integrity: `zstd -t "$DENO_STARTUP_ORDER_FILE"` — if it fails, regenerate the compressed order file from a good text order
  2. If the file is actually plain text, rename it to drop the .zst extension (the build script only decompresses .zst files)
  3. Re-download or regenerate the artifact from the baseline release binary

Example fix

# before
mv deno.order deno.order.zst        # renamed text file -> decompress panic
# after
zstd -19 -o deno.order.zst deno.order  # actually compress it
Defensive patterns

Strategy: validation

Validate before calling

case "$DENO_STARTUP_ORDER_FILE" in
  *.zst) zstd -t "$DENO_STARTUP_ORDER_FILE" || { echo "corrupt zst order file"; exit 2; } ;;
esac

Prevention

When it happens

Trigger: DENO_STARTUP_ORDER_FILE ends in .zst but the bytes are not a complete zstd frame: truncated upload, git-lfs pointer file instead of the blob, or a plain-text order file someone renamed to .zst.

Common situations: Order-file artifacts corrupted in CI cache or in transfer; a script compresses with a different tool or interrupts mid-write; the file is present but zero-length.

Related errors


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