Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subprocess error handling #9

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

berdario
Copy link

@berdario berdario commented May 1, 2014

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.

…teps

A better solution using the latest version of Conch, would be something like:
@(:exit-code (command {:out *out* :redirect-err true :verbose true}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant