kevva / bin-build

Easily build binaries
MIT License
38 stars 13 forks source link

Improve error messages #2

Closed kevva closed 8 years ago

kevva commented 10 years ago

Like discussed in imagemin/imagemin#32, we should improve error messages to include instructions on what dependencies are needed for builds to succeed.

I've been thinking about introducing a .dependency(dep, os) method which collects the dependencies and if the build fails it writes a error message and lists the dependencies needed.

@sindresorhus, wdyt?

sindresorhus commented 10 years ago

:+1: How would an error message look like?

kevva commented 10 years ago

Something along these lines:

[text (blablabla, make sure the following dependencies are installed:]

  dep1
  dep2

[stack trace]
sindresorhus commented 10 years ago

blablabla isn't very useful though.

kevva commented 10 years ago

well, it's what i'm going with.

elesueur commented 9 years ago

At the very least, it would be very useful for binbuild to explain in a log message which command failed and what was CWD of the command so you can find the logs.

e.g. ./configure ...

Lets say that the system doesn't have a necessary library installed, how would I find out which library to install?

kevva commented 9 years ago

Sorry, totally forgot about this. I'll try fix something asap.

elesueur commented 9 years ago

In the meantime, can you help me out with where to find the logs for the commands that run? I tried looking in npmcache, and the tmpdir. Are they getting nuked after npm exits?

elesueur commented 9 years ago

Sorry, forgot to say Thanks for looking into it! I appreciate the help and the quick response.

kevva commented 9 years ago

The commands aren't logged currently. Look at the code in the modules instead.

elesueur commented 9 years ago

That may be the case, but for instance, running ./configure will produce a config.log file somewhere in the build directory or the source directory. What is the current working directory when the commands are run?

kevva commented 9 years ago

It's a temp directory so it may vary.