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:
Run the following shell commands to create a project with a suitable set of dependent tasks
mkdir -p test/.vscode
cd test
cat <<"EOF" > .vscode/tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"command": "sleep 2",
"label": "sleeper",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"group": "sleepers",
"close": false
}
},
{
"type": "shell",
"command": "echo task1",
"dependsOn": ["sleeper"],
"label": "task1",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"group": "sleepers",
"close": false
}
},
{
"type": "shell",
"command": "echo task2",
"dependsOn": ["task1"],
"label": "task2",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"group": "sleepers",
"close": false
}
},
{
"type": "shell",
"command": "echo task3",
"dependsOn": ["task1"],
"label": "task3",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"group": "sleepers",
"close": false
}
},
{
"type": "shell",
"command": "echo task4... && sleep 3 && echo ...done",
"dependsOn": ["task2", "task3"],
"label": "task4",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"group": "sleepers",
"close": false
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
EOF
code .
The pattern here is that task4 depends on task3 and task2, task3 and task2 each depend on task1, and task1 depends on sleeper.
Running task4 should launch one copy of sleeper, then one instance of task1, then one instance each of task2 and task3 (in parallel) and finally task4.
Instead it runs sleeper, task1 then task2, then reports there's a dependency cycle involving task1 and stops (the message appears in the output pane, rather than the debug console).
The issue is similar to the one in #180541. task2 launches task1 via _executeDependentTask which calls _executeTask, which returns before adding task1 to _activeTasks because that can't happen until sleeper finishes. Then task3 thinks that task1 isn't running yet (because it's not in _activeTasks) and tries to launch it again; and now it sees the false dependency cycle. What we want is for task3 to attach to the already launched task1.
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
Run the following shell commands to create a project with a suitable set of dependent tasks
The pattern here is that task4 depends on task3 and task2, task3 and task2 each depend on task1, and task1 depends on sleeper.
Running task4 should launch one copy of sleeper, then one instance of task1, then one instance each of task2 and task3 (in parallel) and finally task4.
Instead it runs sleeper, task1 then task2, then reports there's a dependency cycle involving task1 and stops (the message appears in the output pane, rather than the debug console).
The issue is similar to the one in #180541. task2 launches task1 via
_executeDependentTaskwhich calls_executeTask, which returns before adding task1 to _activeTasks because that can't happen untilsleeperfinishes. Then task3 thinks that task1 isn't running yet (because it's not in _activeTasks) and tries to launch it again; and now it sees the false dependency cycle. What we want is for task3 to attach to the already launched task1.