Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The task provider for "C/C++" tasks unexpectedly provided a task of type "shell". #5388

Closed
sarahkittyy opened this issue Apr 30, 2020 · 51 comments · Fixed by #5442
Closed

The task provider for "C/C++" tasks unexpectedly provided a task of type "shell". #5388

sarahkittyy opened this issue Apr 30, 2020 · 51 comments · Fixed by #5442
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. tasks/build/debug An issue relating to tasks.json (e.g. build issues)
Milestone

Comments

@sarahkittyy
Copy link

sarahkittyy commented Apr 30, 2020

VSCode version:

1.45.0-insider
a0fe37870c42e0704a492cdc6b8550b4cf23f63c
x64

vscode-cpptools version: 0.28.0-insiders

Here is my tasks.json.

{
	"version": "2.0.0",
	"tasks": [
		{
			"label": "gen",
			"type": "shell",
			"command": "cmake",
			"args": [
				"-DCMAKE_BUILD_TYPE=DEBUG",
				".."
			],
			"options": {
				"cwd": "build"
			}
		},
		{
			"label": "make",
			"type": "shell",
			"command": "make",
			"args": [
				
			],
			"group": {
				"kind": "test",
				"isDefault": true
			},
			"dependsOn": "gen",
			"options": {
				"cwd": "build"
			}
		},
		{
			"label": "run",
			"type": "shell",
			"command": "./build/infidungeon",
			"args": [
				
			],
			"group": {
				"kind": "build",
				"isDefault": true
			},
			"dependsOn": "make"
		}
	]
}

If I change my code, or otherwise sometimes completely randomly, when I run task run, I get this message:
image
And when I hit, "Show output" I see:

The task provider for "C/C++" tasks unexpectedly provided a task of type "shell".
The task provider for "C/C++" tasks unexpectedly provided a task of type "shell".

Is something wrong with my tasks.json? I can't replicate this consistently? This does not happen when all extensions are disabled.

@taunusflieger
Copy link

taunusflieger commented May 3, 2020

Similar behavior here with ROS

The task provider for "catkin_cmake" tasks unexpectedly provided a task of type "catkin_make".
The task provider for "catkin_cmake_isolated" tasks unexpectedly provided a task of type "catkin_make_isolated".

This is there since one of the last Insider updates. My version

Version: 1.45.0-insider
Commit: ece7aaee861d7261a728d52ce436c667030ce17d
Date: 2020-05-01T09:46:11.716Z
Electron: 7.2.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 5.3.0-51-generic

@dmitrykok
Copy link

reverting to 0.27.1 fix problem

@matteomandelli
Copy link

Same issue for me on macOS

Version: 1.45.0-insider
Commit: fd5d9a30259bb2bebab3e62dfd8315c2e1b27744
Date: 2020-05-04T09:21:17.770Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.4.0

@RiverKy
Copy link

RiverKy commented May 5, 2020

Same issue on macOS.

macOS Catalina 10.15.5
Code Insiders 1.45.0
C/C++ 0.28.0-Insiders

@kunaldas1997
Copy link

kunaldas1997 commented May 5, 2020

facing a similar kind of issue on 0.28 Insiders version as well as 0.27.1 version.

Edit: with all versions.

Version: 1.45.0-insider (user setup)
Commit: d4b8ec9da3bf1061a948fbb1b0d9d3db750cc79f
Date: 2020-05-05T07:13:50.890Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.19041

@ghost
Copy link

ghost commented May 5, 2020

If I run task instead of build task, the issue will not appear.
And when I click "Show All Tasks" under drop-down list of normal run task, it shows again.

@sean-mcmanus sean-mcmanus added bug tasks/build/debug An issue relating to tasks.json (e.g. build issues) investigate: repro This issue's repro steps needs to be investigated/confirmed labels May 6, 2020
@sean-mcmanus sean-mcmanus added this to the 0.28.0 milestone May 6, 2020
@Ryu3tthz
Copy link

Ryu3tthz commented May 6, 2020

Same issue for me,

Version: 1.45.0-insider (system setup)
Commit: d69a79b73808559a91206d73d7717ff5f798f23c
C/C++ 0.28.0-insiders2

but it will not appear on my vscode stable.

Version: 1.44.2 (system setup)
Commit: ff915844119ce9485abfe8aa9076ec76b5300ddd
C/C++ 0.28.0-insiders2

@sean-mcmanus
Copy link
Contributor

@Primimy If the bug occurs on 1.45-insiders but not 1.44.2 (both with 0.28.0-insiders2) then that suggests it's a VS Code bug and not a bug with out C/C++ extension.

@alexr00
Copy link
Member

alexr00 commented May 7, 2020

In this extension's call to registerTaskProvider it registers a C\C++ task provider.

taskProvider = vscode.tasks.registerTaskProvider(taskSourceStr, {
provideTasks: () => getBuildTasks(false),
resolveTask(task: vscode.Task): vscode.Task | undefined {
// Currently cannot implement because VS Code does not call this. Can implement custom output file directory when enabled.
return undefined;
}
});

However, then it provides tasks of type shell not of type C\C++, which is unexpected. It used to work because VS Code was just blindly accepting all tasks. With the recent changes to the task quick pick to make it faster, it can't do that. I added this error message recently so that folks would notice this problem.

The quickest and most correct way for this extension to stop having this error would be to provide tasks of type C\C++. This will fix:

  • The error in this bug
  • Problems with these tasks showing in the "recent" section of the task picker that shows when you Run Task

That said, I'll make a small change to not show the notification in this case. Then, I'll see what can be done about the task not showing in the "recent" section.

