{"record":{"id":"d70843c372f4192c","repo":"denoland/deno","slug":"order-file-env-must-point-to-an-order-generated","errorCode":null,"errorMessage":"{ORDER_FILE_ENV} must point to an order generated from the baseline release binary using the default linker layout","messagePattern":"(.+?) must point to an order generated from the baseline release binary using the default linker layout","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/build.rs","lineNumber":465,"sourceCode":"    panic!(\"{ENABLE_ENV} must be unset or set to 1\");\n  }\n\n  let profile = env::var(\"PROFILE\").unwrap();\n  if profile != \"release\" {\n    panic!(\"startup ordering is only supported by the release profile\");\n  }\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!(","sourceCodeStart":447,"sourceCodeEnd":483,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/build.rs#L447-L483","documentation":"Build-script panic in cli/build.rs. Enabling startup ordering (DENO_USE_STARTUP_ORDER=1) on a release build for a supported target (aarch64/x86_64 darwin or linux-gnu) requires a linker order file produced from a baseline release binary. If DENO_STARTUP_ORDER_FILE is not set at all, the build script panics with this message at the env::var_os unwrap.","triggerScenarios":"DENO_USE_STARTUP_ORDER=1 + `cargo build --release` on a supported target while DENO_STARTUP_ORDER_FILE is unset; e.g. enabling the flag to experiment without ever generating a BOLT-style order file.","commonSituations":"A contributor reads about Deno's startup-order optimization, flips only the enable flag, and forgets the companion variable; or a CI job sets the enable var but the order-file path lives in a secret/artifact that was not downloaded.","solutions":["Generate an order file from a baseline release binary and point the env var at it: `export DENO_STARTUP_ORDER_FILE=/abs/path/deno.order`","If you did not intend to use startup ordering, unset the enable flag: `unset DENO_USE_STARTUP_ORDER`","Verify both variables are exported in the same shell/CI step that runs cargo"],"exampleFix":"# before\nexport DENO_USE_STARTUP_ORDER=1\ncargo build --release  # DENO_STARTUP_ORDER_FILE missing\n# after\nexport DENO_USE_STARTUP_ORDER=1\nexport DENO_STARTUP_ORDER_FILE=\"$PWD/orders/deno.order\"\ncargo build --release","handlingStrategy":"validation","validationCode":"if [ \"${DENO_USE_STARTUP_ORDER:-}\" = \"1\" ] && [ -z \"${DENO_STARTUP_ORDER_FILE:-}\" ]; then\n  echo \"DENO_STARTUP_ORDER_FILE is required when DENO_USE_STARTUP_ORDER=1\"; exit 2\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set the enable flag and order-file path together in one command","Fail fast in CI before the build: assert both variables when startup ordering is requested"],"tags":["build-script","env-var","startup-order","order-file","configuration"],"backgroundTag":"missing-env-var","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}