{"record":{"id":"46e35c494cf81fca","repo":"vosen/ZLUDA","slug":"unknown-build-profile","errorCode":null,"errorMessage":"Unknown build profile: {}","messagePattern":"Unknown build profile: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"llvm_zluda/build.rs","lineNumber":125,"sourceCode":"    cmd.arg(\"--version\");\n    if let Ok(status) = cmd.status() {\n        if status.success() {\n            cmake.generator(\"Ninja\");\n        }\n    }\n}\n\n// Source: https://stackoverflow.com/a/73603419\n// We resort to this garbage because Cargo is ideologically opposed to\n// being useful, see here: https://github.com/rust-lang/cargo/issues/11054\nfn try_get_build_profile_name() -> String {\n    let mut path = PathBuf::from(env::var(\"OUT_DIR\").unwrap());\n    path.pop();\n    path.pop();\n    path.pop();\n    let name = path.file_name().unwrap().to_str().unwrap();\n    if ![\"debug\", \"dev-llvm\", \"release\", \"release-lto\"].contains(&name) {\n        panic!(\"Unknown build profile: {}\", name);\n    }\n    name.to_string()\n}\n\nfn get_llvm_build_path(llvm_build_dir: &PathBuf, cmake_profile: &str) -> PathBuf {\n    let mut with_cmake = llvm_build_dir.clone();\n    with_cmake.extend(&[\"build\", cmake_profile]);\n    if with_cmake.exists() {\n        return with_cmake;\n    }\n\n    let mut llvm_build_path = llvm_build_dir.clone();\n    llvm_build_path.extend(&[\"build\"]);\n\n    return llvm_build_path;\n}\n\nfn llvm_config(llvm_config_path: &PathBuf) -> io::Result<(String, String, String, String, String)> {","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/vosen/ZLUDA/blob/9c8b43f242985150f86a7f485218b7b82c3e96ca/llvm_zluda/build.rs#L107-L143","documentation":"Panic in try_get_build_profile_name: Cargo exposes no official API for the active profile, so the build script infers it by walking up three parent directories from OUT_DIR and reading the directory name. That name was not one of the recognized profiles (debug, dev-llvm, release, ...), which happens with custom profile names (e.g. release-with-debug) or when Cargo changes its internal target directory layout.","triggerScenarios":"Thrown at llvm_zluda/build.rs:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Build with one of the supported profile names (debug, release, or the project's dev-llvm profile)","If a custom profile is required, extend the recognized list in try_get_build_profile_name to include it","Update Cargo/ZLUDA versions so the OUT_DIR path layout assumption still holds"],"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-14T00:17:10.932Z"}