@thomastech
Copy link

+1.
After today's VSCode update, everytime I build with Platformio I see the "There are task errors. See the output for details"
After clicking the "Show Output" button it reports: The task provider for "C/C++" tasks unexpectedly provided a task of type "shell".

Version: 1.45.0 (user setup)
Commit: d69a79b73808559a91206d73d7717ff5f798f23c
Date: 2020-05-07T16:18:48.860Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363
  • Thomas

@linbo0518
Copy link

+1, same issue for macOS 10.14.4, after update VSCode to 1.45.0.

Version: 1.45.0
Commit: d69a79b73808559a91206d73d7717ff5f798f23c
Date: 2020-05-07T15:57:33.467Z (14 hrs ago)
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.4.0

@ahomberger
Copy link

+1 Same issue on Windows 10 after update 1.45.0

Version: 1.45.0 (user setup)
Commit: d69a79b73808559a91206d73d7717ff5f798f23c
Date: 2020-05-07T16:18:48.860Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.19041

@yin1999
Copy link

yin1999 commented May 8, 2020

The same problem for me.

version: 1.45.0 (user setup)
commit: d69a79b73808559a91206d73d7717ff5f798f23c
Date: 2020-05-07T16:18:48.860Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363

@aswinkrishna21
Copy link

aswinkrishna21 commented May 8, 2020

+1 Same issue on Windows 10 after the new update

Version: 1.45.0 (user setup)
Commit: d69a79b73808559a91206d73d7717ff5f798f23c
Date: 2020-05-07T16:18:48.860Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18362

@br101
Copy link

br101 commented May 8, 2020

Same here with the meson build extension

@wangenahs
Copy link

+1
image

@sean-mcmanus sean-mcmanus added fixed Check the Milestone for the release in which the fix is or will be available. and removed investigate: repro This issue's repro steps needs to be investigated/confirmed labels May 8, 2020
sean-mcmanus added a commit that referenced this issue May 8, 2020
Change C/C++ taskSourceStr to shell.
Fixes #5388
@sean-mcmanus
Copy link
Contributor

We have a fix with https://github.com/microsoft/vscode-cpptools/releases/tag/0.28.0-insiders3 . We plan to release 0.28.0 on Monday (or maybe Tuesday).

@thomastech
Copy link

Thank you for the quick fix. Installed 0.28.0-insiders3. Issue resolved.

  • Thomas

@sean-mcmanus sean-mcmanus removed their assignment May 9, 2020
@Trafalgar99
Copy link

Good job,thank you.

@Gorgeous2017
Copy link

@sean-mcmanus

Nice.

But the terminal always displays the Terminal will be reused by tasks, press any key to close it. when tasks done.

Look like this:

image

I remember it didn’t appear before. It is a bug?

@imba-tjd
Copy link

imba-tjd commented May 9, 2020

@Gorgeous2017 It did appear before. It's basically similar to "press any key to continue"

@desaifa
Copy link

desaifa commented May 10, 2020

+1 Same issue on Windows 10 after update 1.45.0

Version: 1.45.0 (user setup)
Commit: d69a79b73808559a91206d73d7717ff5f798f23c
Date: 2020-05-07T16:18:48.860Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.19041

@sky5454
Copy link

sky5454 commented May 10, 2020

Actually, if you don't configure a right path for gdb, this error will occur.

@astojanovic-tvz
Copy link

What if I'm not using GDB? I use MS C++.

@muhammad-osaid-tekfocal
Copy link

muhammad-osaid-tekfocal commented May 11, 2020

For those having hard time figuring this out,

  1. Open VS Code and Go to extensions, right click C/C++ then click Extension Settings
  2. Scroll down to last and "C-Cpp: Update channel" will be third last drop down list
  3. Change from default to insiders. (this will be auto saved)
  4. The downloading will start and will ask you to reload once completed AND you are done. :)
  5. Try restarting VS code if step 4 does not asks you to reload. Be patient and pray for your internet speed till you see the reload message.

@lyq1996
Copy link

lyq1996 commented May 11, 2020

+1 Same problem here.

@astojanovic-tvz
Copy link

Thanks muhammad-osaid-tekfocal, it works like a charm! :)

@mangkoran
Copy link

is it okay to revert back to default update channel after updating?

@thomastech
Copy link

It's OK to revert back to the default Update Channel after installing the insiders release. The insider version will remain until a newer official release is available on the default Channel.

  • Thomas

@sean-mcmanus
Copy link
Contributor

@ayams02 We had a bug that prevented auto-downgrading from 0.28.0-insiders3 to 0.27.1 when the updateChannel changes to "Default" (#5464), but that should be fixed for future Insider releases...and we should be releasing 0.28.0 soon anyway.

@sean-mcmanus
Copy link
Contributor

alexr00 added a commit to microsoft/vscode that referenced this issue May 13, 2020
alexr00 added a commit to microsoft/vscode that referenced this issue May 13, 2020
@thomastech
Copy link

Yoo-hoo! Platformio now reports it has 0.28.0 installed. @sean-mcmanus, Thank You.

  • Thomas

@PogoRollo
Copy link

As of about an hour ago I have 0.28.0 installed and the issue is gone.
Thanks @ all the contributors!

@timeneverdie
Copy link

timeneverdie commented May 25, 2020

Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/0.28.0 .

The default template of launch.json and task.json may be not correct as before. I generate many times to get the fine version to debug like before. I don't why, but this is the truth. Wish you could find out the real problem which causes this error. Thanks.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. tasks/build/debug An issue relating to tasks.json (e.g. build issues)
Projects
None yet
Development

Successfully merging a pull request may close this issue.