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

Catch warnings and messages #212

Closed
5 tasks done
wlandau opened this issue Feb 1, 2018 · 8 comments
Closed
5 tasks done

Catch warnings and messages #212

wlandau opened this issue Feb 1, 2018 · 8 comments

Comments

@wlandau
Copy link
Member

wlandau commented Feb 1, 2018

Suggested by @krlmlr, also by @fmichonneau in richfitz/remake#177. For drake, I think a good solution will:

  1. Print out warnings and messages to the console when the targets are actually building instead of waiting until the very end.
  2. Store the warnings and messages alongside errors in a new "logs" subspace. (Subspaces are condensed versions of storr namespaces that help prevent Huge number of files in .drake/keys .drake/data #154.) Errors are processed and cached here. I suspect ordinary exception handling around the call to one_try() would catch warnings.
  3. Register the warnings properly so that they show up if the user calls warnings() after make().
  4. Add a new type argument to diagnose() that could be "error", "warning", or "message", depending on the kind of build log the user wants. I am open to suggestions for better names. type could be more specific, and diagnose() could be generalized to a drake_build_log() at that point.

Edit: to do:

  • Make diagnose() report errors, warnings, messages, etc.
  • Update vignettes and other documentation that references diagnose().
  • Test that warnings and messages are printed out at the right times.
  • Test that target values, errors, and entire build logs are stored properly.
  • Run full battery of long package checks.
@wlandau
Copy link
Member Author

wlandau commented Feb 4, 2018

We could also do some restructuring here to help the manual scheduler avoid requiring its workers to access the cache. Most of it will be in run.R and build.R. As @krlmlr mentioned, this could help with Digital Ocean-based caches.

@wlandau
Copy link
Member Author

wlandau commented Feb 5, 2018

If we do not want remote processes to write to the cache (#236), then we may have to wait for future to make it possible: futureverse/future#25.

@wlandau
Copy link
Member Author

wlandau commented Feb 5, 2018

Echoing @krlmlr's comment in richfitz/remake#177, a complete solution would have drake_build() return an rmonad object. #236 needs something like this, so #227 and #237 rely on it too. Learning rmonad is very high on my priority list.

@wlandau
Copy link
Member Author

wlandau commented Feb 8, 2018

FYI: exception handling in rmonad.

@wlandau
Copy link
Member Author

wlandau commented Feb 9, 2018

More thoughts: warnings and errors would naturally constitute part of the running meta list (metadata on targets). It will be simpler to load it with drake_meta() like all the other metadata.

@wlandau
Copy link
Member Author

wlandau commented Feb 9, 2018

Update: I am optimistic about being able to push a fix today or tomorrow. Rather than jumping to fancy data structures, the expedient thing turned out to be just to add more stuff to the existing metadata. The main change that users will notice is the diagnose() function. Rather than just the error log, diagnose() will print a list that also contains any warnings, messages, and other context of the build.

@wlandau
Copy link
Member Author

wlandau commented Feb 9, 2018

Fixed via #248. Tougher than I expected, but it really helps get the internals ready for the next issues.

@wlandau wlandau closed this as completed Feb 9, 2018
wlandau pushed a commit that referenced this issue Feb 10, 2018
@krlmlr
Copy link
Collaborator

krlmlr commented Feb 10, 2018

Thanks for looking into it! I'm really eager to try this out, but might take a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants