denoland/deno · error

startup order {} has only {symbol_count} symbols

Error message

startup order {} has only {symbol_count} symbols

What it means

Build-script panic in cli/build.rs. After reading back the copied order file, the script counts non-empty lines not starting with '#'. A real order file generated from a baseline release deno binary contains hundreds of thousands of symbols; fewer than 1,000 non-comment lines means the file is essentially not a valid order file (empty, a stub, a tiny hand-written list), and the build aborts.

Source

Thrown at cli/build.rs:515

  std::fs::write(&order_file, contents).unwrap_or_else(|error| {
    panic!(
      "failed to write startup order {}: {error}",
      order_file.display()
    )
  });

  let contents = std::fs::read_to_string(&order_file).unwrap_or_else(|error| {
    panic!(
      "failed to validate startup order {}: {error}",
      order_file.display()
    )
  });
  let symbol_count = contents
    .lines()
    .filter(|line| !line.is_empty() && !line.starts_with('#'))
    .count();
  if symbol_count < 1_000 {
    panic!(
      "startup order {} has only {symbol_count} symbols",
      order_file.display()
    );
  }

  let order_file = order_file.canonicalize().unwrap();
  match target.as_str() {
    "aarch64-apple-darwin" => println!(
      "cargo:rustc-link-arg-bin=deno=-Wl,-order_file,{}",
      order_file.display()
    ),
    "aarch64-unknown-linux-gnu" | "x86_64-unknown-linux-gnu" => {
      println!(
        "cargo:rustc-link-arg-bin=deno=-Wl,--symbol-ordering-file={}",
        order_file.display()
      );
      println!("cargo:rustc-link-arg-bin=deno=-Wl,--no-warn-symbol-ordering");
    }

View on GitHub (pinned to 9ad36f7a2c)

Solutions

  1. Count your lines: `grep -cv -e '^#' -e '^$' "$DENO_STARTUP_ORDER_FILE"` — if it is under 1000, the file is wrong
  2. Regenerate the order file from a baseline release binary using Deno's startup-order tooling
  3. If you did not mean to enable the feature, unset DENO_USE_STARTUP_ORDER
Defensive patterns

Strategy: validation

Validate before calling

n=$(grep -cv -e '^#' -e '^$' "$DENO_STARTUP_ORDER_FILE")
[ "$n" -ge 1000 ] || { echo "order file has only $n symbols; regenerate from a baseline release binary"; exit 2; }

Prevention

When it happens

Trigger: DENO_STARTUP_ORDER_FILE points at a near-empty file, a file of only comments, a truncated order, or a placeholder artifact while DENO_USE_STARTUP_ORDER=1 on a supported release build.

Common situations: Someone hand-writes a small order file to 'test the feature'; CI artifact glob matched an empty stub; a partial download produced only the file header.

Related errors


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