vscode-task icon indicating copy to clipboard operation
vscode-task copied to clipboard

Extension thinks that `task` is not installed while it is and is up to date

Open EmilyGraceSeville7cf opened this issue 2 years ago • 10 comments

Thanks for your bug report!

Before submitting this issue, please make sure the same problem was not already reported by someone else.

Please describe the bug you're facing. Consider pasting example Taskfiles showing how to reproduce the problem.

Setting full path to task doesn't help:

    "task": {
        "path": "/snap/bin/task"
    }
  • Task version: Task version: v3.27.1 (h1:cftsoOqUo7/pCdtO7fDa4HreXKDvbrRhfhhha8bH9xc=)
  • Operating System: Linux 22.04 Ubuntu

EmilyGraceSeville7cf avatar Jul 05 '23 16:07 EmilyGraceSeville7cf

Hope this issue is getting to be fixed, as I have no wish to use Makefile's again due to this problem.

EmilyGraceSeville7cf avatar Jul 05 '23 16:07 EmilyGraceSeville7cf

Same issue, I installed it from Fedora repository and its binary name is go-task. I tried assigning the path value to go-task in the settings and creating a link named task for go-task, but didn't work.

marifcelik avatar Sep 19 '23 19:09 marifcelik

I hit a similar problem on Mac OS with task managed by asdf:

    "task": {
        "path": "/Users/matt/.asdf/shims/task"
    }
image

mattrussell-sonocent avatar Jan 23 '24 10:01 mattrussell-sonocent

Same here. I installed with snap.

vkhobor avatar Feb 10 '24 03:02 vkhobor

I somehow fixed it with the script between the extension and snap:

  • Create task.sh:
#!/usr/bin/bash
set -euo pipefail
task $@ 2>&1 | cat
  • chmod +x task.sh
  • Update settings.json:
 "task": {
        "path": "/<path to task.sh>/task.sh"
  }

maxhha avatar Feb 18 '24 20:02 maxhha

@maxhha, it didn't work for me... 😞

EmilyGraceSeville7cf avatar Apr 01 '24 16:04 EmilyGraceSeville7cf

Hi all, sorry for the delay getting to this. I've taken a look at the code today. There are two places where the Task not installed message can be displayed:

  1. If the extension was unable to work out what version of Task you're using
  2. If the extension fails to work out what the latest version available is

The latter of these should not be causing this error at all, so that will be removed. I'd like to understand which of these two scenarios people here are running into though. Could anyone facing this issue please let me know the following:

  • The output of task --version (please make sure you call the same task binary as your config points to)
  • The value of task.path in your VSCode settings.
  • Do you have a working internet connection on your machine at the time you open VSCode?
  • Also posting the contents of Task (Debug) from the output window would be useful

Thanks!

pd93 avatar Apr 05 '24 09:04 pd93

Hey Pete!

I also ran into this issue. The output of task --version, from a terminal in vscode: Task version: v3.37.1 (h1:UeOHuozF6CgQTBFdCaZlVB9vkMN/o6WeyaU69p+pEoU=)

The output from Task: (Debug):

Updating settings
Extension activated
Version is undefined
undefined

So I guess it's an issue with the semver parsing, or the execution of task from within the extension? Additionally, this seems to be an issue for me as well: https://github.com/go-task/vscode-task/issues/56

XorJoep avatar Jun 02 '24 20:06 XorJoep

Ok so I had some time and decided I could debug it myself. Checked out the repo and added some debugging lines.

Apparently after executing cp.exec(command, (error, stdout, stderr) both stdoutand stderr are empty, while error(which I've added myself, it is _ in the repo) returns null (success).

This makes no sense, since we see output on the console when we execute the command ourselves, right?

There is output from cp.exec(...) when I change the command to ls for example. And running task --example gives Error: Command failed: task --example.

After some search around I stumbled upon a thread https://github.com/golang/vscode-go/issues/166 which appears to describe the same issue. The problem being both vscode and go being installed with snap. And in my case it's because I've installed both vscode and task through snap.

Their solution is to set the binary's path to /snap/<bin>/current/<bin> And this seemed to work for me, for now:

"task": {
    "path": "/snap/task/current/task",
}

XorJoep avatar Jun 07 '24 14:06 XorJoep

This would explain why I was not able to reproduce. I do not use snap at all. Thanks @XorJoep for doing some research. I'm not sure that there's much we can do about this though. I'm going to leave this open for now as other people in this thread have mentioned package managers other than snap (such as asdf). Hopefully your post helps others.

If you have this issue and @XorJoep's post works for you, please let us know. Likewise, if it doesn't work, a comment would be helpful.

pd93 avatar Jun 07 '24 17:06 pd93