{"record":{"id":"ead3203251271717","repo":"jdx/mise","slug":"brew-cask-structured-move-source-was-not-fou-ead320","errorCode":null,"errorMessage":"brew-cask: structured move source '{}' was not found","messagePattern":"brew-cask: structured move source '(.+?)' was not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/flight.rs","lineNumber":986,"sourceCode":"        FlightSudo::Never => file::create_dir_all(target),\n        FlightSudo::IfNeeded => create_dir_all_elevating(target),\n        FlightSudo::Always => sudo::run(\n            \"/bin/mkdir\",\n            &[\"-p\".into(), \"--\".into(), target.display().to_string()],\n            &[],\n        ),\n    }\n}\n\npub(super) fn flight_sources(\n    staged_path: &Path,\n    source: &FlightPath,\n    source_glob: bool,\n) -> Result<Vec<PathBuf>> {\n    if !source_glob {\n        let source = resolve_flight_path(staged_path, source)?;\n        if !source.exists() {\n            bail!(\n                \"brew-cask: structured move source '{}' was not found\",\n                source.display()\n            );\n        }\n        return Ok(vec![source]);\n    }\n    // Homebrew marks move sources as globs explicitly; non-glob move sources\n    // may contain literal glob-like characters and should be resolved literally.\n    let sources = expand_staged_glob(staged_path, &source.path)?;\n    if sources.is_empty() {\n        bail!(\n            \"brew-cask: structured move source '{}' was not found\",\n            source.path\n        );\n    }\n    Ok(sources)\n}\n","sourceCodeStart":968,"sourceCodeEnd":1004,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/brew/cask/flight.rs#L968-L1004","documentation":"During a cask's structured flight (post-install artifact moves), a non-glob move source declared in the cask's stanza is resolved against the staged path and checked for existence. Homebrew throws this when the resolved file/directory does not exist inside the staging area. It guards `move` steps against missing or misnamed sources before any filesystem mutation.","triggerScenarios":"A cask stanza declares a `staged_path`-based move source whose literal path (after resolving) is absent from the staged install — e.g. the app/binary name changed upstream, a case-mismatch, or the cask authors forgot a directory component.","commonSituations":"Cask DSL authors writing `move` stanzas after an upstream project renamed its .app bundle or binary; users hitting it when a cask is out of sync with a newly released upstream artifact layout.","solutions":["Verify the staged install (e.g. `brew --cache` / the staging dir) and check the actual artifact name","Correct the move source path in the cask stanza to match the staged layout","Add glob characters only if intentional variability is needed, and set source_glob accordingly","Re-run brew install after fixing the cask"],"exampleFix":"// before\nmove \"/Applications/OldName.app\", \"/Applications\"\n// after\nmove staged_path.join(\"AppName.app\"), \"/Applications\"  // match actual staged name","handlingStrategy":"validation","validationCode":"let src = staged_path.join(rel_source);\nif !src.exists() {\n    return Err(format!(\"staged move source missing: {}\", src.display()));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify cask stanza paths against actual staged layout for each release","Run `brew audit` on casks before publishing","Prefer globs only when artifact names genuinely vary","Check upstream release notes for artifact renames"],"tags":["brew","cask","file-not-found","packaging"],"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"}