{"record":{"id":"26f9adb6a4269ca2","repo":"vosen/ZLUDA","slug":"failed-to-read","errorCode":null,"errorMessage":"Failed to read {}: {}","messagePattern":"Failed to read (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"llvm_zluda/build.rs","lineNumber":79,"sourceCode":"    println!(\"cargo:build-path={}\", llvm_build_path.display());\n    let (cxxflags, ldflags, libdir, lib_names, system_libs) =\n        llvm_config(&llvm_build_path.join(\"bin/llvm-config\")).unwrap();\n    println!(\"cargo:rustc-link-arg={ldflags}\");\n    println!(\"cargo:rustc-link-search=native={libdir}\");\n    for lib in system_libs.split_ascii_whitespace() {\n        println!(\"cargo:rustc-link-arg={lib}\");\n    }\n    link_lld_components();\n    link_llvm_components(lib_names);\n    compile_cxx_lib(cxxflags, &llvm_build_path);\n}\n\nfn check_lfs_file(bc_path: &str) {\n    let mut magic = [0u8; 2];\n    File::open(bc_path)\n        .unwrap_or_else(|e| panic!(\"Failed to open {}: {}\", bc_path, e))\n        .read_exact(&mut magic)\n        .unwrap_or_else(|e| panic!(\"Failed to read {}: {}\", bc_path, e));\n    assert!(\n        &magic == b\"BC\",\n        \"{} is a git lfs stub and not the actual file. Run `git lfs pull` to fetch it\",\n        bc_path\n    );\n}\n\n// https://github.com/mozilla/sccache/blob/main/README.md#usage\nfn try_use_sccache(cmake: &mut Config) {\n    if let Ok(sccache) = std::env::var(\"SCCACHE_PATH\") {\n        cmake.define(\"CMAKE_CXX_COMPILER_LAUNCHER\", &*sccache);\n        cmake.define(\"CMAKE_C_COMPILER_LAUNCHER\", &*sccache);\n        match std::env::var_os(\"CARGO_CFG_TARGET_OS\") {\n            Some(os) if os == \"windows\" => {\n                cmake.define(\n                    \"CMAKE_MSVC_DEBUG_INFORMATION_FORMAT\",\n                    \"$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>\",\n                );","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/vosen/ZLUDA/blob/9c8b43f242985150f86a7f485218b7b82c3e96ca/llvm_zluda/build.rs#L61-L97","documentation":"Build-script panic in check_lfs_file: the file opened successfully but reading the first bytes failed, typically because the path points to a directory, the file is empty, or an I/O error (permissions, disk, race with LFS smudge) occurred mid-read. The read is only 2 bytes to inspect the magic header, so failure almost always indicates the wrong kind of file rather than truncation.","triggerScenarios":"Thrown at llvm_zluda/build.rs:79 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the path is a regular file and not a directory","Run `git lfs pull` to replace any stub with the real object","Check file permissions and disk health if the error persists"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9c8b43f242985150f86a7f485218b7b82c3e96ca","analyzedAt":"2026-09-06T09:21:08.049Z","contentChangedAt":"2026-09-06T09:21:08.049Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}