{"record":{"id":"f00c77c4fd00f98b","repo":"jdx/mise","slug":"brew-cask-binary-artifact-was-not-staged","errorCode":null,"errorMessage":"brew-cask: binary artifact '{}' was not staged","messagePattern":"brew-cask: binary artifact '(.+?)' was not staged","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask.rs","lineNumber":4883,"sourceCode":"    }\n    target_app_dir()\n}\n\nfn link_binary(caskroom: &Path, appdir: &Path, binary: &BinaryArtifact) -> Result<()> {\n    let caskroom_binary = caskroom_binary_path(caskroom, appdir, binary)?;\n    if !caskroom_binary.is_file() {\n        if caskroom_binary\n            .symlink_metadata()\n            .is_ok_and(|metadata| metadata.file_type().is_symlink())\n        {\n            let target = std::fs::read_link(&caskroom_binary)?;\n            bail!(\n                \"brew-cask: binary artifact '{}' was staged but symlink target '{}' does not exist\",\n                binary.source,\n                target.display()\n            );\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","sourceCodeStart":4865,"sourceCodeEnd":4901,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/system/packages/brew/cask.rs#L4865-L4901","documentation":"link_binary requires the staged copy of a cask binary artifact to exist at caskroom_binary_path before it can symlink the binary into the target bin directory. If that path is neither a regular file nor a symlink, staging never produced it and mise refuses to create a link to nothing. It is the missing-file counterpart of the dangling-symlink error above.","triggerScenarios":"The cask's binary stanza source glob/path matched nothing in the extracted payload: upstream changed the app's internal layout (moved the CLI, renamed Contents/MacOS), the stanza was written for a different version, or the staging step filtered/skipped the file. Checked via `!caskroom_binary.is_file()` at src/system/packages/brew/cask.rs:4883.","commonSituations":"A new app version restructures its .app bundle so the old binary path no longer exists; cask metadata lagging behind a release; stanza globs that silently matched zero files; payload extraction that skipped an oddly-named executable.","solutions":["Verify what actually shipped: list the staged payload (e.g. `find <caskroom> -type f -perm +111`) and locate where the CLI now lives.","Update the binary stanza source to the new path in the current version's payload.","If the app genuinely no longer ships a CLI, remove the binary stanza from the cask metadata.","Reinstall the cask to rule out a truncated download/staging failure."],"exampleFix":"# before — old layout\n\"binary\": [\"MyApp.app/Contents/MacOS/myapp\"]\n\n# after — new layout after upstream moved the CLI\n\"binary\": [\"MyApp.app/Contents/Resources/app/bin/myapp\"]","handlingStrategy":"validation","validationCode":"# verify each stanza source exists in the payload before install\nfor src in \"$(jq -r '.binaries[].source' meta.json)\"; do\n  find \"<extracted-payload>\" -path \"*$src\" -print -quit | grep -q . || echo \"missing source: $src\"\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Re-validate binary stanza sources against the payload on every upstream version bump.","Pin cask versions whose layout you have verified.","In bulk install scripts, catch per-cask failures and continue with the rest."],"tags":["brew-cask","binary-artifact","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-14T00:17:10.932Z"}