denoland/deno · error
failed to resolve startup order {}: {error}
Error message
failed to resolve startup order {}: {error} What it means
Build-script panic in cli/build.rs. After DENO_STARTUP_ORDER_FILE is read, the path is canonicalized (std::fs::canonicalize) to emit a stable cargo:rerun-if-changed value. Canonicalization fails when the path does not exist, is not accessible due to permissions, or a component is a broken symlink, and the error is reported with the offending path.
Source
Thrown at cli/build.rs:471
}
let target = env::var("TARGET").unwrap();
match target.as_str() {
"aarch64-apple-darwin"
| "aarch64-unknown-linux-gnu"
| "x86_64-unknown-linux-gnu" => {}
_ => return,
}
let source =
PathBuf::from(env::var_os(ORDER_FILE_ENV).unwrap_or_else(|| {
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| {View on GitHub (pinned to 9ad36f7a2c)
Solutions
- Check the path exists and is absolute: `ls -l "$DENO_STARTUP_ORDER_FILE"` and export an absolute path
- Regenerate or re-download the order-file artifact if it was lost
- Fix directory execute/read permissions on every component of the path for the build user
Example fix
# before export DENO_STARTUP_ORDER_FILE=orders/deno.order # relative, wrong cwd # after export DENO_STARTUP_ORDER_FILE="$PWD/orders/deno.order"
Defensive patterns
Strategy: validation
Validate before calling
p="${DENO_STARTUP_ORDER_FILE:?unset}"
[ -f "$p" ] || { echo "order file not found: $p"; exit 2; }
[ -r "$p" ] || { echo "order file not readable: $p"; exit 2; }
export DENO_STARTUP_ORDER_FILE="$(cd "$(dirname "$p")" && pwd)/$(basename "$p")" Prevention
- Always export absolute paths for build-input files
- Verify CI artifacts (order file) were downloaded before invoking cargo
When it happens
Trigger: DENO_USE_STARTUP_ORDER=1 with DENO_STARTUP_ORDER_FILE pointing to a nonexistent path (typo, wrong working directory, relative path resolved against the crate dir), a deleted artifact, or a file inside a container volume the build user cannot traverse.
Common situations: CI passes a path relative to a different job's workspace, or the order-file artifact was never produced/uploaded so the path refers to a missing file; locally, a moved or renamed order file.
Related errors
- {ENABLE_ENV} must be unset or set to 1
- startup ordering is only supported by the release profile
- {ORDER_FILE_ENV} must point to an order generated from the b
- failed to read startup order {}: {error}
- failed to decompress startup order {}: {error}
AI-assisted analysis of denoland/deno@9ad36f7a2c (2026-08-20).
Data as JSON: /api/errors/dd85e5e622a1f6cb.
Report an issue: GitHub.