anki-code / xontrib-pipeliner

Let your pipe lines flow thru the Python code in xonsh.
BSD 2-Clause "Simplified" License
56 stars 5 forks source link

Piping to ppl does not return on Mac #6

Open amitkot opened 2 years ago

amitkot commented 2 years ago

Trying pipeliner on a Mac and the command never returns.

This does not return:

> echo 1 | ppl 'line'

Neither does this:

> echo 1 | ppl 'line' | cat
> xonfig
+------------------+----------------------+
| xonsh            | 0.10.1               |
| Git SHA          | 337cf25a             |
| Commit Date      | Nov 17 15:37:41 2021 |
| Python           | 3.9.9                |
| PLY              | 3.11                 |
| have readline    | True                 |
| prompt toolkit   | 3.0.24               |
| shell type       | prompt_toolkit       |
| history backend  | json                 |
| pygments         | 2.11.2               |
| on posix         | True                 |
| on linux         | False                |
| on darwin        | True                 |
| on windows       | False                |
| on cygwin        | False                |
| on msys2         | False                |
| is superuser     | False                |
| default encoding | utf-8                |
| xonsh encoding   | utf-8                |
| encoding errors  | surrogateescape      |
| on jupyter       | True                 |
| jupyter kernel   | None                 |
| xontrib 1        | bashisms             |
| xontrib 2        | coreutils            |
| xontrib 3        | jedi                 |
| xontrib 4        | pipeliner            |
| xontrib 5        | pyenv                |
| xontrib 6        | sh                   |
| xontrib 7        | vox                  |
| xontrib 8        | vox_tabcomplete      |
| xontrib 9        | voxapi               |
+------------------+----------------------+
anki-code commented 2 years ago

This looks like a known issue - https://github.com/anki-code/xontrib-pipeliner#ppl-on-macos-multicore-pipelining-freezes-on-end

anki-code commented 2 years ago

You can use pl instead of ppl on mac.

amitkot commented 2 years ago

Sadly these do not work as well:

> echo 1 | pl 'line'
> echo 1 | pl 'line' | cat
amitkot commented 2 years ago

@anki-code Is there a "debug" flag I can run with to see why it freezes?

amitkot commented 2 years ago

@anki-code I really like this idea, but this does not work for me. Any idea how to make it work?

anki-code commented 2 years ago

May be this is also related to $XONSH_CAPTURE_ALWAYS. Try to set $XONSH_CAPTURE_ALWAYS = True before usage.

anki-code commented 2 years ago

@amitkot pl is a callable alias:

https://github.com/anki-code/xontrib-pipeliner/blob/022071c86685746e6b6ccc64199fc1b9a36dff39/xontrib/pipeliner/__init__.py#L9-L38

So as a good start you can just debug this function on mac.