{"record":{"id":"c783e540247eec9f","repo":"denoland/deno","slug":"failed-to-write-startup-order-error","errorCode":null,"errorMessage":"failed to write startup order {}: {error}","messagePattern":"failed to write startup order (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/build.rs","lineNumber":498,"sourceCode":"      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| {\n      panic!(\"failed to read startup order {}: {error}\", source.display())\n    })\n  };\n\n  // Always use the same linker path for generated orders. Full-LTO output can\n  // change when only the order-file path changes.\n  let order_file = out_dir.join(format!(\"startup-order-{target}.order\"));\n  std::fs::write(&order_file, contents).unwrap_or_else(|error| {\n    panic!(\n      \"failed to write startup order {}: {error}\",\n      order_file.display()\n    )\n  });\n\n  let contents = std::fs::read_to_string(&order_file).unwrap_or_else(|error| {\n    panic!(\n      \"failed to validate startup order {}: {error}\",\n      order_file.display()\n    )\n  });\n  let symbol_count = contents\n    .lines()\n    .filter(|line| !line.is_empty() && !line.starts_with('#'))\n    .count();\n  if symbol_count < 1_000 {\n    panic!(\n      \"startup order {} has only {symbol_count} symbols\",","sourceCodeStart":480,"sourceCodeEnd":516,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/build.rs#L480-L516","documentation":"Build-script panic in cli/build.rs. The decoded order contents are copied to a fixed path in cargo's OUT_DIR (startup-order-<target>.order) so the linker argument never changes (full-LTO output is sensitive to the order-file path). std::fs::write to that destination fails on a full disk, a read-only or missing OUT_DIR, or permission errors, panicking with the destination path.","triggerScenarios":"Building with startup ordering enabled when the filesystem holding target/ is full (ENOSPC), OUT_DIR was made read-only, or the build runs under a sandbox/containers with a no-write overlay for the build directory.","commonSituations":"CI runners with exhausted disk quotas; devcontainers where /workspace is a read-only mount; antivirus or macOS SIP-protected paths blocking writes into target/release/build/...","solutions":["Free space or raise the disk quota on the volume holding target/, then rebuild","Fix permissions: `chmod -R u+w target/` or move CARGO_TARGET_DIR to a writable location","Disable startup ordering (`unset DENO_USE_STARTUP_ORDER`) if you only need a build, not the optimization"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"df -h \"${CARGO_TARGET_DIR:-$PWD/target}\" | tail -1   # ensure space\nmkdir -p \"${CARGO_TARGET_DIR:-$PWD/target}\" && touch \"${CARGO_TARGET_DIR:-$PWD/target}/.w\" || { echo 'target dir not writable'; exit 2; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add a disk-space check gate in CI before cargo build jobs","Keep CARGO_TARGET_DIR on a writable local volume, not a read-only bind mount"],"tags":["build-script","disk-full","permissions","out-dir","startup-order"],"backgroundTag":"file-write-failed","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}