{"record":{"id":"e35dc5156101e067","repo":"BoundaryML/baml","slug":"self-update-is-disabled-in-this-build-update-baml-with-your","errorCode":null,"errorMessage":"self-update is disabled in this build.\nUpdate BAML with your package manager.","messagePattern":"self-update is disabled in this build\\.\nUpdate BAML with your package manager\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml/src/main.rs","lineNumber":1526,"sourceCode":"\nfn uninstall_toolchain(version: &str) -> Result<()> {\n    if is_path_selector(version) {\n        return Err(anyhow!(\n            \"{version} is a local path and is not managed by the wrapper, so there is nothing to uninstall.\\nTo stop using it, select a managed toolchain instead.\\nRun: baml toolchain use canary\\nOr:  baml toolchain use nightly\"\n        ));\n    }\n    let dir = toolchains_dir().join(version);\n    if !dir.exists() {\n        return Err(anyhow!(\"BAML toolchain {version} is not installed\"));\n    }\n    fs::remove_dir_all(dir)?;\n    println!(\"uninstalled BAML toolchain {version}\");\n    Ok(())\n}\n\n#[cfg(any(not(feature = \"self-update\"), feature = \"no-self-update\"))]\nfn self_update() -> Result<()> {\n    Err(anyhow!(\n        \"self-update is disabled in this build.\\nUpdate BAML with your package manager.\"\n    ))\n}\n\n#[cfg(all(feature = \"self-update\", not(feature = \"no-self-update\")))]\nfn self_update() -> Result<()> {\n    let current = env::current_exe()?;\n    let manifest = fetch_wrapper_manifest()?;\n    let target = baml_release::release_host_target_triple()?;\n    let artifact = manifest.artifact_for_target(target)?.clone();\n    let binary = if cfg!(windows) { \"baml.exe\" } else { \"baml\" };\n    let fetcher = baml_release::Fetcher::from_artifact(\n        ReleaseSpec {\n            version: manifest.version.clone(),\n            target: target.to_string(),\n        },\n        Product::Wrapper,\n        artifact,","sourceCodeStart":1508,"sourceCodeEnd":1544,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml/src/main.rs#L1508-L1544","documentation":"In builds compiled without the self-update feature (or with the no-self-update feature enabled, e.g. distro package-manager builds), self_update unconditionally returns this error. The wrapper cannot update itself in such builds and tells the user to rely on their package manager instead.","triggerScenarios":"Running `baml self-update` (or any command routed to self_update) on a binary compiled with `not(feature = \"self-update\")` or `feature = \"no-self-update\"` — e.g. a distro/Homebrew/package-manager build.","commonSituations":"Using baml installed via apt/brew/cargo from a package registry where self-update is deliberately compiled out; container images with no-self-update builds; CI images expecting the standalone binary behavior.","solutions":["Update via your package manager instead: e.g. `brew upgrade baml`, `apt upgrade`, or `cargo install`.","Install the official standalone baml binary (built with the self-update feature) if you want `baml self-update` to work."],"exampleFix":"// before\nbaml self-update   # disabled build\n// after\nbrew upgrade baml   # or: apt upgrade baml / cargo install --force baml-cli","handlingStrategy":"fallback","validationCode":"// detect a no-self-update build before attempting\nconst out = execFileSync('baml', ['self-update']).toString(); // error text says disabled\n// or check install source: brew/apt/cargo installs are typically built without self-update","typeGuard":null,"tryCatchPattern":"try {\n  execFileSync('baml', ['self-update']);\n} catch (e) {\n  if (/self-update is disabled/.test(e.stderr?.toString() ?? '')) {\n    execFileSync('brew', ['upgrade', 'baml']); // package-manager fallback\n  }\n}","preventionTips":["Know how your baml was installed; package-manager builds never self-update.","In scripts, fall back to the package manager upgrade command on this error.","Use official standalone binaries if self-update is required."],"tags":["cli","self-update","feature-flag"],"backgroundTag":"feature-not-enabled","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}