babashka / process

Clojure library for shelling out / spawning sub-processes
Eclipse Public License 1.0
219 stars 29 forks source link

`pb {:in "foo"}` hangs #110

Open dbohdan opened 1 year ago

dbohdan commented 1 year ago

I have run into an apparent hang when using pb in babashka on Linux. I can't determine if I am using the interface wrong or if this is a bug. Please advise.

> bb --version
babashka v1.3.176
> bb -e '(-> (babashka.process/process {:in "hi"} "cat") (babashka.process/process "cat") :out slurp)'
"hi"
> bb -e '(-> (babashka.process/pipeline (babashka.process/pb {:in :inherit} "cat") (babashka.process/pb "cat")) last :out slurp)'
^D
""
> bb -e '(-> (babashka.process/pipeline (babashka.process/pb {:in "hi"} "cat") (babashka.process/pb "cat")) last :out slurp)'

This is where babashka seems to wait forever. It does not react to ^D, only ^C.

borkdude commented 1 year ago

@dbohdan This is probably a bug.

E.g. this works:

$ bb -e '(-> (babashka.process/pipeline (babashka.process/pb "echo hello") (babashka.process/pb "cat")) last deref :out slurp)'
"hello\n"

but the :in option is probably not respected with pipeline / pb.

dbohdan commented 1 year ago

I see. Thanks. I've replaced my use with babashka.process/process.