Skip to content

Conflict name with go-task's task runner executable. #3463

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

Closed
gl-yziquel opened this issue May 26, 2024 · 6 comments
Closed

Conflict name with go-task's task runner executable. #3463

gl-yziquel opened this issue May 26, 2024 · 6 comments

Comments

@gl-yziquel
Copy link
Contributor

gl-yziquel commented May 26, 2024

Hi.

I stumbled onto code that required the usage of go-task's task executable. It is a task runner that has the same name as taskwarrior's task.

I need both at the same time: go-task's to run build tasks, and taskwarrior which I use as a local issue tracker in my projects.

If that naming conflict could be addressed, that would make most happy. I do not have high hopes, though.

go-task task issue: go-task/task#1672
taskshell issue: GothenburgBitFactory/taskshell#75
Debian BTS: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1071939

@djmitche
Copy link
Collaborator

I don't think this can be solved by a change for everyone -- lots of people using both tools are used to typing task and would be pretty unhappy to have to change to another command name. However, you can fix this for yourself locally. I assume that the two programs are both installed, but in different directories, like /usr/bin/task and /usr/local/bin/task. Depending on which of those directories appears first in $PATH, you will get one program or the other.

So, one option is adjust $PATH so that it selects the right tool in the right context. Maybe that means your Go development directory puts go-task's path first. It would take a bit of shell-scripting to get it set up how you like.

Another option is just to use alias to make a new name for one of them, e.g., alias tw=/usr/local/bin/task and alias gotask=/usr/bin/task. Then you can just use the distinct names as needed.

@gl-yziquel
Copy link
Contributor Author

gl-yziquel commented May 26, 2024

I indeed need both at the same time in the same context, which is why PATH hackery is not ok. It is indeed solvable with an alias, but I can't rely on other people putting such an alias in their shell conf. Friction. Which is what I want to avoid in what I'm doing...

I'll try to push a TASKBIN env var into taskshell, but I'd hate maintaining a branch for just that if such a change is rejected.

@gl-yziquel
Copy link
Contributor Author

The code here implements TASKBIN as an environment variable to set the path to the taskwarrior executable.

https://github.com/gl-yziquel/taskshell/tree/v1.2.0-yziquel

This helps avoid name conflict between taskwarrior and go-task for the task executable.

@djmitche
Copy link
Collaborator

That seems reasonable! I don't know who maintains taskshell, but a PR based on that branch is a good start.

What other alternatives would you suggest?

@gl-yziquel
Copy link
Contributor Author

gl-yziquel commented May 27, 2024

I don't really have other alternatives as far as that name clash is concerned. It hits me in multiple ways.

As to taskshell, it seems the development has stalled and people have moved on. There was a 1.3.0 release, it seems, but debian has only 1.2.0, and the maintainer has more or less retired.

I've got a debian package built, but in a hacky way and not a reproducible sbuild way yet. If I find time, I'll try to get that small fix in some 1.2.1. And if I manage to contact the former devs of taskshell 1.3.0, will ask them what I should think of that 1.3.0 release, since I've never tried it.

What I don't like in my PR is the location of the environment variable reading that I put closest to where it's used, but I have no real feel to where it should go. Also, it's duplicated. I don't like it. But it does the job.

Most recent github commit on taskshell is here, in @mrVanDalen repositories: https://github.com/mrVanDalo/taskshell

Maybe he's interested in picking it up. Maybe not. Who knows...

@djmitche
Copy link
Collaborator

Sounds good -- and all outside of Taskwarrior, so I'll keep this issue closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants