{"record":{"id":"fc92df665a07e316","repo":"jdx/mise","slug":"brew-cask-completion-artifact-was-not-staged-fc92df","errorCode":null,"errorMessage":"brew-cask: completion artifact '{}' was not staged","messagePattern":"brew-cask: completion artifact '(.+?)' was not staged","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/mod.rs","lineNumber":2666,"sourceCode":"        let caskroom_completion = caskroom_completion_path(caskroom, &target)?;\n        if let Some(parent) = caskroom_completion.parent() {\n            file::create_dir_all(parent)?;\n        }\n        let output = generate_completion_output(&executable, completion, *shell)?;\n        crate::file::write(caskroom_completion, output)?;\n    }\n    Ok(())\n}\n\nfn link_completion(\n    cask: &Cask,\n    artifacts: &CaskArtifacts,\n    caskroom: &Path,\n    target: &Path,\n) -> Result<()> {\n    let caskroom_completion = caskroom_completion_path(caskroom, target)?;\n    if !caskroom_completion.is_file() {\n        bail!(\n            \"brew-cask: completion artifact '{}' was not staged\",\n            target.display()\n        );\n    }\n    if let Some(parent) = target.parent() {\n        create_dir_all_elevating(parent)?;\n    }\n    ensure_completion_target_replaceable(cask, artifacts, target)?;\n    make_symlink_elevating(&caskroom_completion, target)?;\n    Ok(())\n}\n\nfn ensure_completion_target_replaceable(\n    cask: &Cask,\n    artifacts: &CaskArtifacts,\n    target: &Path,\n) -> Result<()> {\n    let Ok(metadata) = target.symlink_metadata() else {","sourceCodeStart":2648,"sourceCodeEnd":2684,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/brew/cask/mod.rs#L2648-L2684","documentation":"mise links shell-completion artifacts from a staged cask into the user's completion directories. Before linking, it checks the staged completion file exists at the expected caskroom path; this error is thrown when the completion artifact the cask declared was not present in the staged output.","triggerScenarios":"The linking routine resolves `caskroom_completion_path(caskroom, target)` and finds `!caskroom_completion.is_file()` — the cask's completion stanza points at a file that staging did not produce or that was removed.","commonSituations":"Upstream renamed its generated completion file so the cask's declared source no longer exists; an interrupted install left an incomplete stage; the completion lives inside an app bundle that failed to stage.","solutions":["Re-run the cask install to ensure staging completed","Inspect the caskroom directory to see which completions were actually staged and compare with the cask definition","Update mise or the cask so the completion source path matches the upstream layout","Skip/disable the completion artifact if the cask no longer ships one"],"exampleFix":"// before: stale caskroom from failed install\nrm -rf <caskroom-dir> && mise install <cask>\n// after: full stage present, linking succeeds","handlingStrategy":"validation","validationCode":"test -f <caskroom>/<cask>/<completion-source> || echo \"completion artifact missing from stage\"","typeGuard":null,"tryCatchPattern":"match result {\n  Err(e) if e.contains(\"completion artifact\") && e.contains(\"was not staged\") => {\n    eprintln!(\"staged completion missing; reinstall cask or update its completion stanza: {e}\");\n  }\n  Err(e) => return Err(e),\n  Ok(v) => v,\n}","preventionTips":["Verify cask completion stanzas against the upstream release layout after updates","Avoid interrupting installs mid-stage","Keep mise and cask definitions in sync with upstream tool changes"],"tags":["brew-cask","completions","staging","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}