{"record":{"id":"637108ba1b653a7b","repo":"jdx/mise","slug":"task-dependencies-are-supported-only-in-depends","errorCode":null,"errorMessage":"^task dependencies are supported only in depends","messagePattern":"\\^task dependencies are supported only in depends","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/mod.rs","lineNumber":1761,"sourceCode":"    }\n\n    /// Expands `^task` dependencies to the matching task in every upstream workspace project.\n    ///\n    /// Each expanded dependency is optional because not every project in the dependency closure\n    /// needs to implement the requested task. The workspace graph traversal still continues\n    /// through those projects so matching tasks farther upstream are retained.\n    pub(crate) fn resolve_workspace_task_dependencies(\n        &mut self,\n        graph: &workspace::WorkspaceProjectGraph,\n        project_ids_by_root: &BTreeMap<PathBuf, BTreeSet<workspace::ProjectId>>,\n    ) -> Result<()> {\n        if self\n            .depends_post\n            .iter()\n            .chain(&self.wait_for)\n            .any(|dep| dep.task.starts_with('^'))\n        {\n            bail!(\"^task dependencies are supported only in depends\");\n        }\n        if !self.depends.iter().any(|dep| dep.task.starts_with('^')) {\n            return Ok(());\n        }\n\n        let mut project_ids = BTreeSet::new();\n        let stable_task_names = once(self.name.as_str())\n            .chain(self.aliases.iter().map(String::as_str))\n            .filter(|name| is_workspace_project_task(name))\n            .collect_vec();\n\n        for name in stable_task_names {\n            let (project_id, _) = name\n                .split_once('#')\n                .expect(\"workspace project task contains #\");\n            if let Ok(project_id) = project_id.parse::<workspace::ProjectId>()\n                && graph.get(&project_id).is_some()\n            {","sourceCodeStart":1743,"sourceCodeEnd":1779,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/task/mod.rs#L1743-L1779","documentation":"mise's '^task' syntax means \"the same-named task in every upstream workspace project\" and is only supported in the depends list. resolve_workspace_task_dependencies rejects the configuration outright if any entry of depends_post or wait_for starts with '^', because post-dependencies and wait-for have no meaningful upstream expansion semantics.","triggerScenarios":"Declaring wait_for = [\"^lint\"] or depends_post = [\"^publish\"] on any task; the check runs over both lists chained together as soon as workspace task dependency resolution executes (which happens whenever workspace-aware task config is loaded).","commonSituations":"Copying a depends entry into wait_for expecting the same caret behavior; upgrading mise and consolidating depends into depends_post/wait_for for ordering reasons; authoring a publish flow that wants upstream post-steps.","solutions":["Move the '^' entry from depends_post/wait_for into depends","If you only want the local post-step, drop the caret: depends_post = [\"publish\"]","If you want the upstream task, expand it explicitly: depends = [\"//libs/core:publish\"]"],"exampleFix":"# before\n[tasks.release]\ndepends_post = [\"^publish\"]\nwait_for = [\"^lint\"]\n\n# after\n[tasks.release]\ndepends = [\"^publish\"]\nwait_for = [\"lint\"]","handlingStrategy":"validation","validationCode":"# fail if '^' appears anywhere but depends\npython3 - <<'EOF'\nimport tomllib, sys\ncfg = tomllib.load(open('mise.toml','rb'))\nfor name, t in cfg.get('tasks', {}).items():\n    for field in ('depends_post', 'wait_for'):\n        bad = [d for d in t.get(field, []) if str(d).startswith('^')]\n        if bad: sys.exit(f\"{name}: '^' not allowed in {field}: {bad}\")\nprint('ok')\nEOF","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember the caret prefix is depends-only by design","Add a config lint step to CI for task files"],"tags":["mise","tasks","dependencies","configuration"],"backgroundTag":"invalid-task-dependency-syntax","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}