{"record":{"id":"62f4547ebda93894","repo":"jdx/mise","slug":"brew-import-is-not-supported-on-windows","errorCode":null,"errorMessage":"brew import is not supported on windows","messagePattern":"brew import is not supported on windows","errorType":"validation","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/cli/system/import.rs","lineNumber":178,"sourceCode":"            cf.update_bootstrap_package_with_fallback(\n                &key,\n                \"latest\",\n                configured_packages.get(&key),\n            )?;\n        }\n        cf.save()?;\n        info!(\n            \"{}: imported {} brew formulae\",\n            display_path(&path),\n            formulae.len()\n        );\n        Ok(())\n    }\n\n    #[cfg(not(unix))]\n    async fn run_brew(self) -> Result<()> {\n        let _ = self.manager;\n        bail!(\"brew import is not supported on windows\")\n    }\n}\n\n#[cfg(unix)]\nfn imported_package_value(\n    target: Option<&PackageTomlConfig>,\n    configured: Option<&PackageTomlConfig>,\n) -> Value {\n    let options = match target {\n        Some(PackageTomlConfig::Options(options)) => Some(options),\n        Some(PackageTomlConfig::Version(_)) => None,\n        None => match configured {\n            Some(PackageTomlConfig::Options(options)) if !options.os.is_empty() => Some(options),\n            _ => None,\n        },\n    };\n    let Some(options) = options else {\n        return Value::from(\"latest\");","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/cli/system/import.rs#L160-L196","documentation":"The brew import implementation only exists behind #[cfg(unix)]. On Windows, run_brew is compiled as a stub that immediately fails with this message — importing Homebrew formulae is simply not supported there, regardless of whether brew-like tooling is installed.","triggerScenarios":"Running `mise system import brew` (or any import path that routes to run_brew) on a Windows host — the cfg(not(unix)) variant always bails.","commonSituations":"Cross-platform dotfiles/bootstrap scripts running the same mise commands on Windows; CI matrices that include windows-latest; users assuming mise abstracts brew across OSes.","solutions":["Skip the brew import on Windows (guard the step: `if [ \"$(uname)\" != \"Linux\" ]` / `os: [ubuntu, macos]` in CI, or `if runner.os != 'Windows'`)","On Windows, manage equivalent packages with a supported manager (e.g. winget) and configure its [bootstrap.packages] entries","Keep brew-based bootstrap config in Unix-only mise config files so Windows never loads those entries"],"exampleFix":"# before (runs on all OSes)\nmise system import brew   # fails on Windows\n\n# after (GitHub Actions)\n- if: runner.os != 'Windows'\n  run: mise system import brew","handlingStrategy":"validation","validationCode":"# bash: gate brew imports to Unix hosts\ncase \"$(uname -s)\" in Linux|Darwin) mise system import brew ;; *) echo \"skip: brew import unsupported on $(uname -s)\" ;; esac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make cross-platform setup scripts OS-aware (uname / runner.os) around brew commands","Keep brew-specific bootstrap config in Unix-only config files so Windows never imports it"],"tags":["system-packages","import","brew","windows","platform-support"],"backgroundTag":"unsupported-platform","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}