Skip to content

Dependency tasks can run more than once #180850

@markw65

Description

@markw65

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.77.3
  • OS Version: MacOS 13.3.1

Steps to Reproduce:

Execute the following to produce a suitable project:

mkdir -p test/.vscode
cd test
cat <<"EOF" > .vscode/tasks.json
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "D",
      "type": "shell",
      "command": "echo I am D"
    },
    {
      "label": "C",
      "dependsOn": "D",
      "type": "shell",
      "command": "echo I am C"
    },
    {
      "label": "B",
      "dependsOn": "D",
      "type": "shell",
      "command": "echo I am B"
    },
    {
      "label": "A",
      "dependsOn": ["B", "C"],
      "dependsOrder": "sequence",
      "type": "shell",
      "command": "echo I am A",
      "group": {
        "kind": "build",
        "isDefault": true
      }
    }
  ]
}
EOF
code .

Then trust the workspace, and hit Cmd-Shift-B to run task "A".

Both B and C depend on D.

I believe the correct behavior is for D to run, then B, then (since B and C are sequential) C, then A. But in fact, D runs twice.

Assuming D should only run once, I have a simple fix that applies on top of #180617. The fix doesn't apply cleanly to main though, so I'm not sure of the best way to submit a pull request (I could just include it as an extra commit on #180617).

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code InsiderstasksTask system issuesverifiedVerification succeeded

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions