jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
8.11k stars 214 forks source link

Add a MISE_TASK_OUTPUT="keep-order' to not mix the task output #2347

Open boris-smidt-klarrio opened 4 days ago

boris-smidt-klarrio commented 4 days ago

Mise runs tasks in parallel and as a result the lines are mixed up between the tasks. This makes it sometimes hard to follow why the task failed.

To solve this a new MISE_TASK_OUTPUT could be made named 'keep-order' inspired by GNU parallel. When the keep-order is enabled the tasks are still run in parallel but the output of the task is ordered by the task. It would be a useful feature to use in case of a CI output.

Here is an example of what parallel does, it would also keep the same order in case of a multiple line output:

printf "%s\0" {1..5} | parallel -r0 -n 1 -P 10 sha256sum
sha256sum: 1: No such file or directory
sha256sum: 5: No such file or directory
sha256sum: 2: No such file or directory
sha256sum: 4: No such file or directory
sha256sum: 3: No such file or directory
printf "%s\0" {1..5} | parallel --keep-order -r0 -n 1 -P 10 sha256sum
sha256sum: 1: No such file or directory
sha256sum: 2: No such file or directory
sha256sum: 3: No such file or directory
sha256sum: 4: No such file or directory
sha256sum: 5: No such file or directory

The disadvantage is that nothing appears until the previous task is finished. An interactive user interface like a spindle could be used to show the current running tasks.

jdx commented 4 days ago

great suggestion 👍