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

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

Open
EmilyGraceSeville7cf opened this issue Jul 5, 2023 · 10 comments
Labels
area: binary Changes related to the task binary type: bug Something not working as intended.

Comments

@EmilyGraceSeville7cf
Copy link

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
Copy link
Author

EmilyGraceSeville7cf commented Jul 5, 2023

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

@marifcelik
Copy link

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.

@mattrussell-sonocent
Copy link

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

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

@vkhobor
Copy link

vkhobor commented Feb 10, 2024

Same here. I installed with snap.

@maxhha
Copy link

maxhha commented Feb 18, 2024

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"
  }

@EmilyGraceSeville7cf
Copy link
Author

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

@pd93 pd93 added type: bug Something not working as intended. area: binary Changes related to the task binary labels Apr 5, 2024
@pd93
Copy link
Member

pd93 commented Apr 5, 2024

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!

@XorJoep
Copy link

XorJoep commented Jun 2, 2024

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: #56

@XorJoep
Copy link

XorJoep commented Jun 7, 2024

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 golang/vscode-go#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",
}

@pd93
Copy link
Member

pd93 commented Jun 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: binary Changes related to the task binary type: bug Something not working as intended.
Projects
None yet
Development

No branches or pull requests

7 participants