{"record":{"id":"2743fd6051e5d7d9","repo":"jdx/mise","slug":"brew-cask-structured-copy-source-was-not-fou-2743fd","errorCode":null,"errorMessage":"brew-cask: structured copy source '{}' was not found","messagePattern":"brew-cask: structured copy source '(.+?)' was not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/flight.rs","lineNumber":654,"sourceCode":"            }\n        }\n        FlightStep::Copy {\n            source,\n            target,\n            recursive,\n            overwrite,\n            source_glob,\n            guards,\n        } => {\n            if !flight_guards_pass(cask, guards, staged_path, appdir)? {\n                return Ok(());\n            }\n            let sources = flight_symlink_sources(cask, source, *source_glob, staged_path, appdir)?;\n            let [source] = sources.as_slice() else {\n                bail!(\"brew-cask: structured copy source must resolve to exactly one path\");\n            };\n            if !source.exists() {\n                bail!(\n                    \"brew-cask: structured copy source '{}' was not found\",\n                    source.display()\n                );\n            }\n            if source.is_dir() && !recursive {\n                bail!(\"brew-cask: structured directory copy requires recursive=true\");\n            }\n            let target = resolve_flight_path_with_context(cask, target, staged_path, appdir)?;\n            let external = !target.starts_with(staged_path);\n            let target_metadata = target.symlink_metadata().ok();\n            if target_metadata.is_some() {\n                if !overwrite {\n                    bail!(\n                        \"brew-cask: structured copy target '{}' already exists\",\n                        target.display()\n                    );\n                }\n                if external {","sourceCodeStart":636,"sourceCodeEnd":672,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/brew/cask/flight.rs#L636-L672","documentation":"The resolved source path of a brew-cask structured copy step does not exist on disk. The library checks existence after resolving the cask's source path (template-expanded against staged_path/appdir) and refuses to copy a missing artifact.","triggerScenarios":"FlightStep::Copy whose source path (literal or glob result) is absent at execution time: wrong template variable ({{version}}, {{arch}}), file removed by an earlier Remove/Move step, or upstream changed bundled filenames.","commonSituations":"Cask definitions pinning old artifact names after an app restructured its bundle; macOS app bundles renamed between versions; source referencing a path created only under a guard that didn't pass.","solutions":["Check the resolved path exists in the staging directory; fix the source template/path in the cask definition.","Ensure no earlier flight step (Remove/Move) deletes the file before the Copy step runs.","Verify against the currently installed version's staged contents — upstream may have renamed the artifact."],"exampleFix":"// before\nsource: \"bin/legacy-cli\"\n// after (renamed in new version)\nsource: \"bin/new-cli\"","handlingStrategy":"validation","validationCode":"let source = resolve_flight_path_with_context(cask, source, staged_path, appdir)?;\nif !source.exists() {\n    return Err(eyre!(\"copy source missing: {}\", source.display()));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify template variables ({{version}}, {{arch}}) render to real paths in the staged tree.","Order flight steps so sources are not removed before copying.","Re-check the cask definition after upstream app bundle renames."],"tags":["brew-cask","file-not-found","staging"],"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-14T00:17:10.932Z"}