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

Creating and running a shell task results in errors in output #157756

Closed
gnikit opened this issue Aug 10, 2022 · 5 comments
Closed

Creating and running a shell task results in errors in output #157756

gnikit opened this issue Aug 10, 2022 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug confirmation-pending *duplicate Issue identified as a duplicate of another issue(s)

Comments

@gnikit
Copy link

gnikit commented Aug 10, 2022

Type: Bug

I believe this is a resurface of #95876

Again, the task runs to completion it just pollutes the Tasks Output. Am I missing something?
For me it triggers with the relatively simple snippet

export async function shellTask(command: string, args: string[], name: string) {
  const task = new vscode.Task(
    { type: 'shell' },
    vscode.TaskScope.Workspace,
    name,
    'Modern Fortran',
    new vscode.ShellExecution(command, args)
  );
  // (<vscode.Task>task).definition = { type: 'shell', command: command };
  const execution = await vscode.tasks.executeTask(task);
  return await new Promise<void>((resolve, reject) => {
    const disposable = vscode.tasks.onDidEndTask(e => {
      if (e.execution === execution) {
        disposable.dispose();
        resolve();
      } else reject();
    });
  });
}

The only way to supress the Tasks output is by uncommenting the (<vscode.Task>task)... line

Tasks output is again similar to issue 95876

Error: the task 'Modern Fortran: pip' neither specifies a command nor a dependsOn property. The task will be ignored. Its definition is:
{
    "type": "shell",
    "id": "shell,python3,-m,pip,install,--user,--upgrade,fortls,",
    "problemMatcher": [],
    "label": "Modern Fortran: pip"
}

VS Code version: Code - Insiders 1.71.0-insider (b0895f9, 2022-08-08T05:19:04.908Z)
OS version: Linux x64 5.4.0-122-generic
Modes:
Sandboxed: Yes

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 3447)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 2, 1, 1
Memory (System) 31.21GB (20.56GB free)
Process Argv --unity-launch --crash-reporter-id 6298fe7a-017f-49f3-97ec-87f419e63426
Screen Reader no
VM 0%
DESKTOP_SESSION cinnamon
XDG_CURRENT_DESKTOP X-Cinnamon
XDG_SESSION_DESKTOP cinnamon
XDG_SESSION_TYPE x11
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30422396
pythontb:30258533
pythonvspyt551:30291412
pythonptprofiler:30281269
vsdfh931cf:30280410
vshan820:30294714
pythondataviewer:30285072
vscod805cf:30301675
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30404738
wslgetstarted:30449409
cppdebug:30492333
pylanb8912:30522163
vsclangdf:30492506
c4g48928:30535728
dsvsc012cf:30540253

@meganrogge meganrogge added bug Issue identified by VS Code Team member as probable bug confirmation-pending labels Aug 11, 2022
@meganrogge meganrogge added this to the Backlog milestone Aug 11, 2022
@github0null
Copy link

github0null commented Nov 29, 2022

Same problem:

  • VSCode Version: 1.72.2

My Code:

const task = new vscode.Task({ type: 'shell', command: commandLine }, vscode.TaskScope.Workspace,
                title, 'eide', new vscode.ShellExecution(commandLine, shellOption), []);
task.group = vscode.TaskGroup.Build;
task.isBackground = false;
task.presentationOptions = { echo: true, focus: false, clear: true };
vscode.tasks.executeTask(task);

Task works but output tell me error:

Error: the task 'eide: build:Release' neither specifies a command nor a dependsOn property. The task will be ignored. Its definition is:
{
    "type": "shell",
    "id": "shell,\"unify_builder -p xxxxxxx",",
    "group": "build",
    "problemMatcher": [],
    "label": "eide: build:Release"
}

@bwateratmsft
Copy link
Contributor

bwateratmsft commented Jan 4, 2023

The Docker extension uses tasks built on-the-fly like this extensively and we see these error messages too. microsoft/vscode-docker#3653

@adriancostin6
Copy link

adriancostin6 commented May 3, 2023

VS Code Version:

This affects me as well, the following snippet produces similar errors to the ones described above:

await tasks.executeTask(
        new Task(
            { type: 'shell' },
            TaskScope.Workspace,
            'Start GDB server',
            'debugger',
             new ShellExecution(
                `\"${resolveGdbExecutable(profile, 'gdbserver').fsPath}\"`.concat(
                    ` localhost:${port} --attach ${processId}`
                ), {
                    executable: 'cmd',
                    shellArgs: ['/d', '/c'],
                }
    )));
Error: the task 'debugger: Start GDB server' neither specifies a command nor a dependsOn property. The task will be ignored. Its definition is:
{
    "type": "shell",
    "id": "shell,\"c:\\Users\\adrian\\common\\tools\\mingw32\\bin\\gdbserver.exe\" localhost:2002 --attach 19360,",
    "problemMatcher": [],
    "label": "debugger: Start GDB server"
}
Error: the task 'debugger: Start GDB server' neither specifies a command nor a dependsOn property. The task will be ignored. Its definition is:
{
    "type": "shell",
    "id": "shell,\"c:\\Users\\adrian\\common\\tools\\mingw32\\bin\\gdbserver.exe\" localhost:2002 --attach 19360,",
    "problemMatcher": [],
    "label": "debugger: Start GDB server"
}

As you can see, in this case the errors double up, further cluttering the "Output " window.

@edwinbradford
Copy link

As someone who's not a developer by profession this issue cost me a lot of time trying to find out if it was my error or something else. It would be helpful if the error message could at least be changed to clarify the cause for those who aren't advanced enough to track it down to a bug with the Docker extension.

@meganrogge
Copy link
Contributor

/duplicate #176670

@VSCodeTriageBot VSCodeTriageBot added the *duplicate Issue identified as a duplicate of another issue(s) label Dec 5, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug confirmation-pending *duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

8 participants