{"record":{"id":"a7a6c7e0acca7bad","repo":"jdx/mise","slug":"brew-cask-command-wrapper-was-not-staged","errorCode":null,"errorMessage":"brew-cask: command wrapper '{}' was not staged","messagePattern":"brew-cask: command wrapper '(.+?)' was not staged","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask.rs","lineNumber":4899,"sourceCode":"            );\n        }\n        bail!(\n            \"brew-cask: binary artifact '{}' was not staged\",\n            binary.source\n        );\n    }\n    let target = binary.target_path(appdir)?;\n    if let Some(parent) = target.parent() {\n        create_dir_all_elevating(parent)?;\n    }\n    make_symlink_elevating(&caskroom_binary, &target)?;\n    Ok(())\n}\n\nfn link_command_wrapper(caskroom: &Path, wrapper: &CommandWrapperArtifact) -> Result<()> {\n    let source = wrapper.caskroom_path(caskroom);\n    if !source.is_file() {\n        bail!(\n            \"brew-cask: command wrapper '{}' was not staged\",\n            wrapper.name\n        );\n    }\n    let target = wrapper.target_path()?;\n    if let Some(parent) = target.parent() {\n        create_dir_all_elevating(parent)?;\n    }\n    make_symlink_elevating(&source, &target)?;\n    Ok(())\n}\n\nfn caskroom_binary_path(\n    caskroom: &Path,\n    appdir: &Path,\n    binary: &BinaryArtifact,\n) -> Result<PathBuf> {\n    let target = binary.target_path(appdir)?;","sourceCodeStart":4881,"sourceCodeEnd":4917,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/system/packages/brew/cask.rs#L4881-L4917","documentation":"link_command_wrapper symlinks a staged command wrapper (a small script mise generated into the caskroom from 'content' or 'executable') into the target bin directory. Before linking it checks the staged file exists; if wrapper.caskroom_path(caskroom) is not a file, staging never wrote the wrapper and mise bails with the wrapper's name.","triggerScenarios":"The command_wrapper artifact was parsed but never staged — e.g. an earlier staging step failed partway and the install continued, the wrapper's caskroom path computation disagrees with the writer (name mismatch), or a code path skips writer execution for the artifact.","commonSituations":"Interrupted installs leaving partial caskroom state; mismatch between the wrapper name used at write time and at link time; custom cask metadata where the wrapper name contains characters that get sanitized differently in each path computation.","solutions":["Uninstall the cask and install again so all staging steps rerun from a clean caskroom.","Verify the staged caskroom contains a file named after the wrapper; if not, find why staging skipped it (check earlier errors in the same install run).","Ensure the wrapper name in the cask stanza is a plain name without path components (see error 755) so writer and linker agree on the path."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if ! wrapper.caskroom_path(&caskroom).is_file() {\n    return Err(eyre!(\"staging incomplete for '{}'; re-run install\", wrapper.name));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never resume a half-finished install; uninstall then reinstall to restage atomically.","Keep wrapper names plain so writer and linker compute the same path.","Check earlier errors in the same install run — staging failures cascade into link failures."],"tags":["brew-cask","command-wrapper","staging","file-not-found","mise"],"backgroundTag":"file-not-found","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}