{"record":{"id":"81829fac4d6b2449","repo":"tauri-apps/tauri","slug":"failed-to-write-checked-features-file","errorCode":null,"errorMessage":"failed to write checked_features file","messagePattern":"failed to write checked_features file","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri/build.rs","lineNumber":275,"sourceCode":"  let dev = !custom_protocol;\n  alias(\"custom_protocol\", custom_protocol);\n  alias(\"dev\", dev);\n\n  println!(\"cargo:dev={dev}\");\n\n  let target_os = std::env::var(\"CARGO_CFG_TARGET_OS\").unwrap();\n  let mobile = target_os == \"ios\" || target_os == \"android\";\n  alias(\"desktop\", !mobile);\n  alias(\"mobile\", mobile);\n\n  let out_dir = PathBuf::from(env::var(\"OUT_DIR\").unwrap());\n\n  let checked_features_out_path = out_dir.join(\"checked_features\");\n  std::fs::write(\n    checked_features_out_path,\n    CHECKED_FEATURES.get().unwrap().lock().unwrap().join(\",\"),\n  )\n  .expect(\"failed to write checked_features file\");\n\n  // workaround needed to prevent `STATUS_ENTRYPOINT_NOT_FOUND` error in tests\n  // see https://github.com/tauri-apps/tauri/pull/4383#issuecomment-1212221864\n  let target_env = std::env::var(\"CARGO_CFG_TARGET_ENV\");\n  let is_tauri_workspace = std::env::var(\"__TAURI_WORKSPACE__\").is_ok_and(|v| v == \"true\");\n  if is_tauri_workspace && target_os == \"windows\" && Ok(\"msvc\") == target_env.as_deref() {\n    embed_manifest_for_tests();\n  }\n\n  if target_os == \"android\" {\n    fn env_var(var: &str) -> String {\n      std::env::var(var).unwrap_or_else(|_| {\n        panic!(\"`{var}` is not set, which is needed to generate the kotlin files for android.\")\n      })\n    }\n\n    if let Ok(kotlin_out_dir) = std::env::var(\"WRY_ANDROID_KOTLIN_FILES_OUT_DIR\") {\n      let package = env_var(\"WRY_ANDROID_PACKAGE\");","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri/build.rs#L257-L293","documentation":"The tauri crate's own build script writes the comma-separated list of checked ACL features to $OUT_DIR/checked_features. The expect fires when that write fails: OUT_DIR missing or unwritable, read-only target directory, disk full, or Windows path/antivirus interference.","triggerScenarios":"Building the tauri crate in an environment where target/ is read-only or full: hardened CI containers, sandboxed runners, exceeded disk quota, antivirus locking freshly created files on Windows.","commonSituations":"CI with read-only workspace caches; disk-full runners; extremely deep target/ paths on Windows.","solutions":["Make the target directory writable and ensure free disk space.","Run cargo clean to clear possibly corrupted state.","On Windows: enable long-path support or move the project to a shorter path; exclude target/ from antivirus scanning."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// fail fast with a clear message if OUT_DIR is not writable\nlet out = std::path::PathBuf::from(std::env::var(\"OUT_DIR\").unwrap());\nstd::fs::create_dir_all(&out).expect(\"OUT_DIR missing/unwritable - check target dir permissions and disk space\");\nstd::fs::write(out.join(\".probe\"), b\"\").and_then(|_| std::fs::remove_file(out.join(\".probe\")))\n    .expect(\"OUT_DIR is not writable\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the target directory writable in CI; do not mount it read-only.","Monitor disk space on build runners.","Exclude target/ from antivirus scanning on Windows."],"tags":["tauri","build-script","out-dir","io","ci"],"backgroundTag":"build-script-write-failed","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","contentChangedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}