{"record":{"id":"9fbfd6f83aa67901","repo":"jdx/mise","slug":"brew-cask-structured-move-source-was-not-fou","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.rs","lineNumber":3895,"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\nfn 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":3877,"sourceCodeEnd":3913,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/system/packages/brew/cask.rs#L3877-L3913","documentation":"A non-glob `move` step's source, resolved literally against the staged path, does not exist. Move sources without `source_glob` are resolved as-is (they may legitimately contain glob-like characters as literal file-name characters), so the exact named file must be present in the staged payload.","triggerScenarios":"`move` without `source_glob` referencing a file that was never extracted into the staged directory; a source whose name literally contains `*`, `?` or `[` that the author actually intended as a wildcard (which requires the flag).","commonSituations":"Upstream renamed the moved file between versions; the author wrote a wildcard assuming glob semantics; case mismatch between the stanza and the archive.","solutions":["Check the exact file name inside the staged caskroom directory and fix the `source` string","Set `source_glob: true` on the move step if the name was intended as a wildcard","Re-stage the payload (fresh download) to rule out partial extraction"],"exampleFix":"# before - wildcard characters are literal without the flag\nmove(source: \"lib/*.dylib\", target: \"#{staged}/lib\")\n# after\nmove(source: \"lib/*.dylib\", target: \"#{staged}/lib\", source_glob: true)","handlingStrategy":"validation","validationCode":"// Literal (non-glob) move sources must exist exactly as written\nlet source = resolve_flight_path(staged_path, &step.source)?;\nif !source.exists() {\n    return Err(eyre!(\"move source '{}' not in staged payload; check spelling or set source_glob\", source.display()));\n}","typeGuard":null,"tryCatchPattern":"if err.to_string().contains(\"move source\") && err.to_string().contains(\"was not found\") {\n    // decide literal-typo vs intended-wildcard, then fix or set source_glob: true\n}","preventionTips":["Remember move sources are literal unless `source_glob: true` is set","Quote names containing glob metacharacters correctly in stanzas","Validate against the staged listing when a move step fails"],"tags":["brew-cask","file-move","missing-file","install-artifact"],"backgroundTag":"source-file-not-found","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}