lein-protobuf icon indicating copy to clipboard operation
lein-protobuf copied to clipboard

Subprocess error handling

Open berdario opened this issue 11 years ago • 0 comments

There're plenty of things that can go wrong during the compilation of protobuf:

  • Missing c++ compiler (but with the C and gcc preprocessor installed)
  • this issue
  • javax.tools.ToolProvider/getSystemJavaCompiler will yield nil (even if the OpenJDK is installed and javac is in the PATH... I get this issue on Fedora but not on Ubuntu)

thus, it'd be better to fail fast and report errors when they happen.

lein-protobuf currently doesn't even output at all the stderr of ./configure and make.

The first commit does it, but by printing the commands output when they exit. In the second commit I updated conch, but there seems to still be some issues with the output buffering and the change is slightly more invasive.

I chose to avoid printing the stderr right away, and print it only at the end if the command failed, but maybe it'd be better to just print a generic error message after the full output.

berdario avatar May 01 '14 15:05 berdario