{"record":{"id":"9fc69b834ebd2c96","repo":"jdx/mise","slug":"rustc-produced-no-cacheable-outputs","errorCode":null,"errorMessage":"rustc produced no cacheable outputs","messagePattern":"rustc produced no cacheable outputs","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"warning","filePath":"src/cache/rustc.rs","lineNumber":752,"sourceCode":"    if executable.is_absolute() {\n        return Ok(executable);\n    }\n    which::which(&executable).wrap_err_with(|| {\n        format!(\n            \"failed to resolve compiler executable {}\",\n            executable.display()\n        )\n    })\n}\n\nfn publish_result(\n    action: &CacheDigest,\n    action_bytes: &[u8],\n    outputs: &[PathBuf],\n    output: &Output,\n) -> Result<()> {\n    if outputs.is_empty() {\n        bail!(\"rustc produced no cacheable outputs\");\n    }\n    let staging = staging_directory()?;\n    let mut blobs = vec![staged_bytes(staging.path(), \"action.json\", action_bytes)?];\n    let stdout = staged_bytes(staging.path(), \"stdout\", &output.stdout)?;\n    let stderr = staged_bytes(staging.path(), \"stderr\", &output.stderr)?;\n    blobs.extend([stdout.clone(), stderr.clone()]);\n\n    let mut files = Vec::with_capacity(outputs.len());\n    for path in outputs {\n        let metadata = std::fs::metadata(path)\n            .wrap_err_with(|| format!(\"failed to inspect rustc output {}\", path.display()))?;\n        if !metadata.is_file() {\n            bail!(\"rustc output is not a regular file: {}\", path.display());\n        }\n        let digest = CacheDigest::blake3_file(path)?;\n        blobs.push((digest.clone(), path.clone()));\n        files.push(CacheFileNode {\n            digest,","sourceCodeStart":734,"sourceCodeEnd":770,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/cache/rustc.rs#L734-L770","documentation":"publish_result() refuses to store an action with an empty outputs list (src/cache/rustc.rs:751-753): with nothing to restore, publishing stdout/stderr alone would be pointless. In the normal flow the caller passes emitted files plus the dep-info file (src/cache/rustc.rs:105-107), so this fires only for invocations that produced no expected artifacts at all. Publication errors are caught by compile() and downgraded to 'mise rustc cache warning: result was not stored' (src/cache/rustc.rs:111-113).","triggerScenarios":"A successful rustc invocation reaching the publish path with an empty parsed output set: type-check-only or probing invocations with no -o/--emit artifacts, or a regression in RustcInvocation::outputs parsing that yields no files.","commonSituations":"Rare defensive guard; direct rustc calls with no emitted artifacts; tooling that wraps rustc for metadata-only queries inside a cached task.","solutions":["Ignore it: the build still succeeds, only this invocation is not cached","If it spams output for a task that never has artifacts, disable the rust cache for that task","If normal cargo builds hit it, capture the rustc command line and report it — outputs parsing should have found the dep-info file"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"Treat publication as best-effort exactly as compile() does: `if let Err(error) = publication { eprintln!(\"mise rustc cache warning: result was not stored: {error:#}\"); }` — the compile result is already on disk and must be returned regardless.","preventionTips":["Expect metadata-only invocations to be uncached; filter them into tasks with the rust cache disabled","Do not build tooling that depends on every rustc invocation being cached"],"tags":["rust","cache","outputs","publish"],"backgroundTag":"no-cacheable-outputs","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}