dbuenzli / bos

Basic OS interaction for OCaml
http://erratique.ch/software/bos
ISC License
64 stars 16 forks source link

Bos.OS.Cmd.to_string hangs indefinitely if the command does not exist #58

Closed hcarty closed 8 years ago

hcarty commented 8 years ago

Testing in utop, the following hangs indefinitely (OCaml 4.02.3 64bit, OSX 10.11, Bos 0.1.3 from opam):

#require "bos.top";;
Bos.Cmd.v "fake" |> Bos.OS.Cmd.run_out |> Bos.OS.Cmd.to_string;;
dbuenzli commented 8 years ago

This is a utop bug it does all sorts of things I don't want to know about (see e.g. https://github.com/diml/utop/issues/152). Try with ocaml you'll see there's no problem:

# Bos.Cmd.v "fake" |> Bos.OS.Cmd.run_out |> Bos.OS.Cmd.to_string;;
ocaml: [EXEC:45867] ['fake']
- : (string, _[> Rresult.R.msg ]) Bos.OS.result =
Result.Error (`Msg "run ['fake']: exited with 127")
hcarty commented 8 years ago

Ah, thank you! Sorry for the noise.

dbuenzli commented 8 years ago

Ah, thank you! Sorry for the noise.

No problem. May not be evident to figure out...