{"record":{"id":"102d35e4f970a975","repo":"run-llama/liteparse","slug":"couldn-t-write-bindings","errorCode":null,"errorMessage":"Couldn't write bindings!","messagePattern":"Couldn't write bindings!","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/pdfium-sys/build.rs","lineNumber":290,"sourceCode":"            .allowlist_function(\"FORM_.*\")\n            .allowlist_function(\"FPDFText_.*\")\n            .allowlist_function(\"FPDFPage.*\")\n            .allowlist_function(\"FPDFLink_.*\")\n            .allowlist_function(\"FPDFFont_.*\")\n            .allowlist_type(\"FPDF.*\")\n            .allowlist_type(\"FS_.*\")\n            .allowlist_var(\"FPDF.*\")\n            .allowlist_var(\"FLAT.*\")\n            .derive_debug(true)\n            .derive_default(true)\n            .layout_tests(false)\n            .parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))\n            .generate()\n            .expect(\"Unable to generate bindings\");\n\n        bindings\n            .write_to_file(&out_file)\n            .expect(\"Couldn't write bindings!\");\n    }\n\n    #[cfg(not(feature = \"bindgen\"))]\n    {\n        let _ = include_dir;\n        let pregenerated = Path::new(env!(\"CARGO_MANIFEST_DIR\")).join(\"bindings.rs\");\n        fs::copy(&pregenerated, &out_file).unwrap_or_else(|e| {\n            panic!(\n                \"Failed to copy pre-generated bindings from {}: {e}\",\n                pregenerated.display()\n            )\n        });\n    }\n}\n","sourceCodeStart":272,"sourceCodeEnd":305,"githubUrl":"https://github.com/run-llama/liteparse/blob/22d2dd8cd7f7b9320102b57ddaf0e663ff7d15a8/crates/pdfium-sys/build.rs#L272-L305","documentation":"The pdfium-sys build script panics because bindgen succeeded in generating the bindings but `write_to_file()` failed to write them to `$OUT_DIR/bindings.rs`. This is an I/O failure writing the generated bindings file, raised as a build-time panic that aborts compilation of the crate.","triggerScenarios":"Building pdfium-sys with the `bindgen` feature while the OUT_DIR path is unwritable or missing: full disk, restrictive permissions, another process/antivirus locking the file, OUT_DIR removed mid-build, or an invalid/oversized target directory path.","commonSituations":"CI runners with read-only or quota-exhausted target directories; Docker containers running the build as a non-root user without write access to CARGO_TARGET_DIR; disk-full during large builds; security software deleting generated files.","solutions":["Free disk space in the target/ filesystem or point CARGO_TARGET_DIR at a location with room, then rebuild.","Check permissions on the OUT_DIR / target directory and ensure the build user can write there (e.g. chown the target dir or rebuild outside the read-only mount).","Clear the stale/corrupted target dir (`cargo clean`) and rebuild.","Exclude the target directory from antivirus/monitoring that may lock or remove freshly written files."],"exampleFix":"// before: OUT_DIR unwritable due to disk/permission issue\n# df -h $CARGO_TARGET_DIR   # check space\n# cargo clean\n// after: use a writable target dir\n# CARGO_TARGET_DIR=/tmp/cargo-target cargo build -p pdfium-sys","handlingStrategy":"validation","validationCode":"# shell — ensure writable target dir with space before building\ntest -w \"$CARGO_TARGET_DIR\" || export CARGO_TARGET_DIR=/tmp/cargo-target\ndf --output=avail -h \"$CARGO_TARGET_DIR\" | awk 'NR==2 && $1+0 < 1048576 {print \"low disk\"; exit 1}'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Monitor disk space on CI runners; cargo clean stale targets regularly","Keep CARGO_TARGET_DIR on a writable, non-read-only filesystem","Exclude target/ from antivirus and container volume mounts with sync/locking quirks","Run builds as a user with write access to the target directory"],"tags":["build","io","file-write","rust"],"backgroundTag":"file-write-failed","analyzedSha":"22d2dd8cd7f7b9320102b57ddaf0e663ff7d15a8","analyzedAt":"2026-09-08T06:09:49.009Z","contentChangedAt":"2026-09-08T06:09:49.009Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}