Closed dstadelm closed 5 months ago
hey. source code is not impeccable but quite stable. said that there is a release due for some time already... I am trying to find time for that...
This per task "current working directory" should be on FAQ. The problem is that each process can have only ONE current directory. So that is not thread-safe or other (ie. async) mechanism for parallelization.
If you want to do that at your own risk it is easy enough to do user land.
If you explicitly import CmdAction [1], you can use underlying cwd
parameter provided by subprocess module.
Hey, there! Thank you for your fast response. It is really good to see that the project is alive and kicking!
I just assumed that you use something like popen or similar to run cli commands. There it would be quite easy to pass the cwd. However I think I understand the problem if the action isn't an cmd but a python function. However maybe, as the tasks should be completely independent one could use processes for the task instead of threads. I've once done something similar in a other context using ruby.
I will admit this is all from a very distant observation, without knowing the internals of doit. So please let me apologize if what I am saying is complete nonsense.
I will look at CmdAction, but I think, currently the pain is too small for me to go that route.
Thanks again!
In some cases it would be desirable to define the working directory of a task. E.g. run cmake in a subdirectory.
What I imagine:
Alternatives The current example is not to good, as with cmake we could provide the path. But there are other programs that will not work if not called in the supposed directory. For those one can of course change to that directory in the action, but I personally find that cumbersome, because it clutters the actual action.
This issue is also somewhat a test to see how active the doit project still is, as the last commit is already quite a while. Of course this could be due to impeccable source code š
Upvote & Fund