{"record":{"id":"375b267a19db2b67","repo":"BoundaryML/baml","slug":"sets-default-selector-to-a-relative-path-selector-which","errorCode":null,"errorMessage":"{} sets default.selector to a relative path ({selector}), which would depend on the current directory.\nUse an absolute path, or run: baml toolchain use <path>","messagePattern":"(.+?) sets default\\.selector to a relative path \\((.+?)\\), which would depend on the current directory\\.\nUse an absolute path, or run: baml toolchain use <path>","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml/src/main.rs","lineNumber":530,"sourceCode":"            return Ok(ResolvedSelector {\n                selector: normalize_selector(value.trim(), &env::current_dir()?),\n                source: SelectorSource::Env,\n            });\n        }\n    }\n    if let Some((path, selector)) = project_toolchain_selector()? {\n        return Ok(ResolvedSelector {\n            selector,\n            source: SelectorSource::Project(path),\n        });\n    }\n    let config = read_config();\n    let selector = config.default.selector.trim();\n    if !selector.is_empty() {\n        // A machine-global default resolved against cwd would run a different\n        // binary from each directory, so it has to stand on its own.\n        if is_path_selector(selector) && !is_cwd_independent(selector) {\n            return Err(anyhow!(\n                \"{} sets default.selector to a relative path ({selector}), which would depend on the current directory.\\nUse an absolute path, or run: baml toolchain use <path>\",\n                config_path().display()\n            ));\n        }\n        return Ok(ResolvedSelector {\n            selector: normalize_selector(selector, &env::current_dir()?),\n            source: SelectorSource::Config,\n        });\n    }\n    Ok(ResolvedSelector {\n        selector: \"canary\".to_string(),\n        source: SelectorSource::Fallback,\n    })\n}\n\nfn project_toolchain_selector() -> Result<Option<(PathBuf, String)>> {\n    let mut dir = env::current_dir()?;\n    let home = env::var_os(\"HOME\").map(PathBuf::from);","sourceCodeStart":512,"sourceCodeEnd":548,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml/src/main.rs#L512-L548","documentation":"Fires while resolving the active toolchain selector: the machine-global config (~/.baml/config) has default.selector set to a relative filesystem path. Global defaults are resolved at invocation time, so a relative path would pick a different binary depending on the cwd — the wrapper refuses rather than run an unpredictable toolchain. The selector resolution order is env var > project baml.toml > global config; only the global-config branch can produce this error.","triggerScenarios":"Thrown at baml_language/crates/baml/src/main.rs:530 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Edit the global config's default.selector to an absolute path","Or register the local build properly with `baml toolchain use <absolute-path>`"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}