vosen/ZLUDA · error

Unknown build profile: {}

Error message

Unknown build profile: {}

What it means

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.

Source

Thrown at llvm_zluda/build.rs:125

    cmd.arg("--version");
    if let Ok(status) = cmd.status() {
        if status.success() {
            cmake.generator("Ninja");
        }
    }
}

// Source: https://stackoverflow.com/a/73603419
// We resort to this garbage because Cargo is ideologically opposed to
// being useful, see here: https://github.com/rust-lang/cargo/issues/11054
fn try_get_build_profile_name() -> String {
    let mut path = PathBuf::from(env::var("OUT_DIR").unwrap());
    path.pop();
    path.pop();
    path.pop();
    let name = path.file_name().unwrap().to_str().unwrap();
    if !["debug", "dev-llvm", "release", "release-lto"].contains(&name) {
        panic!("Unknown build profile: {}", name);
    }
    name.to_string()
}

fn get_llvm_build_path(llvm_build_dir: &PathBuf, cmake_profile: &str) -> PathBuf {
    let mut with_cmake = llvm_build_dir.clone();
    with_cmake.extend(&["build", cmake_profile]);
    if with_cmake.exists() {
        return with_cmake;
    }

    let mut llvm_build_path = llvm_build_dir.clone();
    llvm_build_path.extend(&["build"]);

    return llvm_build_path;
}

fn llvm_config(llvm_config_path: &PathBuf) -> io::Result<(String, String, String, String, String)> {

View on GitHub (pinned to 9c8b43f242)

Solutions

  1. Build with one of the supported profile names (debug, release, or the project's dev-llvm profile)
  2. If a custom profile is required, extend the recognized list in try_get_build_profile_name to include it
  3. Update Cargo/ZLUDA versions so the OUT_DIR path layout assumption still holds
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at llvm_zluda/build.rs:125 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vosen/ZLUDA@9c8b43f242 (2026-09-06). Data as JSON: /api/errors/46e35c494cf81fca. Report an issue: GitHub.