-
Notifications
You must be signed in to change notification settings - Fork 711
Improve debug logging in Cabal/cabal-install #7420
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
Comments
I was curious about how to implement something like this in a Haskell application, cabal-install in particular. Other desirable properties would be:
I have a working experiment in this branch. Here's the diff. I did not make a pull request because this is mostly a proof-of-concept. After compiling
So, how does it work? There are three main new modules:
There's also an example Things that work well in this approach:
Things that don't work so well:
|
I spent some time with debug logging in other console applications and it gave me some thoughts about how I would go about improving debug logging in Cabal/cabal-install. One big thing about working in this space is that it is very feasible for someone new to the project to make a big difference here (this is compared to adding new features to the Cabal file format, which require much more rigor--easy to YOLO debug loggin changes!) Some thoughts here:
Design intentional output formats for internal data structures. In #6835 @danidiaz spent a lot of time going through the internal representations to look for where things "went wrong", and had to make modifications to get out the information they needed (e.g., #6835 (comment)). This shouldn't be necessary. We should aim for:
-v3
triggers verbose GHC output, which is rarely what you want if you're only debugging Cabal.Make the log output more indexable. In many cases, debug output dumps out some data structure without any information about what the output is about. This makes it difficult to grep logs to find the debug output associated with. It should be easy to tell what code in Cabal produced any given log line. (This is made more difficult by the fact that a lot of output in the logs are multi-lined).
Add a rage mechanism. If you don't know what rage is, read my blog post http://blog.ezyang.com/2021/04/rage-bug-reporting/ When people submit bug reports, if we can make it as easy as possible for them to report verbose debug logs, even if they hadn't initially run the command with
-v
.The text was updated successfully, but these errors were encountered: