{"record":{"id":"dd416b28198541f3","repo":"jdx/mise","slug":"cached-rustc-output-directory-has-unsupported-entr","errorCode":null,"errorMessage":"cached rustc output directory has unsupported entries","messagePattern":"cached rustc output directory has unsupported entries","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/cache/rustc.rs","lineNumber":540,"sourceCode":"    Ok(value)\n}\n\nfn read_verified_blob(path: &Path, digest: &CacheDigest, description: &str) -> Result<Vec<u8>> {\n    let mut bytes = Vec::new();\n    std::fs::File::open(path)?.read_to_end(&mut bytes)?;\n    if !digest.matches_bytes(&bytes)? {\n        bail!(\"cached {description} failed digest verification\");\n    }\n    Ok(bytes)\n}\n\nfn validated_outputs(\n    directory: CacheDirectory,\n    outputs: &RustcOutputs,\n) -> Result<Vec<(CacheFileNode, PathBuf)>> {\n    if directory.version != 1 || !directory.directories.is_empty() || !directory.symlinks.is_empty()\n    {\n        bail!(\"cached rustc output directory has unsupported entries\");\n    }\n    let mut expected = outputs\n        .files\n        .iter()\n        .chain(std::iter::once(&outputs.dep_info))\n        .map(|path| {\n            let name = path\n                .file_name()\n                .and_then(|name| name.to_str())\n                .ok_or_else(|| eyre::eyre!(\"expected rustc output name is not UTF-8\"))?;\n            if path.parent() != Some(outputs.directory.as_path()) {\n                bail!(\"expected rustc output escapes its output directory\");\n            }\n            Ok((name.to_string(), path.clone()))\n        })\n        .collect::<Result<BTreeMap<_, _>>>()?;\n    if directory.files.len() != expected.len() {\n        bail!(\"cached rustc output set does not match the invocation\");","sourceCodeStart":522,"sourceCodeEnd":558,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/cache/rustc.rs#L522-L558","documentation":"validated_outputs() only accepts flat, version-1 output directories: directory.version must equal 1 and the directories/symlinks lists must be empty (src/cache/rustc.rs:538-541). The rustc adapter caches plain files only, so an entry using a newer format version or containing nested directories/symlinks cannot be safely restored and is rejected. This guard exists to stop a future-format entry from being interpreted with today's semantics.","triggerScenarios":"Restoring an action whose CacheDirectory was written by a newer mise that bumped the version field or started storing directories/symlinks; a remote namespace shared across mise versions where a newer client populated entries your version cannot read.","commonSituations":"Downgrading mise after a newer version already populated the cache; CI caches written by a refreshed image while an older local mise reads them; mixed-version contributor bases on one shared remote cache.","solutions":["Upgrade mise to at least the version that wrote the cache entries","Or purge the cache/namespace so unreadable entries disappear and repopulate with the current version","Use per-mise-version remote namespaces so format changes never mix (namespace = 'ci-2026-1')"],"exampleFix":"# before: one namespace shared across mise versions\n[settings]\ntask.cache.remote_namespace = 'ci'\n# after: namespace pinned to the writer's mise version\n[settings]\ntask.cache.remote_namespace = 'ci-2026-1'","handlingStrategy":"fallback","validationCode":"fn supported_cache_directory(d: &CacheDirectory) -> bool {\n    d.version == 1 && d.directories.is_empty() && d.symlinks.is_empty()\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin remote namespace strings to the mise version that writes them","Upgrade all clients reading a shared cache to at least the writer's version","Purge caches after downgrades instead of reading newer-format entries"],"tags":["rust","cache","versioning","schema","remote-cache"],"backgroundTag":"cache-format-version-unsupported","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}