swaros / contxt

context manager
MIT License
0 stars 0 forks source link

interactive shell: long running in different workspace blocks other tasks #188

Open swaros opened 1 year ago

swaros commented 1 year ago

Describe the bug if a task running in a different folder by using workingdir for long or infinite time, the whole environment is moved to this directory. this (seems) not an issue for regular execution like ctx run target. but will be an issue while running in the interactive mode. there we have the current targets loaded, but by trying to executing anything, contxt is trying to read the taskfile and fails.

To Reproduce Steps to reproduce the behavior:

  1. create a taskfile that have an task with different workingdir path
  2. for easier reproduction do not add an taskfile in this folder
  3. make this task long time running like an infinite loop or simple wait
  4. add an other task just for testing
  5. start the interactive mode.
  6. start the task the uses the different workspace setting
  7. try to start the other task while the first task is still running
  8. see error

Expected behavior any task should run in his own environment depending the expected path. also the interactive shell should always start from root of the project.

swaros commented 1 year ago

fixed a more global issue by using the workingdir behavior. the context for these was way to big, so even regular task was executed in wrong paths. this is fixed by moving the logic around the execution itself. (get pushd before, popd afterwards)

but this is not the fix for this issue, because for infinity running tasks, we do not leave the execution.

so maybe pushd and popd for each script line execution inside the exec, or always sticking to theCTX_PWD path for anything outside an execution

swaros commented 8 months ago

this is not fixed. just reduced the amount of failures depending of this issue. so the issue test is disabled because it breaks a couple of tests.