{"record":{"id":"5fdab7f8f66db9c8","repo":"jdx/mise","slug":"brew-cask-installer-executable-was-not-found-5fdab7","errorCode":null,"errorMessage":"brew-cask: installer executable '{}' was not found","messagePattern":"brew-cask: installer executable '(.+?)' was not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/mod.rs","lineNumber":2388,"sourceCode":"    // `allow_current_user` is true because a per-user appdir such as\n    // `~/Applications` is legitimately owned by the invoking user.\n    open_trusted_directory(Path::new(\"/\"), relative, true, true)\n}\n\nfn run_installer_artifact(\n    stage: &Path,\n    installer: &InstallerArtifact,\n    copied_files: &BTreeSet<PathBuf>,\n) -> Result<()> {\n    let executable = stage.join(&installer.executable);\n    if staged_relative_path(stage, &executable).is_none() {\n        bail!(\n            \"brew-cask: refusing installer executable outside trusted installer roots: {}\",\n            executable.display()\n        );\n    }\n    if !executable.is_file() {\n        bail!(\n            \"brew-cask: installer executable '{}' was not found\",\n            installer.executable\n        );\n    }\n    let executable = file::desymlink_path(&executable);\n    if !executable.starts_with(file::desymlink_path(stage)) && !copied_files.contains(&executable) {\n        bail!(\n            \"brew-cask: refusing installer executable outside trusted installer roots: {}\",\n            executable.display()\n        );\n    }\n    file::make_executable(&executable)?;\n    let prefix = prefix::prefix();\n    let mut paths = vec![prefix.join(\"bin\"), prefix.join(\"sbin\")];\n    if let Some(path) = std::env::var_os(\"PATH\") {\n        paths.extend(std::env::split_paths(&path));\n    }\n    let path = std::env::join_paths(paths)?;","sourceCodeStart":2370,"sourceCodeEnd":2406,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/brew/cask/mod.rs#L2370-L2406","documentation":"mise's brew-cask backend refuses to run a cask installer when the resolved installer executable does not exist on disk as a regular file. The backend resolves the executable path from the cask's staged installer stanza and validates it before invoking it, so a missing or non-file path (directory, broken symlink, absent artifact) aborts installation instead of spawning a failing command. This protects against casks whose staged layout does not match what the cask formula declares.","triggerScenarios":"Installing a cask whose installer stanza points to an executable that was never staged (bad cask formula), the staged artifact was pruned or partially extracted, the executable path resolves to a directory or dangling symlink, or the install ran with a changed staging directory/version mismatch so the expected binary is absent.","commonSituations":"Homebrew cask updates where the upstream project renamed its installer binary; interrupted or partial downloads; running mise against a cask whose staged files were manually cleaned from ~/Library/Caches or the brew cache; macOS version changes altering bundle layout.","solutions":["Re-run the cask install with a clean staging area so the artifact is re-downloaded and fully extracted (e.g. remove the cached download and reinstall the cask).","Verify the executable path in the cask formula actually exists in the staged bundle and is a regular file.","Check for a broken symlink at the expected path and repair the source of that link.","Update the cask/mise backend definitions, then retry; if the cask upstream changed its installer name, the formula must be updated.","Ensure the filesystem hosting the staging directory is mounted and writable (not an unmounted or read-only volume)."],"exampleFix":"// before (formula references old name)\ninstaller { script: { executable: \"OldInstaller.app/Contents/MacOS/OldInstaller\" } }\n// after\ninstaller { script: { executable: \"NewInstaller.app/Contents/MacOS/NewInstaller\" } }","handlingStrategy":"validation","validationCode":"let exe = std::path::Path::new(&installer.executable);\nif !exe.is_file() {\n    eprintln!(\"installer executable missing: {}\", exe.display());\n    std::process::exit(1);\n}","typeGuard":"fn is_regular_file(p: &std::path::Path) -> bool {\n    p.is_file()\n}","tryCatchPattern":null,"preventionTips":["Always install casks through mise so staging completes before the installer runs.","Clear the brew cask cache if a prior install was interrupted, then reinstall.","Keep cask definitions updated when upstream renames installer binaries.","Avoid pruning or hand-editing staging/caskroom directories."],"tags":["brew-cask","macos","file-not-found","installer"],"backgroundTag":"file-not-found","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}