{"record":{"id":"dd85e5e622a1f6cb","repo":"denoland/deno","slug":"failed-to-resolve-startup-order-error","errorCode":null,"errorMessage":"failed to resolve startup order {}: {error}","messagePattern":"failed to resolve startup order (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/build.rs","lineNumber":471,"sourceCode":"  }\n\n  let target = env::var(\"TARGET\").unwrap();\n  match target.as_str() {\n    \"aarch64-apple-darwin\"\n    | \"aarch64-unknown-linux-gnu\"\n    | \"x86_64-unknown-linux-gnu\" => {}\n    _ => return,\n  }\n\n  let source =\n    PathBuf::from(env::var_os(ORDER_FILE_ENV).unwrap_or_else(|| {\n      panic!(\n        \"{ORDER_FILE_ENV} must point to an order generated from the baseline \\\n       release binary using the default linker layout\"\n      )\n    }));\n  let source = source.canonicalize().unwrap_or_else(|error| {\n    panic!(\n      \"failed to resolve startup order {}: {error}\",\n      source.display()\n    )\n  });\n  println!(\"cargo:rerun-if-changed={}\", source.display());\n\n  let contents = if source.extension().is_some_and(|ext| ext == \"zst\") {\n    let compressed = std::fs::read(&source).unwrap_or_else(|error| {\n      panic!(\"failed to read startup order {}: {error}\", source.display())\n    });\n    zstd::stream::decode_all(compressed.as_slice()).unwrap_or_else(|error| {\n      panic!(\n        \"failed to decompress startup order {}: {error}\",\n        source.display()\n      )\n    })\n  } else {\n    std::fs::read(&source).unwrap_or_else(|error| {","sourceCodeStart":453,"sourceCodeEnd":489,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/build.rs#L453-L489","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\nexport DENO_STARTUP_ORDER_FILE=orders/deno.order   # relative, wrong cwd\n# after\nexport DENO_STARTUP_ORDER_FILE=\"$PWD/orders/deno.order\"","handlingStrategy":"validation","validationCode":"p=\"${DENO_STARTUP_ORDER_FILE:?unset}\"\n[ -f \"$p\" ] || { echo \"order file not found: $p\"; exit 2; }\n[ -r \"$p\" ] || { echo \"order file not readable: $p\"; exit 2; }\nexport DENO_STARTUP_ORDER_FILE=\"$(cd \"$(dirname \"$p\")\" && pwd)/$(basename \"$p\")\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always export absolute paths for build-input files","Verify CI artifacts (order file) were downloaded before invoking cargo"],"tags":["build-script","file-not-found","path-resolution","startup-order"],"backgroundTag":"path-resolution-failed","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}