{"record":{"id":"2d38e73146e93236","repo":"jdx/mise","slug":"font-target-is-outside-the-platform-font-directory","errorCode":null,"errorMessage":"font target is outside the platform font directory: {}","messagePattern":"font target is outside the platform font directory: (.+?)","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask.rs","lineNumber":7083,"sourceCode":"        {\n            bail!(\n                \"binary target is not an owned Caskroom symlink: {}\",\n                path.display()\n            );\n        }\n    }\n    for path in &receipt.fonts {\n        let record = records\n            .get(path)\n            .ok_or_else(|| eyre!(\"missing font target record\"))?;\n        let fonts = font_dir();\n        if record.fingerprint.kind != CaskTargetKind::File\n            || !path_is_below(path, &fonts)\n            || !path.strip_prefix(&fonts).is_ok_and(|relative| {\n                staged_target_matches(record, &candidate.version_dir.join(relative))\n            })\n        {\n            bail!(\n                \"font target is outside the platform font directory: {}\",\n                path.display()\n            );\n        }\n    }\n    let completion_roots = [\n        CompletionShell::Bash,\n        CompletionShell::Fish,\n        CompletionShell::Zsh,\n        CompletionShell::Pwsh,\n    ]\n    .map(default_completion_dir);\n    for path in &receipt.completions {\n        let record = records\n            .get(path)\n            .ok_or_else(|| eyre!(\"missing completion target record\"))?;\n        if record.fingerprint.kind != CaskTargetKind::Symlink\n            || !completion_roots","sourceCodeStart":7065,"sourceCodeEnd":7101,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/system/packages/brew/cask.rs#L7065-L7101","documentation":"Font targets must be regular files beneath the platform font directory (font_dir(), e.g. ~/Library/Fonts on macOS) whose staged counterpart at version_dir/<relative-path> fingerprints identically. Fonts outside that directory, wrong file types, or mismatched staged copies block pruning of the cask.","triggerScenarios":"validate_cask_prune_candidate, fonts loop: fingerprint kind != File, path not below font_dir(), or staged_target_matches fails for version_dir.join(relative). Caused by moving/renaming installed fonts, deleting the staged copy in Caskroom, or font-manager tools rewriting files (hash changes surface as mismatch).","commonSituations":"User reorganized fonts into /Library/Fonts or a font-manager vault; staged Caskroom copy purged; font activated/copied by tools like Font Book altering the original.","solutions":["Move the font file back under the platform font directory at its original relative path","Restore or reinstall the cask so Caskroom/<token>/<version>/<font-path> exists and hashes identically","If the font was intentionally relocated, remove it manually and uninstall the cask rather than pruning"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Confirm font targets remain regular files under the platform font dir\n// with an intact staged copy before pruning.\nfn font_ok(record_path: &Path, version_dir: &Path, fingerprint: &CaskTargetFingerprint) -> bool {\n    let fonts = font_dir();\n    path_is_below(record_path, &fonts)\n        && record_path.strip_prefix(&fonts).is_ok_and(|rel| {\n            staged_target_matches_fingerprint(&version_dir.join(rel), fingerprint)\n        })\n}","typeGuard":"fn font_in_font_dir(path: &Path) -> bool {\n    path_is_below(path, &font_dir())\n        && path.symlink_metadata().map(|m| m.is_file()).unwrap_or(false)\n}","tryCatchPattern":"// Same skip-not-abort pattern: one bad font skips only its cask.\nif let Err(reason) = validate_cask_prune_candidate(candidate) {\n    plan.skipped.push(CaskPruneSkip { token: candidate.token, reason: format!(\"{reason:#}\") });\n    continue;\n}","preventionTips":["Leave installed fonts at their original path under the platform font directory","Avoid font managers that copy/move cask-installed fonts out of place","Reinstall the cask to restore both the font and its staged Caskroom copy"],"tags":["brew","cask","prune","fonts","macos","path-allowlist"],"backgroundTag":"path-allowlist-violation","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}