jdx/mise · error
task cache outputs must not contain source
Error message
task {} cache outputs must not contain source {} What it means
For cacheable tasks, mise validates that no cache output directory overlaps (equals or is a parent path of) any declared source input path. Outputs containing sources would make cache hits skip rebuilding files that should be tracked as inputs, so the config is rejected before caching proceeds.
Solutions
- Remove the overlapping source path from `sources`, or shrink `outputs` so it doesn't contain the source
- Move generated files to a directory separate from declared sources (e.g. outputs=["gen"], sources=["src"])
- Re-run the task after adjusting the config to confirm caching works
Example fix
// before [tasks.gen] sources = ["src", "dist"] outputs = ["dist"] // after [tasks.gen] sources = ["src"] outputs = ["dist"]
Defensive patterns
Strategy: validation
Validate before calling
# fail fast if any source path sits inside an output path grep -n "sources\|outputs" mise.toml | head -20 # then eyeball for nested overlaps
Prevention
- Keep source and output directories disjoint by convention (src/ vs dist/)
- Never declare a generated subdirectory as a source if its parent is an output
- Review task cache config whenever you change output directory layouts
When it happens
Trigger: Declaring a task whose `outputs` include a directory that is also listed in `sources` (or an ancestor of one), e.g. outputs=["dist"] with sources=["dist/generated"] or sources=["src", "dist"].
Common situations: Generated-code setups where generated files live under the same directory declared as an output while sources point into it; mis-typed paths making outputs accidentally enclose sources.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- ^task dependencies are supported only in depends
- action prediction payload is too large
- agent ' ' `start_calendar_interval. ` must be between and
- agent ' ' `start_calendar_interval` must set at least one…
- agent ' ' `start_calendar_interval` must not be empty
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/8bfe6b5aef3463d2.
Report an issue: GitHub.
Appendix: source
Thrown at src/task/task_cache.rs:280
) -> Result<Option<TaskArtifactCacheBuilder>> {
Settings::get().ensure_experimental("task artifact caching")?;
let root = task_cwd(task, config).await?;
validate_config(task, &root)?;
let output_roots = resolve_output_roots(task, &root, false)?;
for output in &output_roots {
ensure_no_symlink_ancestors(&root, output)?;
}
let Some(inputs) = task_cache_inputs(task, config, !dry_run).await? else {
warn!(
"task {} has sources defined but no matching files found; artifact caching disabled",
task.name
);
return Ok(None);
};
for source in &inputs.source_paths {
if output_roots
.iter()
.any(|output| source == output || source.starts_with(output))
{
bail!(
"task {} cache outputs must not contain source {}",
task.name,
source.display()
);
}
}
Ok(Some(TaskArtifactCacheBuilder {
root,
inputs,
output_roots,
}))
}
}
impl TaskArtifactCacheBuilder {
/// Finishes cache-key construction after task tools, environment, andView on GitHub (pinned to 533346cc37)