{"record":{"id":"9095f10b4a24c037","repo":"jdx/mise","slug":"brew-cask-font-artifact-was-not-staged-9095f1","errorCode":null,"errorMessage":"brew-cask: font artifact '{}' was not staged","messagePattern":"brew-cask: font artifact '(.+?)' was not staged","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/mod.rs","lineNumber":2485,"sourceCode":"    sudo::run(\"installer\", &args, &[])\n}\n\nfn stage_font(stage: &Path, caskroom: &Path, font: &FontArtifact) -> Result<()> {\n    let caskroom_font = caskroom_font_path(caskroom, font)?;\n    file::remove_all(&caskroom_font)?;\n    if let Some(parent) = caskroom_font.parent() {\n        file::create_dir_all(parent)?;\n    }\n    let source = find_file_artifact(stage, &font.source)\n        .ok_or_else(|| eyre!(\"brew-cask: font artifact '{}' was not found\", font.source))?;\n    copy_cask_artifact(&source, &caskroom_font)?;\n    Ok(())\n}\n\nfn link_font(caskroom: &Path, font: &FontArtifact) -> Result<()> {\n    let caskroom_font = caskroom_font_path(caskroom, font)?;\n    if !caskroom_font.is_file() {\n        bail!(\"brew-cask: font artifact '{}' was not staged\", font.source);\n    }\n    let target = font_target_path(font)?;\n    if let Some(parent) = target.parent() {\n        file::create_dir_all(parent)?;\n    }\n    // Atomic swap: rename existing font aside before copying the new one so\n    // that a failure during copy leaves the old font intact.\n    let old_target = target.with_extension(format!(\n        \"mise-old-{}\",\n        crate::hash::hash_to_str(&target.display().to_string())\n    ));\n    file::remove_all(&old_target)?;\n    if target.exists() {\n        file::rename(&target, &old_target)?;\n    }\n    if let Err(e) = copy_cask_artifact(&caskroom_font, &target) {\n        if old_target.exists() {\n            let _ = file::rename(&old_target, &target);","sourceCodeStart":2467,"sourceCodeEnd":2503,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/brew/cask/mod.rs#L2467-L2503","documentation":"After staging a cask's payload, mise links declared font artifacts from the caskroom into the user's font directory. Before linking, it verifies the staged font file actually exists at the expected caskroom path; this error is thrown when the font artifact named in the cask definition was not found in the staged output.","triggerScenarios":"`link_font` calls `caskroom_font_path(caskroom, font)` and `!caskroom_font.is_file()` — the cask declared a `font` stanza whose staged file is missing, was renamed upstream, or staging partially failed.","commonSituations":"A cask definition references a font file whose upstream URL/name changed; a partial or failed stage left the caskroom incomplete; the cask's artifact list drifted from what the installer actually downloaded.","solutions":["Re-run the cask install so staging completes fully before linking","Check the cask definition's font source path against what was actually staged (list the caskroom contents)","Update mise / the cask definition if the upstream font was renamed","Report the cask as broken upstream if the artifact name no longer matches"],"exampleFix":"// before: stale staged font from failed install\nrm -rf <caskroom-dir> && mise install <cask>\n// after: fresh stage then link succeeds","handlingStrategy":"validation","validationCode":"test -f <caskroom>/<cask>/<font-source> || echo \"font artifact missing from stage\"","typeGuard":null,"tryCatchPattern":"match result {\n  Err(e) if e.contains(\"font artifact\") && e.contains(\"was not staged\") => {\n    eprintln!(\"staged font missing; reinstall cask to restage: {e}\");\n  }\n  Err(e) => return Err(e),\n  Ok(v) => v,\n}","preventionTips":["Let installs complete fully before interrupting","After upstream updates, verify the cask's font stanza still matches the released payload","Only use casks from sources that keep artifact names stable"],"tags":["brew-cask","fonts","staging","file-not-found"],"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"}