{"record":{"id":"f3161711103e8d8c","repo":"jdx/mise","slug":"brew-casks-are-installed-at-their-current-version","errorCode":null,"errorMessage":"brew casks are installed at their current version ('{p}')","messagePattern":"brew casks are installed at their current version \\('(.+?)'\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask.rs","lineNumber":377,"sourceCode":"impl CaskPrunePlan {\n    pub(crate) fn is_empty(&self) -> bool {\n        self.remove.is_empty()\n    }\n}\n\nimpl BrewCaskManager {\n    pub(crate) fn new() -> Self {\n        Self {}\n    }\n\n    async fn install_with_manager_options(\n        &self,\n        pkgs: &[PackageRequest],\n        opts: &InstallOpts,\n        manager_options: &ManagerPackageOptions,\n    ) -> Result<()> {\n        if let Some(p) = pkgs.iter().find(|p| p.version.is_some()) {\n            bail!(\"brew casks are installed at their current version ('{p}')\");\n        }\n        if opts.dry_run {\n            prefix::bootstrap(true)?;\n            for pkg in pkgs {\n                self.install_one(pkg, opts, None, manager_options).await?;\n            }\n            return Ok(());\n        }\n        let mpr = MultiProgressReport::get();\n        mpr.init_footer(false, \"install\", pkgs.len());\n        for pkg in pkgs {\n            let pr: Box<dyn SingleReport> = mpr.add(&format!(\"brew-cask:{}\", pkg.name));\n            match self\n                .install_one(pkg, opts, Some(&*pr), manager_options)\n                .await\n            {\n                Ok(version) => {\n                    pr.finish_with_message(version);","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/system/packages/brew/cask.rs#L359-L395","documentation":"BrewCaskManager::install_with_manager_options (src/system/packages/brew/cask.rs:377) rejects any PackageRequest that carries a version before doing any work. Homebrew casks are versionless from mise's perspective: the cask JSON pins exactly one current version and mise always installs that, so version pinning is unsupported and the request fails fast, naming the offending package.","triggerScenarios":"A cask install or bootstrap request that includes a version pin — e.g. mise install brew-cask:firefox@127.0 or a packages entry with both name routed to brew-cask and a version field. The find over pkgs locates the first request with version.is_some() and bails immediately.","commonSituations":"Users copying versioned syntax that works for brew formulae or apt packages into cask entries; shared CI config templates reused across formulae and casks; tools that auto-generate versioned package manifests.","solutions":["Drop the version from the cask request — mise installs the cask's current version as published in its API metadata","If a specific older app version is required, install it manually (vendor installer or a tap carrying the old cask) and manage it outside mise","Remember version pinning works for brew formulae and other managers — make sure the entry is not routed to the cask manager"],"exampleFix":"# before\n$ mise install brew-cask:firefox@127.0\n\n# after\n$ mise install brew-cask:firefox","handlingStrategy":"validation","validationCode":"fn ensure_versionless(pkgs: &[PackageRequest]) -> Result<()> {\n    if let Some(p) = pkgs.iter().find(|p| p.version.is_some()) {\n        eyre::bail!(\"cask {p} cannot carry a version; brew casks install at their current version\");\n    }\n    Ok(())\n}","typeGuard":"fn is_valid_cask_request(p: &PackageRequest) -> bool { p.version.is_none() }","tryCatchPattern":null,"preventionTips":["Never put version pins on entries routed to brew-cask","Use unpinned cask entries and rely on upgrades for updates","Reserve version pinning for managers that support it (apt, brew formulae)"],"tags":["brew-cask","version-pinning","homebrew","validation"],"backgroundTag":"version-pin-unsupported","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}