{"record":{"id":"53197ad738fb96fe","repo":"denoland/deno","slug":"failed-to-decompress-startup-order-error","errorCode":null,"errorMessage":"failed to decompress startup order {}: {error}","messagePattern":"failed to decompress startup order (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/build.rs","lineNumber":483,"sourceCode":"      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| {\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    )","sourceCodeStart":465,"sourceCodeEnd":501,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/build.rs#L465-L501","documentation":"Build-script panic in cli/build.rs. For .zst order files the raw bytes are passed through zstd::stream::decode_all. If the stream is not valid zstd data — corrupted download, partially written file, wrong extension on a non-compressed file, or an unsupported future zstd frame — decompression fails and the build aborts with the source path.","triggerScenarios":"DENO_STARTUP_ORDER_FILE ends in .zst but the bytes are not a complete zstd frame: truncated upload, git-lfs pointer file instead of the blob, or a plain-text order file someone renamed to .zst.","commonSituations":"Order-file artifacts corrupted in CI cache or in transfer; a script compresses with a different tool or interrupts mid-write; the file is present but zero-length.","solutions":["Test integrity: `zstd -t \"$DENO_STARTUP_ORDER_FILE\"` — if it fails, regenerate the compressed order file from a good text order","If the file is actually plain text, rename it to drop the .zst extension (the build script only decompresses .zst files)","Re-download or regenerate the artifact from the baseline release binary"],"exampleFix":"# before\nmv deno.order deno.order.zst        # renamed text file -> decompress panic\n# after\nzstd -19 -o deno.order.zst deno.order  # actually compress it","handlingStrategy":"validation","validationCode":"case \"$DENO_STARTUP_ORDER_FILE\" in\n  *.zst) zstd -t \"$DENO_STARTUP_ORDER_FILE\" || { echo \"corrupt zst order file\"; exit 2; } ;;\nesac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Integrity-test compressed artifacts right after producing or downloading them","Name files by real content: only true zstd streams get .zst"],"tags":["build-script","zstd","corrupt-file","decompression","startup-order"],"backgroundTag":"corrupt-compressed-file","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}